Obě strany předchozí revize Předchozí verze Následující verze | Předchozí verze |
it:software:invoiceninja [2024/01/05 13:53] – Petr Nosek | it:software:invoiceninja [2024/01/05 17:31] (aktuální) – [QR kód] Petr Nosek |
---|
| |
O proměnné je psáno [[https://forum.invoiceninja.com/t/qr-codes-scan-and-pay/3713/10|zde]] a [[https://forum.invoiceninja.com/t/issue-with-custom-fields-amount-and-other-fields-should-only-contain-float-no-currency-text/10253|zde]]. | O proměnné je psáno [[https://forum.invoiceninja.com/t/qr-codes-scan-and-pay/3713/10|zde]] a [[https://forum.invoiceninja.com/t/issue-with-custom-fields-amount-and-other-fields-should-only-contain-float-no-currency-text/10253|zde]]. |
| |
| Jenom jsem nasadil QR platby, tak u druhé faktury dostal Google výpadek a nejde generovat QR obrázky. To mě dovedlo k alternativní službě, která je jistým způsobem ještě jednodušší, protože parametry účtu předávám v rámci parametrů. |
| |
| Dokumentaci jsem našel na serveru [[https://qr-platba.cz/pro-vyvojare/restful-api/|qr-platba.cz]] a tady je příklad kódu: |
| |
| <code html> |
| <img src="http://api.paylibo.com/paylibo/generator/czech/image?accountNumber=222885&bankCode=5500&amount=250.00¤cy=CZK&vs=333&message=FOND%20HUMANITY%20CCK" /> |
| </code> |
| |
| |
===== Šablona ===== | ===== Šablona ===== |
| |
Šablonu jsem postavil na **Business template**. | Šablonu jsem postavil na **Business template**. Přidal jsem ještě některé styly na další úpravy. Některé jsem později vypnul, protože jsem našel jinou volbu v nastavení, které problém řešila. |
| |
| <code css> |
| /* [data-ref="product_table-product.item-th"], |
| [data-ref="product_table-product.item-td"] { display:none; }*/ |
| |
| |
| p[data-ref="company_details-company.id_number"]::before { |
| content: "I\00010C: "; |
| display: inline; /* nebo 'inline-block' pokud potřebujete další formátování */ |
| } |
| |
| p[data-ref="company_details-company.id_number"], p[data-ref="company_details-company.id_number"] > p { |
| display: inline-block; |
| margin-bottom: 5px; |
| } |
| |
| [data-ref="company_details-company.custom1"]{ |
| margin-top: 10px; |
| } |
| |
| p[data-ref="client_details-client.number"]:not(:empty)::before { |
| content: "I\00010C: "; |
| display: inline; /* nebo 'inline-block' pokud potřebujete další formátování */ |
| } |
| |
| p[data-ref="client_details-client.number"], p[data-ref="client_details-client.number"] > p { |
| display: inline-block; |
| } |
| |
| p[data-ref="client_details-client.vat_number"]:not(:empty)::before { |
| content: "DI\00010C: "; |
| display: inline; /* nebo 'inline-block' pokud potřebujete další formátování */ |
| } |
| |
| p[data-ref="client_details-client.vat_number"], p[data-ref="client_details-client.vat_number"] > p { |
| display: inline-block; |
| margin-bottom: 10px; /* Pro jistotu, aby nebyly žádné defaultní marginy */ |
| } |
| |
| #payment-instructions{ |
| font-size: 18px !important; |
| padding-bottom: 30px; |
| padding-top: 10px; |
| |
| } |
| |
| #payment-instructions strong{ |
| font-size: 20px; |
| } |
| |
| [data-ref="client_details-client.phone"] { margin-top: 10px } |
| |
| /*[data-ref="totals_table-net_subtotal"] { display: none } |
| [data-ref="totals_table-net_subtotal-label"] { display: none } |
| [data-ref="totals_table-subtotal-label"] { display: none } |
| [data-ref="totals_table-subtotal"] { display: none }*/ |
| |
| </code> |
| |
| A tady kód samotné šablony. |
| |
| <code html> |
| <div id="body"> |
| <div class="header-container"> |
| <img src="$company.logo" class="company-logo" alt="$company.name logo"> |
| <div id="company-details"></div> |
| <div id="company-address"></div> |
| </div> |
| <div class="client-and-entity-wrapper"> |
| <div id="client-details"><p class="entity-issued-to">$entity_issued_to_label:</p></div> |
| <div id="vendor-details"></div> |
| <div id="shipping-details"></div> |
| <div class="entity-details-wrapper"> |
| <table id="entity-details" cellspacing="0" dir="$dir"></table> |
| </div> |
| </div> |
| <div id="payment-instructions">Platbu <strong>$amount</strong> proveďte na účet číslo <strong>280 158 1174/2010</strong>, s variabilním symbolem <strong>$number</strong></div> |
| <table id="product-table" cellspacing="0" data-ref="table"></table> |
| <table id="task-table" cellspacing="0" data-ref="table"></table> |
| <table id="delivery-note-table" cellspacing="0" data-ref="table"></table> |
| <table id="statement-invoice-table" cellspacing="0" data-ref="table"></table> |
| <div id="statement-invoice-table-totals" data-ref="statement-totals"></div> |
| <table id="statement-payment-table" cellspacing="0" data-ref="table"></table> |
| <div id="statement-payment-table-totals" data-ref="statement-totals"></div> |
| <table id="statement-credit-table" cellspacing="0" data-ref="table"></table> |
| <div id="statement-credit-table-totals" data-ref="statement-totals"></div> |
| <table id="statement-aging-table" cellspacing="0" data-ref="table"></table> |
| <div id="statement-aging-table-totals" data-ref="statement-totals"></div> |
| <div id="table-totals" cellspacing="0">$status_logo</div> |
| <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABBQAAAF8CAYAAAB..." width="35%" style="display: block; margin-left: auto;" /> |
| </div> |
| <div> |
| <img src="https://chart.googleapis.com/chart?cht=qr&chl=SPD*1.0*ACC:CZ8520100000002801581174*AM:$amount_raw*CC:CZK*X-VS:$number&chs=200x200&chld=L|0" class="qr-code img-thumbnail img-responsive" /> |
| </div> |
| </code> |
| |
| Výsledek pak vypadá takto: |
| |
| {{:it:software:pasted:20240105-150706.png}} |