Faktury - przykład
Poniżej przedstawiamy przykładowy kod dla szablonu faktury pośrednika.
UWAGA
Faktura jest budowana w części dynamicznie i najlepiej używać edytora "Zaawansowana edycja (widok kodu HTML)" dostępnego w "Akcje"
Dostępne parametry:
W kodzie jest generowana dynamicznie tabelka dla stawek po przez funkcję "#[each (vatsNotNull,vatName)]".
Kod odpowiedzialny za tą tabelkę
<tr> <td class="no-border" colspan="6"></td> <td class="padding2" align="center">#m[rateSummary]</td> <td class="padding2" align="center">#m[nettoSummary]</td> <td class="padding2" align="center">#m[vatSummary]</td> <td class="padding2" align="center">#m[bruttoSummary]</td> </tr> #[each (vatsNotNull,vatName)] <tr> <td class="no-border" colspan="6"></td> <td>[[vatName].name]</td> <td align="right">[[vatName].netto]</td> <td align="right">[[vatName].vat]</td> <td align="right">[[vatName].brutto]</td> </tr> [/each] <tr> <td class="no-border" colspan="6"></td> <td align="right" class="uppercase">#m[allprice]</td> <td align="right">[subjectNettoCount] [currency]</td> <td align="right">[subjectVatCount] [currency]</td> <td align="right"><strong>[subjectBruttoCount] [currency]</strong></td> </tr>
Przykład całości
Kod HTML do wklejenia w oknie "Zawartość szablonu"
<div> <div> #[if (invoicePrintTypeDuplicate)]<div style="width: 100%;text-align: right; color: #000000;">[invoicePrintTypeDuplicate]</div>[/if] <table style="width: 100%;"> <tbody> <tr> <td rowspan="3" style="width: 33%;"><img src="/image/show/[logoId]" width="200px"/></td> <td rowspan="2"><strong> #[if (invoiceType==Faktura Pro forma)][invoiceType][/if] #[if (invoiceType!=Faktura Pro forma)] #[if (issuanceDate>=yearNow)] #[if (!corrective)]Faktura[/if] #[if (corrective)]Faktura korygująca[/if] [/if] #[if (yearNow>issuanceDate)] #[if (!corrective)]Faktura VAT[/if] #[if (corrective)]FAKTURA VAT KOREKTA[/if] [/if] [/if]</strong></td> <td style="width: 33%;"><strong>#m[no] [invoiceNo] </strong></td> </tr> <tr> <td><strong>#m[oryginal] / #m[copy]</strong></td> </tr> <tr> <td>#m[issuanceDate]: <strong>[issuanceDate]</strong></td> <td>#m[transactionDate]:<strong> #[if (corrective)][parentTransactionDate][/if]#[if (!corrective)][transactionDate][/if]</strong></td> </tr> </tbody> </table> <table style="width: 100%;"> <tr> <td style="width: 50%; text-align: left; vertical-align: top;"><strong>#m[seller]:<br/><br/>[sellerCompanyName]</strong><br/>[sellerStreet]<br/> [sellerPostalCode] [sellerCity]#[if (sellerCountry)] <br/> [sellerCountry] [/if]<br/> #m[registerId]: [sellerRegisterId] </td> <td style="width: 50%; text-align: left; vertical-align: top;"> <strong>#m[buyer]:</strong><br/><br/><strong> #[if (buyerIsPrivateCustomer)] [buyerFirstName] [buyerLastName][/if] #[if (!buyerIsPrivateCustomer)] [buyerCompanyName][/if] </strong><br/> [buyerStreet]<br/> [buyerPostalCode] [buyerCity] #[if (buyerCountry)] <br/> [buyerCountry][/if] #[if (buyerIsPrivateCustomer)] <br/> #m[buyer.documentNo]: [buyerDocumentNo][/if] #[if (!buyerIsPrivateCustomer)]<br/> #m[registerId]: [buyerRegisterId][/if] </td> </tr> </table> <table style="width: 100%;"> <tr> <td style="width: 33%; text-align: left; vertical-align: top;"> #m[paymentForm]: [paymentForm]<br/> #m[paymentDate]: [paymentDate] </td> <td style="text-align: left; vertical-align: top;"> #[if (paymentBankAccountNo)] #m[bank]: [paymentBankName] <br/> #[if (paymentBankSwiftIbanNo)] #m[swift]: [paymentBankSwiftIbanNo] <br/> [/if] #m[account]: [paymentBankAccountNo] [/if] #[if (paymentBankAccountNo2)] <br/> #m[bank]: [paymentBankName2] #[if (paymentBankSwiftIbanNo2)] #m[swift]: [paymentBankSwiftIbanNo2] <br/> [/if] #m[account]: [paymentBankAccountNo2][/if] #[if (paymentBankAccountNo3)] <br/> #m[bank]: [paymentBankName3] #[if (paymentBankSwiftIbanNo3)] #m[swift]: [paymentBankSwiftIbanNo3] <br/> [/if] #m[account]: [paymentBankAccountNo3][/if] #[if (paymentBankAccountNo4)] <br/> #m[bank]: [paymentBankName4] #[if (paymentBankSwiftIbanNo4)] #m[swift]: [paymentBankSwiftIbanNo4] <br/> [/if] #m[account]: [paymentBankAccountNo4][/if] </td> </tr> </table> #[if (corrective)] <table cellspacing="3"> <tr> <td>#m[correctiveInfo]: <strong>[parentInvoiceNo]</strong></td> <td>#m[issuanceDate]: <strong>[parentIssuanceDate]</strong></td> </tr> </table> <table cellspacing="3"> <tr> <td>#m[correctiveInvoiceTitle]: <strong>[correctiveReason]</strong></td> </tr> </table> [/if] </div> <div> <table style="width: 100%;"> <tr> <td class="no-border"> <table cellspacing="0" style="width: 100%;"> <tbody> <tr> <td class="padding2">#m[subjectItemLp]</td> <td class="padding2">#m[subjectName2]</td> #[if (yearNow>issuanceDate)] <td class="padding2">#m[subjectPKWiU]</td> [/if] <td class="padding2">#m[subjectQuantity]</td> <td class="padding2">#m[subjectPrice]</td> <td class="padding2">#m[subjectNetto]</td> <td class="padding2">#m[subjectVatRate]</td> <td class="padding2">#m[subjectVat]</td> <td class="padding2">#m[subjectBrutto]</td> </tr> #[if (corrective)] <tr> #[if (yearNow>issuanceDate)] <td colspan="9">#m[beforeCorrective]</td> [/if] #[if (issuanceDate>=yearNow)] <td colspan="8">#m[beforeCorrective]</td> [/if] </tr> #[if (buyerName!=parentBuyerName)] <tr> <td colspan="4"/> #[if (yearNow>issuanceDate)]<td />[/if] <td colspan="4" class="buyer-td" style="text-align: left;">#m[buyer]:#[if (parentBuyerIsPrivateCustomer)] <strong>[parentBuyerFirstName] [parentBuyerLastName]</strong>[/if] #[if (!parentBuyerIsPrivateCustomer)] <strong>[parentBuyerCompanyName]</strong>[/if]<br /> <strong>[parentBuyerStreet]</strong>, <strong>#[if (parentBuyerPostalCode)][parentBuyerPostalCode][/if] [parentBuyerCity]</strong>#[if (parentBuyerCountry)], <strong>[parentBuyerCountry]</strong>[/if] #[if (parentBuyerIsPrivateCustomer)] #[if (parentBuyerDocumentNo)]<br/><strong>[parentBuyerDocumentNo]</strong>[/if] [/if] #[if (!parentBuyerIsPrivateCustomer)]<br/>#m[registerId]: <strong>[parentBuyerRegisterId]</strong>[/if]</td> </tr> [/if] <tr> <td>1</td> <td>[subjectDescriptionBefore]</td> #[if (yearNow>issuanceDate)] <td>#[if (subjectVatRateBefore=='0 ')][subjectPKWiU][/if]</td> [/if] <td>1</td> <td>[subjectNettoBefore]</td> <td>[subjectNettoBefore]</td> <td>[subjectVatRateBefore]</td> <td>[subjectVatBefore]</td> <td> [subjectBruttoBefore]</td> </tr> <tr> #[if (yearNow>issuanceDate)] <td colspan="9">#m[afterCorrective]</td> [/if] #[if (issuanceDate>=yearNow)] <td colspan="8">#m[afterCorrective]</td> [/if] </tr> [/if] #[if (corrective)] #[if (buyerName!=parentBuyerName)] <tr> <td colspan="4"/> #[if (yearNow>issuanceDate)]<td />[/if] <td colspan="4" class="buyer-td" style="text-align: left;">#m[buyer]:#[if (buyerIsPrivateCustomer)] <strong>[buyerFirstName] [buyerLastName]</strong>[/if] #[if (!buyerIsPrivateCustomer)] <strong>[buyerCompanyName]</strong>[/if]<br /> <strong>[buyerStreet]</strong>, <strong>[buyerPostalCode] [buyerCity]</strong>#[if (buyerCountry)], <strong>[buyerCountry]</strong>[/if] #[if (buyerIsPrivateCustomer)] #[if (buyerDocumentNo)]<br/><strong>[buyerDocumentNo]</strong> [/if] [/if] #[if (!buyerIsPrivateCustomer)]<br/>#m[registerId]: <strong>[buyerRegisterId]</strong>[/if]</td> </tr> [/if] [/if] <tr> <td>1</td> <td>[subjectDescription]</td> #[if (yearNow>issuanceDate)] <td>#[if (!displayAddInfo)][subjectPKWiU][/if]</td> [/if] <td>1</td> <td>[subjectPrice]</td> <td>[subjectNetto]</td> <td>[subjectVatName]</td> <td>[subjectVat]</td> <td>[subjectBrutto]</td> </tr> <tr> #[if (yearNow>issuanceDate)] <td colspan="4" class="no-border"> </td> [/if] #[if (issuanceDate>=yearNow)] <td colspan="3" class="no-border"> </td> [/if] <td align="right" class="uppercase">#m[allprice]</td> <td>[subjectNetto]</td> <td>×</td> <td>[subjectVat]</td> <td>[subjectBrutto]</td> </tr> <tr> #[if (yearNow>issuanceDate)] <td colspan="4" rowspan="11" class="no-border" style="max-width: 40%;"></td> [/if] #[if (issuanceDate>=yearNow)] <td colspan="3" rowspan="10" class="no-border" style="max-width: 40%;"></td> [/if] <td colspan="5" align="right" class="no-border"> </td> </tr> <tr> <td class="no-border"> </td> <td class="padding2">#m[rateSummary]</td> <td class="padding2">#m[nettoSummary]</td> <td class="padding2">#m[vatSummary]</td> <td class="padding2">#m[bruttoSummary]</td> </tr> #[each (vatsNotNull,vatName)] <tr> <td class="no-border"> </td> <td>[[vatName].name]</td> <td align="right">[[vatName].netto]</td> <td align="right">[[vatName].vat]</td> <td align="right">[[vatName].brutto]</td> </tr> [/each] <tr> <td align="right" class="uppercase">#m[allprice]</td> <td>×</td> <td align="right"> [subjectNettoCount] [currency]</td> <td align="right"> [subjectVatCount] [currency]</td> <td align="right"> [subjectBruttoCount] [currency]</td> </tr> <tr> <td align="right" class="uppercase no-wrap">#m[words]</td> <td colspan="4" align="right"> [say]</td> </tr> </tbody> </table> </td> </tr> </table> </div> <table border="0" cellspacing="0" cellpadding="0" style="width: 100%;"> <tbody> <tr> <td class="no-border" align="center"> <table border="0" cellspacing="0" cellpadding="0" style="width: 100%;"> <tr> <td colspan="2" class="no-border"> <hr/> </td> </tr> <tr> <td class="no-border"><strong>#m[paymentStatus.Paid]: [alreadyPay]</strong></td> <td class="no-border"><strong>#m[invoice.leftToPay]: [leftToPay]</strong></td> </tr> </table> <table border="0" style="width: 100%;"> <tbody> <tr> <td class="no-border" align="center"><br/> <table style="width: 100%;" cellspacing="0" cellpadding="0" border="0"> <tbody> <tr> <td align="center"><br/><br/><br/><span class="tiny">#m[namesReceiverDescription]<br/></span></td> <td class="no-border" style="width: 100px;"></td> <td align="center"><br/>[agentName] [agentLastName]<br/><br/><span class="tiny">#m[namesIssuerDescription]<br/></span> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> </tr> </tbody> </table> <div class="footer"> <table> <tbody> <tr> <td>Strona <span id="pagenumber"></span> / <span id="pagecount"></span></td> </tr> </tbody> </table> </div> </div>
Kod CSS do wklejenia w oknie "Style CSS"
@page { size: A4; margin: 58px 54px; size: 8.27in 11.69in; padding: 0; @bottom-center{ content:element(footer); } } body, html, * { margin: 0; padding: 0; font-size: 11px; color: black; font-family: Arial, Helvetica, sans-serif; } #pagenumber:before { content: counter(page); } #pagecount:before { content: counter(pages); } td { padding: 5px; text-align: center; border: 1px solid #A7A9AC; } .tiny { font-size: 9px; } .font12 { font-size: 12px; } .font13 { font-size: 13px; } .bold { font-weight: bold; } .no-border { border: 0 none; } .no-padding { padding: 0; } td.padding2 { padding: 2px; } .uppercase { text-transform: uppercase;} .lowercase { text-transform: lowercase;} .no-wrap {white-space:nowrap;} .original-copy { font-size: 15px; text-transform: uppercase; width: 55%; } .invoice-title { font-size: 19px; width: 45%; } .white-on-blue { color: #fff; background-color: #0080C6; } .seller-td, .buyer-td { width: 50%; text-align: left; } .payment-details { text-align: left; } .toptable { width: 100%; } .seller-buyer-table { width: 100%; position: relative; top: -3px; } .invoice-date { line-height: 13px; } .subject-table { border-collapse: collapse; width: 100%; } .subject-table td { text-align: center; } .signatures { width: 640px; margin: 20px; } .signatures td { width: 270px; } .footer { position: running(footer); margin: 0 auto; width: 680px; border-top: 1px solid #A7A9AC; height: 90px; vertical-align: bottom; padding: 5px; } .footer table { width: 100%; } .footer table td { width: 50%; } .company-motto { font-size: 16px; color: #09195D; } .invoice-cancelled { border: 3px solid red; position: absolute; top: 35px; left: 295px; background-color: #FFFFFF; color: red; font-weight: bold; font-size: 18px; text-transform: uppercase; }
Kod CSS