Dans cet article, vous trouverez les instructions pour créer un modèle de document pour les factures avec code QR.
Limitations :
- Seules des factures d’une seule page peuvent être créées
- Le code fourni est conçu pour le CHF.
- Le code pays pour chaque destinataire en dehors de la Suisse doit être modifié manuellement dans le modèle.
Veuillez noter que vous devez indiquer votre IBAN sans espaces dans la configuration, car certaines banques ne lisent ou ne traitent pas les espaces, ce qui peut entraîner un message d’erreur pour vos client·e·s.
.
Créer une facture avec code QR
Créez un nouvel en-tête sans marges.
- Accédez au module settings Configurations > Communication > En-tête documents
- Cliquez sur Ajouter un en-tête
Définissez toutes les marges sur 0.
Créez un nouveau modèle de facture.
- Accédez au module settings Configurations > Communication > Modèles de documents > Facture. Il est important de dupliquer le modèle afin de pouvoir ensuite le modifier.
- Donnez un nom à votre modèle de facture.
- Ajoutez maintenant, tout en bas du document, un contenu “Texte”. Sélectionnez le contenu“Texte” depuis le menu de droite et faites le glisser vers le bas du document.
Cliquez ensuite sur “Modifier” :
Puis, cliquez sur l’icône “<>” (code source) :
Copiez maintenant le code HTML suivant. Collez-le dans votre code source, puis cliquez sur OK.
Cliquez ici pour afficher le code HTML<table class="qr">
<tbody>
<tr>
<td class="left">
<div class="left-content">
<h3>Récépissé</h3>
<strong>Compte / Payable à</strong><br />{$company.bank_account|wordwrap:4:' ': true}<br />{$company.company_name}<br />{$company.location_street} {$company.location_housenumber}<br />{$company.location_postalcode}<br />{$company.location_city} {$company.country}<br /><br /><br /><strong>Payable par</strong><br />{$f.customer.displayname}<br />{$f.customer.invoice_street} {$f.customer.invoice_number}<br />{$f.customer.invoice_postalcode} {$f.customer.invoice_city} <br />{iff $f.customer.invoice_country != $company.country}{$f.customer.invoice_country}{/iff} <br />
<table class="currency">
<tbody>
<tr>
<td><strong>Monnaie</strong></td>
<td><strong>Montant</strong></td>
</tr>
<tr>
<td>CHF</td>
<td>{$f.price_invat,noformat|replace:',':' '}</td>
</tr>
</tbody>
</table>
</div>
</td>
<td class="right">
<div class="right-content">
<table class="payment">
<tbody>
<tr>
<td>
<h3>Section de paiement</h3>
<div class="qr-code"><img src="https://qr-generator.io/?swiss=1&margin=0&cht=qr&chs=543x543&chld=H|0&chl=SPC%0A0200%0A1%0A{$company.bank_account}%0AS%0A{$company.company_name}%0A{$company.location_street}%0A{$company.location_housenumber}%0A{$company.location_postalcode}%0A{$company.location_city}%0ACH%0A%0A%0A%0A%0A%0A%0A%0A{$f.price_invat,noformat|replace:',':''}%0ACHF%0AS%0A{$f.customer.displayname}%0A{$f.customer.invoice_street}%0A{$f.customer.invoice_number}%0A{$f.customer.invoice_postalcode}%0A{$f.customer.invoice_city}%0ACH%0ANON%0A%0A{$f.subject}%0AEPD" /></div>
<table class="currency">
<tbody>
<tr>
<td><strong>Monnaie</strong></td>
<td><strong>Montant</strong></td>
</tr>
<tr>
<td>CHF</td>
<td>{$f.price_invat,noformat|replace:',':' '}</td>
</tr>
</tbody>
</table>
</td>
<td><strong>Compte / Payable à</strong><br />{$company.bank_account|wordwrap:4:' ': true}<br />{$company.company_name}<br />{$company.location_street} {$company.location_housenumber}<br />{$company.location_postalcode}<br />{$company.location_city} {$company.country}<br /><br /><br /><strong>Payable par</strong><br />{$f.customer.displayname}<br />{$f.customer.invoice_street} {$f.customer.invoice_number}<br />{$f.customer.invoice_postalcode} {$f.customer.invoice_city}<br />{iff $f.customer.invoice_country != $company.country}{$f.customer.invoice_country}{/iff}</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>Copiez et collez maintenant le code CSS suivant, dans Editer CSS puis cliquez sur Confirmer
Cliquez ici pour afficher le code CSSbody > .templatesection table td {
height: 191mm;
}
body > .templatesection table td td {
height: auto;
}
table.qr td {
vertical-align: top;
font-family: Arial;
}
table.qr td.left {
font-size: 8pt;
}
table.qr td.right, table.payment td {
font-size: 10pt;
}
table.qr td.left strong {
font-size: 6pt;
}
table.qr td.right strong {
font-size: 8pt;
}
table.qr td h3 {
font-size: 11pt;
padding-bottom: 12px;
padding-top: 0px;
margin: 0px;
}
table.qr td.left {
width: 62mm;
height: 105mm;
border-top: 0.75pt solid black;
border-right: 0.75pt solid black;
}
.left-content, .right-content {
padding: 5mm;
}
table.qr td.right {
width: 148mm;
height: 105mm;
border-top: 0.75pt solid black;
}
.qr-code {
width: 46mm;
height: 46mm;
margin-top: 5mm;
margin-bottom: 5mm;
}
.qr-code img {
width: 46mm;
height: 46mm;
}- Enfin, sélectionnez l'en-tête que vous avez créé au début.
- N'oubliez pas de sauvegarder toutes les modifications réalisées.
Cet article vous a-t-il été utile ?
Utilisateurs qui ont trouvé cela utile : 2 sur 4