In questo articolo troverai le istruzioni per creare un modello di documento per le fatture con codice QR.
Limitazioni:
- Possono essere create solo fatture su una singola pagina.
- l codice fornito è progettato per il CHF.
- Il codice paese per ogni destinatario al di fuori della Svizzera deve essere modificato manualmente nel modello.
Ti ricordiamo che devi inserire il tuo IBAN senza spazi nella configurazione, poiché alcune banche non leggono o non elaborano gli spazi, il che potrebbe causare un messaggio di errore ai tuoi clienti.
Creare una fattura con codice QR
Crea una nuova intestazione senza margini.
- Accedi al modulo settings Configurazioni > Comunicazione > Carta intestata.
- Clicca su Aggiungi carta intestata
Imposta tutti i margini a 0.
Crea un nuovo modello di fattura
Vai su settings Configurazioni > Comunicazione > Modelli di documenti > Fatture. È importante duplicare il modello per poterlo modificare successivamente.
Assegna un nome al tuo modello di fattura.
Ora, in fondo al documento, aggiungi un contenuto “Testo”. Seleziona “Testo” dal menu a destra e trascinalo nella parte inferiore del documento.
Poi clicca su Modifica:
Successivamente, clicca sull’icona “<>” (codice sorgente):
Copia il seguente codice HTML. Incollalo nel codice sorgente e poi clicca su OK.
<table class="qr">
<tbody>
<tr>
<td class="left">
<div class="left-content">
<h3>Recivuta</h3>
<strong>Conto / Pagabile a</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>Pagabile da</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>Valuta</strong></td>
<td><strong>Importo</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>Sezione di pagamento</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>Valuta</strong></td>
<td><strong>Importo</strong></td>
</tr>
<tr>
<td>CHF</td>
<td>{$f.price_invat,noformat|replace:',':' '}</td>
</tr>
</tbody>
</table>
</td>
<td><strong>Conto / Pagabile a</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>Pagabile da</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>- Ora copia e incolla il seguente codice CSS in Modifica CSS e poi clicca su Confermare
body > .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;
}Infine, seleziona l’intestazione che hai creato all’inizio.
- Non dimenticare di salvare tutte le modifiche apportate.