I found a nice way with the QR-code for the invoice, but, my problem now is when I have some products/services the numbers go over the section of the QR-code and I was looking for a code or something that makes the QR-code in the second page of the PDF if the content is too large. (printscreen)
I saw that there’s a “pagebreak” code, but, I have no Idea how or where to put it.
I don’t really want to do the page break always, just in the case where I put a lot of content int the first page so… Something conditional… I’ll try with this…
Do you use a default design or a customized one? It looks like you put the QR-code-section into the repeating footer. Otherwise it wouldn’t appear on every page.
yes, posting the code would be great. If it contains sensitive data, please censor it or consider sending me the code as a private message, but censoring would be better because so everyone can have a look on it.
I don’t have any sensitive data on the code… so… here it is…
The files are attached…
Like I said, it’s moust of the “modern” template with the codes for the QR-code in second page. footer.txt (1.1 KB) head.txt (549 Bytes) body.txt (2.2 KB)
the “position: fixed” irritates me. I would delete that.
Here’s the code I use. It contains twig-code to show the QR-code only if there’s something to be payed left about the invoice:
For the body:
<ninja>
{% if invoices %}
{% set invoice = invoices|first %}
{% if invoice.amount != invoice.paid_to_date %}
<div class="pqrcode-grid">
<div id="pqrcode-svg">$sepa_qr_code</div>
<div class="pqrcode-text">
<div id="pqrcode-head">
Einfache Überweisung mittels GiroCode
</div>
Erledigen Sie Ihre Bankgeschäfte mit dem Smartphone? Dann scannen Sie einfach den abgebildeten QR-Code mit Ihrer Mobile-Banking-App. Es werden sämtliche für die Überweisung benötigten Daten automatisch übernommen.
</div>
</div>
{% endif %}
{% endif %}
</ninja>
In my configuration this code is put into a non-page-breakable “block” with the totals-section of the invoice, so the customer always see the option to pay by QR-code when he looks out for the price-sum. Actually the code herefor looks like this:
Body:
<div class="no-page-break">
<div id="table-totals" cellspacing="0">$status_logo</div>
<ninja>
{% if invoices %}
{% set invoice = invoices|first %}
{% if invoice.amount != invoice.paid_to_date %}
<div class="pqrcode-grid">
<div id="pqrcode-svg">$sepa_qr_code</div>
<div class="pqrcode-text">
<div id="pqrcode-head">
Einfache Überweisung mittels GiroCode
</div>
Erledigen Sie Ihre Bankgeschäfte mit dem Smartphone? Dann scannen Sie einfach den abgebildeten QR-Code mit Ihrer Mobile-Banking-App. Es werden sämtliche für die Überweisung benötigten Daten automatisch übernommen.
</div>
</div>
{% endif %}
{% endif %}
</ninja>
</div>
The necessary additional CSS-code (without format-code for the table-totals-section):
.no-page-break {
page-break-inside: avoid;
}
/** Öffentliche Notizen ausblenden, da wir sie bei Bedarf unten einfügen **/
[data-ref="total_table-public_notes"] {
display: none;
}
I do not display the public-notes within the table-totals-section for a better look. So my invoices look like this (I deleted the part with the hint to my general contract-conditions out of the code above!):
The red marked area is the “non-breakable block” I mentioned above. As I wrote before, the QR-code dissappears when the invoice has fully been paid. Therefore the paid-stamp will appear.