@endora-commerce/mod-invoices 0.108.0 → 0.110.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/pages/InvoiceDetail.d.ts.map +1 -1
- package/dist/admin/pages/InvoiceDetail.js +1 -1
- package/dist/admin/pages/InvoiceDetail.js.map +1 -1
- package/dist/admin/templates/invoice-puck-config.d.ts.map +1 -1
- package/dist/admin/templates/invoice-puck-config.js +227 -135
- package/dist/admin/templates/invoice-puck-config.js.map +1 -1
- package/dist/backend/document/block-descriptions.d.ts.map +1 -1
- package/dist/backend/document/block-descriptions.js +2 -0
- package/dist/backend/document/block-descriptions.js.map +1 -1
- package/dist/backend/document/invoice-document-type.d.ts +6 -1
- package/dist/backend/document/invoice-document-type.d.ts.map +1 -1
- package/dist/backend/document/invoice-document-type.js +25 -1
- package/dist/backend/document/invoice-document-type.js.map +1 -1
- package/dist/backend/entities/invoice-line.entity.d.ts +18 -1
- package/dist/backend/entities/invoice-line.entity.d.ts.map +1 -1
- package/dist/backend/entities/invoice-line.entity.js +20 -0
- package/dist/backend/entities/invoice-line.entity.js.map +1 -1
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +36 -4
- package/dist/backend/index.js.map +1 -1
- package/dist/backend/invoices-prose.d.ts +65 -0
- package/dist/backend/invoices-prose.d.ts.map +1 -0
- package/dist/backend/invoices-prose.js +80 -0
- package/dist/backend/invoices-prose.js.map +1 -0
- package/dist/backend/pdf-components/embed-logo-images.d.ts.map +1 -1
- package/dist/backend/pdf-components/embed-logo-images.js +2 -15
- package/dist/backend/pdf-components/embed-logo-images.js.map +1 -1
- package/dist/backend/pdf-components/sample.d.ts.map +1 -1
- package/dist/backend/pdf-components/sample.js +1 -0
- package/dist/backend/pdf-components/sample.js.map +1 -1
- package/dist/backend/pdf-components/sections.d.ts +22 -6
- package/dist/backend/pdf-components/sections.d.ts.map +1 -1
- package/dist/backend/pdf-components/sections.js +70 -37
- package/dist/backend/pdf-components/sections.js.map +1 -1
- package/dist/backend/pdf-components/tree-mapper.d.ts +3 -0
- package/dist/backend/pdf-components/tree-mapper.d.ts.map +1 -1
- package/dist/backend/pdf-components/tree-mapper.js +5 -5
- package/dist/backend/pdf-components/tree-mapper.js.map +1 -1
- package/dist/backend/plugin.d.ts +13 -1
- package/dist/backend/plugin.d.ts.map +1 -1
- package/dist/backend/plugin.js +4 -2
- package/dist/backend/plugin.js.map +1 -1
- package/dist/backend/routes.customer.d.ts +3 -3
- package/dist/backend/routes.customer.d.ts.map +1 -1
- package/dist/backend/routes.customer.js +17 -9
- package/dist/backend/routes.customer.js.map +1 -1
- package/dist/backend/seeds/generic-invoice-template.d.ts +13 -7
- package/dist/backend/seeds/generic-invoice-template.d.ts.map +1 -1
- package/dist/backend/seeds/generic-invoice-template.js +36 -19
- package/dist/backend/seeds/generic-invoice-template.js.map +1 -1
- package/dist/backend/services/auto-issue-reactor.d.ts.map +1 -1
- package/dist/backend/services/auto-issue-reactor.js +6 -2
- package/dist/backend/services/auto-issue-reactor.js.map +1 -1
- package/dist/backend/services/corrective-invoice.d.ts +167 -16
- package/dist/backend/services/corrective-invoice.d.ts.map +1 -1
- package/dist/backend/services/corrective-invoice.js +389 -52
- package/dist/backend/services/corrective-invoice.js.map +1 -1
- package/dist/backend/services/cross-module-context.d.ts +7 -0
- package/dist/backend/services/cross-module-context.d.ts.map +1 -1
- package/dist/backend/services/cross-module-context.js +19 -0
- package/dist/backend/services/cross-module-context.js.map +1 -1
- package/dist/backend/services/invoice-copy-host.service.d.ts.map +1 -1
- package/dist/backend/services/invoice-copy-host.service.js +3 -0
- package/dist/backend/services/invoice-copy-host.service.js.map +1 -1
- package/dist/backend/services/invoice-email-dispatch.d.ts +7 -0
- package/dist/backend/services/invoice-email-dispatch.d.ts.map +1 -1
- package/dist/backend/services/invoice-email-dispatch.js +10 -3
- package/dist/backend/services/invoice-email-dispatch.js.map +1 -1
- package/dist/backend/services/invoice-line-builder.d.ts +4 -0
- package/dist/backend/services/invoice-line-builder.d.ts.map +1 -1
- package/dist/backend/services/invoice-line-builder.js +1 -0
- package/dist/backend/services/invoice-line-builder.js.map +1 -1
- package/dist/backend/services/invoice-paid.d.ts +56 -0
- package/dist/backend/services/invoice-paid.d.ts.map +1 -0
- package/dist/backend/services/invoice-paid.js +74 -0
- package/dist/backend/services/invoice-paid.js.map +1 -0
- package/dist/backend/services/invoice-service.d.ts +53 -2
- package/dist/backend/services/invoice-service.d.ts.map +1 -1
- package/dist/backend/services/invoice-service.js +135 -29
- package/dist/backend/services/invoice-service.js.map +1 -1
- package/dist/backend/services/kept-quantities.d.ts +24 -0
- package/dist/backend/services/kept-quantities.d.ts.map +1 -0
- package/dist/backend/services/kept-quantities.js +32 -0
- package/dist/backend/services/kept-quantities.js.map +1 -0
- package/dist/backend/services/order-returns-lock.d.ts +19 -0
- package/dist/backend/services/order-returns-lock.d.ts.map +1 -0
- package/dist/backend/services/order-returns-lock.js +37 -0
- package/dist/backend/services/order-returns-lock.js.map +1 -0
- package/dist/manifest.d.ts +11 -3
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +14 -1
- package/dist/manifest.js.map +1 -1
- package/dist/migrations/20261108T073244_invoices_invoice_line_kind.d.ts +21 -0
- package/dist/migrations/20261108T073244_invoices_invoice_line_kind.d.ts.map +1 -0
- package/dist/migrations/20261108T073244_invoices_invoice_line_kind.js +28 -0
- package/dist/migrations/20261108T073244_invoices_invoice_line_kind.js.map +1 -0
- package/dist/migrations/index.d.ts +2 -1
- package/dist/migrations/index.d.ts.map +1 -1
- package/dist/migrations/index.js +3 -1
- package/dist/migrations/index.js.map +1 -1
- package/docs/invoices.md +120 -12
- package/i18n/en.json +41 -2
- package/i18n/pl.json +41 -2
- package/package.json +16 -16
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { SupportedLanguage } from '@endora-commerce/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* The prose this module's backend composes for a reader whose language it
|
|
4
|
+
* knows: the labels of a rendered invoice PDF, which carries its own
|
|
5
|
+
* `language`, and the names of the lines an invoice itemises beside the
|
|
6
|
+
* products, which are written in the invoice's language when it is issued
|
|
7
|
+
* (`specs/conventions/module-i18n.md`, the case where the backend can resolve
|
|
8
|
+
* the reader's language).
|
|
9
|
+
*
|
|
10
|
+
* The sentences live in this module's bundle; this table keeps their English
|
|
11
|
+
* beside the code as the last tier, for when the bundle cannot answer.
|
|
12
|
+
* `invoices-prose.test.ts` holds it equal to `i18n/en.json`.
|
|
13
|
+
*/
|
|
14
|
+
export declare const INVOICES_PROSE_EN: {
|
|
15
|
+
readonly 'pdf.title.invoice': "Invoice";
|
|
16
|
+
readonly 'pdf.title.proforma': "Proforma invoice";
|
|
17
|
+
readonly 'pdf.title.correction': "Corrective invoice";
|
|
18
|
+
readonly 'pdf.title.wz': "Goods dispatch note";
|
|
19
|
+
readonly 'pdf.title.numbered': "{title} No. {number}";
|
|
20
|
+
readonly 'pdf.label.ksefNumber': "KSeF number";
|
|
21
|
+
readonly 'pdf.label.issuedAt': "Issue date";
|
|
22
|
+
readonly 'pdf.label.saleDate': "Sale date";
|
|
23
|
+
readonly 'pdf.label.paymentDue': "Payment due";
|
|
24
|
+
readonly 'pdf.label.paymentMethod': "Payment method";
|
|
25
|
+
readonly 'pdf.label.seller': "Seller";
|
|
26
|
+
readonly 'pdf.label.buyer': "Buyer";
|
|
27
|
+
readonly 'pdf.label.taxId': "Tax ID";
|
|
28
|
+
readonly 'pdf.column.ordinal': "No.";
|
|
29
|
+
readonly 'pdf.column.name': "Name";
|
|
30
|
+
readonly 'pdf.column.unit': "Unit";
|
|
31
|
+
readonly 'pdf.column.quantity': "Qty";
|
|
32
|
+
readonly 'pdf.column.unitNet': "Net price";
|
|
33
|
+
readonly 'pdf.column.taxRate': "Rate";
|
|
34
|
+
readonly 'pdf.column.net': "Net value";
|
|
35
|
+
readonly 'pdf.column.gross': "Gross value";
|
|
36
|
+
readonly 'pdf.vat.rate': "VAT rate";
|
|
37
|
+
readonly 'pdf.vat.amount': "VAT amount";
|
|
38
|
+
readonly 'pdf.label.total': "Total";
|
|
39
|
+
readonly 'pdf.label.paid': "Paid";
|
|
40
|
+
readonly 'pdf.label.amountDue': "Amount due";
|
|
41
|
+
readonly 'pdf.label.overpayment': "Overpayment";
|
|
42
|
+
readonly 'pdf.label.inWords': "In words";
|
|
43
|
+
readonly 'pdf.footer.default': "Thank you for your business.\n{{var seller.legalName}} · Tax ID {{var seller.taxId}}";
|
|
44
|
+
readonly 'lines.item': "Item";
|
|
45
|
+
readonly 'lines.unit.piece': "pcs";
|
|
46
|
+
readonly 'lines.unit.service': "svc";
|
|
47
|
+
readonly 'lines.delivery': "Delivery";
|
|
48
|
+
readonly 'lines.paymentSurcharge': "Payment method surcharge";
|
|
49
|
+
readonly 'lines.discount': "Discount";
|
|
50
|
+
readonly 'lines.priceReduction': "Price reduction (complaint {rma}): {product}";
|
|
51
|
+
readonly 'lines.priceReductionUnreferenced': "Price reduction (complaint): {product}";
|
|
52
|
+
};
|
|
53
|
+
export type InvoicesProseKey = keyof typeof INVOICES_PROSE_EN;
|
|
54
|
+
export type ProseParams = Record<string, string | number>;
|
|
55
|
+
/**
|
|
56
|
+
* `_i18n`'s `adminI18nService.translate`, bound to this module's bundle. It
|
|
57
|
+
* answers `invoices.<key>` for a key no bundle carries.
|
|
58
|
+
*/
|
|
59
|
+
export type InvoicesTranslate = (key: string, language: SupportedLanguage, params?: ProseParams) => Promise<string>;
|
|
60
|
+
/** One sentence of this module's prose in `language`, English when the bundle cannot answer. */
|
|
61
|
+
export declare function invoicesProse(translate: InvoicesTranslate | undefined, key: InvoicesProseKey, language: SupportedLanguage, params?: ProseParams): Promise<string>;
|
|
62
|
+
/** Every key at once, for a renderer that draws synchronously. */
|
|
63
|
+
export declare function invoicesProseTable<K extends InvoicesProseKey>(translate: InvoicesTranslate | undefined, keys: readonly K[], language: SupportedLanguage): Promise<Record<K, string>>;
|
|
64
|
+
export declare function fillPlaceholders(template: string, params?: ProseParams): string;
|
|
65
|
+
//# sourceMappingURL=invoices-prose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices-prose.d.ts","sourceRoot":"","sources":["../../src/backend/invoices-prose.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCpB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,MAAM,OAAO,iBAAiB,CAAC;AAE9D,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,CAAC;AAE1D;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC9B,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,CAAC,EAAE,WAAW,KACjB,OAAO,CAAC,MAAM,CAAC,CAAC;AAErB,gGAAgG;AAChG,wBAAsB,aAAa,CACjC,SAAS,EAAE,iBAAiB,GAAG,SAAS,EACxC,GAAG,EAAE,gBAAgB,EACrB,QAAQ,EAAE,iBAAiB,EAC3B,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,MAAM,CAAC,CAUjB;AAED,kEAAkE;AAClE,wBAAsB,kBAAkB,CAAC,CAAC,SAAS,gBAAgB,EACjE,SAAS,EAAE,iBAAiB,GAAG,SAAS,EACxC,IAAI,EAAE,SAAS,CAAC,EAAE,EAClB,QAAQ,EAAE,iBAAiB,GAC1B,OAAO,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,CAM5B;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAK/E"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The prose this module's backend composes for a reader whose language it
|
|
3
|
+
* knows: the labels of a rendered invoice PDF, which carries its own
|
|
4
|
+
* `language`, and the names of the lines an invoice itemises beside the
|
|
5
|
+
* products, which are written in the invoice's language when it is issued
|
|
6
|
+
* (`specs/conventions/module-i18n.md`, the case where the backend can resolve
|
|
7
|
+
* the reader's language).
|
|
8
|
+
*
|
|
9
|
+
* The sentences live in this module's bundle; this table keeps their English
|
|
10
|
+
* beside the code as the last tier, for when the bundle cannot answer.
|
|
11
|
+
* `invoices-prose.test.ts` holds it equal to `i18n/en.json`.
|
|
12
|
+
*/
|
|
13
|
+
export const INVOICES_PROSE_EN = {
|
|
14
|
+
'pdf.title.invoice': 'Invoice',
|
|
15
|
+
'pdf.title.proforma': 'Proforma invoice',
|
|
16
|
+
'pdf.title.correction': 'Corrective invoice',
|
|
17
|
+
'pdf.title.wz': 'Goods dispatch note',
|
|
18
|
+
'pdf.title.numbered': '{title} No. {number}',
|
|
19
|
+
'pdf.label.ksefNumber': 'KSeF number',
|
|
20
|
+
'pdf.label.issuedAt': 'Issue date',
|
|
21
|
+
'pdf.label.saleDate': 'Sale date',
|
|
22
|
+
'pdf.label.paymentDue': 'Payment due',
|
|
23
|
+
'pdf.label.paymentMethod': 'Payment method',
|
|
24
|
+
'pdf.label.seller': 'Seller',
|
|
25
|
+
'pdf.label.buyer': 'Buyer',
|
|
26
|
+
'pdf.label.taxId': 'Tax ID',
|
|
27
|
+
'pdf.column.ordinal': 'No.',
|
|
28
|
+
'pdf.column.name': 'Name',
|
|
29
|
+
'pdf.column.unit': 'Unit',
|
|
30
|
+
'pdf.column.quantity': 'Qty',
|
|
31
|
+
'pdf.column.unitNet': 'Net price',
|
|
32
|
+
'pdf.column.taxRate': 'Rate',
|
|
33
|
+
'pdf.column.net': 'Net value',
|
|
34
|
+
'pdf.column.gross': 'Gross value',
|
|
35
|
+
'pdf.vat.rate': 'VAT rate',
|
|
36
|
+
'pdf.vat.amount': 'VAT amount',
|
|
37
|
+
'pdf.label.total': 'Total',
|
|
38
|
+
'pdf.label.paid': 'Paid',
|
|
39
|
+
'pdf.label.amountDue': 'Amount due',
|
|
40
|
+
'pdf.label.overpayment': 'Overpayment',
|
|
41
|
+
'pdf.label.inWords': 'In words',
|
|
42
|
+
'pdf.footer.default': 'Thank you for your business.\n{{var seller.legalName}} · Tax ID {{var seller.taxId}}',
|
|
43
|
+
'lines.item': 'Item',
|
|
44
|
+
'lines.unit.piece': 'pcs',
|
|
45
|
+
'lines.unit.service': 'svc',
|
|
46
|
+
'lines.delivery': 'Delivery',
|
|
47
|
+
'lines.paymentSurcharge': 'Payment method surcharge',
|
|
48
|
+
'lines.discount': 'Discount',
|
|
49
|
+
'lines.priceReduction': 'Price reduction (complaint {rma}): {product}',
|
|
50
|
+
'lines.priceReductionUnreferenced': 'Price reduction (complaint): {product}',
|
|
51
|
+
};
|
|
52
|
+
/** One sentence of this module's prose in `language`, English when the bundle cannot answer. */
|
|
53
|
+
export async function invoicesProse(translate, key, language, params) {
|
|
54
|
+
if (translate) {
|
|
55
|
+
try {
|
|
56
|
+
const text = await translate(key, language, params);
|
|
57
|
+
if (text !== `invoices.${key}`)
|
|
58
|
+
return text;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
// The English tier below is the answer to an unreachable bundle.
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return fillPlaceholders(INVOICES_PROSE_EN[key], params);
|
|
65
|
+
}
|
|
66
|
+
/** Every key at once, for a renderer that draws synchronously. */
|
|
67
|
+
export async function invoicesProseTable(translate, keys, language) {
|
|
68
|
+
// One at a time: every lookup is a read of `_i18n`'s bundle table, and a
|
|
69
|
+
// table of them at once would take that many pool connections together.
|
|
70
|
+
const table = {};
|
|
71
|
+
for (const key of keys)
|
|
72
|
+
table[key] = await invoicesProse(translate, key, language);
|
|
73
|
+
return table;
|
|
74
|
+
}
|
|
75
|
+
export function fillPlaceholders(template, params) {
|
|
76
|
+
if (!params)
|
|
77
|
+
return template;
|
|
78
|
+
return template.replace(/\{(\w+)\}/g, (match, name) => params[name] != null ? String(params[name]) : match);
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=invoices-prose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invoices-prose.js","sourceRoot":"","sources":["../../src/backend/invoices-prose.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,mBAAmB,EAAE,SAAS;IAC9B,oBAAoB,EAAE,kBAAkB;IACxC,sBAAsB,EAAE,oBAAoB;IAC5C,cAAc,EAAE,qBAAqB;IACrC,oBAAoB,EAAE,sBAAsB;IAC5C,sBAAsB,EAAE,aAAa;IACrC,oBAAoB,EAAE,YAAY;IAClC,oBAAoB,EAAE,WAAW;IACjC,sBAAsB,EAAE,aAAa;IACrC,yBAAyB,EAAE,gBAAgB;IAC3C,kBAAkB,EAAE,QAAQ;IAC5B,iBAAiB,EAAE,OAAO;IAC1B,iBAAiB,EAAE,QAAQ;IAC3B,oBAAoB,EAAE,KAAK;IAC3B,iBAAiB,EAAE,MAAM;IACzB,iBAAiB,EAAE,MAAM;IACzB,qBAAqB,EAAE,KAAK;IAC5B,oBAAoB,EAAE,WAAW;IACjC,oBAAoB,EAAE,MAAM;IAC5B,gBAAgB,EAAE,WAAW;IAC7B,kBAAkB,EAAE,aAAa;IACjC,cAAc,EAAE,UAAU;IAC1B,gBAAgB,EAAE,YAAY;IAC9B,iBAAiB,EAAE,OAAO;IAC1B,gBAAgB,EAAE,MAAM;IACxB,qBAAqB,EAAE,YAAY;IACnC,uBAAuB,EAAE,aAAa;IACtC,mBAAmB,EAAE,UAAU;IAC/B,oBAAoB,EAAE,sFAAsF;IAC5G,YAAY,EAAE,MAAM;IACpB,kBAAkB,EAAE,KAAK;IACzB,oBAAoB,EAAE,KAAK;IAC3B,gBAAgB,EAAE,UAAU;IAC5B,wBAAwB,EAAE,0BAA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|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed-logo-images.d.ts","sourceRoot":"","sources":["../../../src/backend/pdf-components/embed-logo-images.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"embed-logo-images.d.ts","sourceRoot":"","sources":["../../../src/backend/pdf-components/embed-logo-images.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;AAYnF,wBAAgB,cAAc,CAAC,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIjF;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGhE;AA4DD;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,OAAO,EACb,cAAc,CAAC,EAAE,cAAc,GAC9B,OAAO,CAAC,OAAO,CAAC,CAclB"}
|
|
@@ -1,18 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* pdfmake fetches `image: <http url>` over the network. When the admin embeds a
|
|
5
|
-
* library asset, `resolveData` bakes an absolute API URL
|
|
6
|
-
* (`http://localhost:3001/assets/file/<id>`). Fetching that URL from inside the
|
|
7
|
-
* same Node process that is still serving the preview request deadlocks or
|
|
8
|
-
* 403s (private assets), which surfaces as INTERNAL on Preview PDF.
|
|
9
|
-
*
|
|
10
|
-
* Loading bytes via the Assets Library storage adapter (or a short external
|
|
11
|
-
* fetch for true remote URLs) and inlining `data:image/…;base64,…` avoids the
|
|
12
|
-
* self-HTTP path. Unsupported formats (SVG, WebP, …) are omitted so the PDF
|
|
13
|
-
* still renders.
|
|
14
|
-
*/
|
|
15
|
-
const ASSET_FILE_RE = /\/assets\/file\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i;
|
|
1
|
+
import { UUID_SHAPE_PATTERN } from '@endora-commerce/contracts';
|
|
2
|
+
const ASSET_FILE_RE = new RegExp(`/assets/file/(${UUID_SHAPE_PATTERN})`);
|
|
16
3
|
/** pdfmake reliably embeds JPEG/PNG; other types are skipped. */
|
|
17
4
|
const PDFMAKE_IMAGE_MIME = new Set(['image/jpeg', 'image/jpg', 'image/png']);
|
|
18
5
|
function normalizeMime(mime) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embed-logo-images.js","sourceRoot":"","sources":["../../../src/backend/pdf-components/embed-logo-images.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"embed-logo-images.js","sourceRoot":"","sources":["../../../src/backend/pdf-components/embed-logo-images.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AA6BhE,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,iBAAiB,kBAAkB,GAAG,CAAC,CAAC;AAEzE,iEAAiE;AACjE,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAE7E,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,CAAC,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzD,OAAO,CAAC,KAAK,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,KAAiB,EAAE,QAAgB;IAChE,MAAM,IAAI,GAAG,aA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AE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,0EAA0E;AAC1E,wBAAgB,mBAAmB,IAAI,aAAa,
|
|
1
|
+
{"version":3,"file":"sample.d.ts","sourceRoot":"","sources":["../../../src/backend/pdf-components/sample.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAEhE,0EAA0E;AAC1E,wBAAgB,mBAAmB,IAAI,aAAa,CAyEnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../../src/backend/pdf-components/sample.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,EAAE,EAAE,sCAAsC;QAC1C,OAAO,EAAE,sCAAsC;QAC/C,eAAe,EAAE,eAAe;QAChC,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ,EAAE,KAAK;QACf,QAAQ,EAAE,0BAA0B;QACpC,QAAQ,EAAE,YAAY;QACtB,cAAc,EAAE,YAAY;QAC5B,aAAa,EAAE,eAAe;QAC9B,QAAQ,EAAE,IAAI;QACd,QAAQ,EAAE,GAAG;QACb,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,IAAI;QACX,iBAAiB,EAAE,IAAI;QACvB,UAAU,EAAE,IAAI;QAChB,UAAU,EAAE,IAAI;QAChB,mBAAmB,EAAE,IAAI;QACzB,eAAe,EAAE,IAAI;QACrB,KAAK,EAAE;YACL;gBACE,OAAO,EAAE,CAAC;gBACV,IAAI,EAAE,6BAA6B;gBACnC,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,CAAC;gBACX,YAAY,EAAE,GAAG;gBACjB,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,GAAG;gBACb,UAAU,EAAE,GAAG;aAChB;YACD;gBACE,OAAO,EAAE,CAAC;gBACV,IAAI,EAAE,oCAAoC;gBAC1C,IAAI,EAAE,IAAI;gBACV,QAAQ,EAAE,EAAE;gBACZ,YAAY,EAAE,GAAG;gBACjB,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,IAAI;gBACd,UAAU,EAAE,IAAI;aACjB;SACF;QACD,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QAChF,MAAM,EAAE;YACN,SAAS,EAAE,oBAAoB;YAC/B,YAAY,EAAE,4BAA4B;YAC1C,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,OAAO;YACnB,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,IAAI;YACb,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,cAAc;YACxB,WAAW,EAAE,gCAAgC;YAC7C,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;SACV;QACD,KAAK,EAAE;YACL,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,YAAY;YACnB,YAAY,EAAE,qBAAqB;YACnC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,OAAO;YACnB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;SACd;KACF,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"sample.js","sourceRoot":"","sources":["../../../src/backend/pdf-components/sample.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB;IACjC,OAAO;QACL,EAAE,EAAE,sCAAsC;QAC1C,OAAO,EAAE,sCAAsC;QAC/C,eAAe,EAAE,eAAe;QAChC,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,eAAe;QACvB,MAAM,EAAE,OAAO;QACf,QAAQ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AC7C,KAAK,EAAE,WAAW;YAClB,KAAK,EAAE,EAAE;YACT,KAAK,EAAE,EAAE;SACV;QACD,KAAK,EAAE;YACL,IAAI,EAAE,oBAAoB;YAC1B,KAAK,EAAE,YAAY;YACnB,YAAY,EAAE,qBAAqB;YACnC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,OAAO;YACnB,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;SACd;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,16 @@ export declare function money(n: number): string;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function unitMoney(n: number): string;
|
|
16
16
|
export declare function pct(rate: number): string;
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Every label the PDF draws that a template prop does not supply, keyed by its
|
|
19
|
+
* key in this module's bundle. The renderer resolves them in the document's
|
|
20
|
+
* `language` before drawing (`document/invoice-document-type.ts`); a section
|
|
21
|
+
* built without them draws English.
|
|
22
|
+
*/
|
|
23
|
+
export declare const INVOICE_PDF_LABEL_KEYS: ("pdf.title.invoice" | "pdf.title.proforma" | "pdf.title.correction" | "pdf.title.wz" | "pdf.title.numbered" | "pdf.label.ksefNumber" | "pdf.label.issuedAt" | "pdf.label.saleDate" | "pdf.label.paymentDue" | "pdf.label.paymentMethod" | "pdf.label.seller" | "pdf.label.buyer" | "pdf.label.taxId" | "pdf.column.ordinal" | "pdf.column.name" | "pdf.column.unit" | "pdf.column.quantity" | "pdf.column.unitNet" | "pdf.column.taxRate" | "pdf.column.net" | "pdf.column.gross" | "pdf.vat.rate" | "pdf.vat.amount" | "pdf.label.total" | "pdf.label.paid" | "pdf.label.amountDue" | "pdf.label.overpayment" | "pdf.label.inWords" | "pdf.footer.default")[];
|
|
24
|
+
export type InvoicePdfLabelKey = (typeof INVOICE_PDF_LABEL_KEYS)[number];
|
|
25
|
+
export type InvoicePdfLabels = Readonly<Record<InvoicePdfLabelKey, string>>;
|
|
26
|
+
export declare const INVOICE_PDF_LABELS_EN: InvoicePdfLabels;
|
|
18
27
|
type Props = Record<string, unknown>;
|
|
19
28
|
/** Interpolate `{{var invoice.x}}` / `{{var order.x}}` style tokens. */
|
|
20
29
|
export declare function interpolate(text: string, inv: InvoiceDetail): string;
|
|
@@ -25,14 +34,21 @@ export interface HeaderSectionOptions {
|
|
|
25
34
|
* header's own row stands down (`specs/134-paid-module-extraction/` T137).
|
|
26
35
|
*/
|
|
27
36
|
readonly suppressKsefNumber?: boolean;
|
|
37
|
+
/** The labels in the document's language. Absent, English. */
|
|
38
|
+
readonly labels?: InvoicePdfLabels;
|
|
28
39
|
}
|
|
29
40
|
export declare function headerSection(inv: InvoiceDetail, props?: Props, options?: HeaderSectionOptions): Content;
|
|
30
|
-
export declare function partiesSection(inv: InvoiceDetail, props?: Props): Content;
|
|
31
|
-
export declare function lineItemsSection(inv: InvoiceDetail, props?: Props): Content;
|
|
32
|
-
export declare function vatSummarySection(inv: InvoiceDetail, props?: Props): Content;
|
|
33
|
-
|
|
41
|
+
export declare function partiesSection(inv: InvoiceDetail, props?: Props, labels?: InvoicePdfLabels): Content;
|
|
42
|
+
export declare function lineItemsSection(inv: InvoiceDetail, props?: Props, labels?: InvoicePdfLabels): Content;
|
|
43
|
+
export declare function vatSummarySection(inv: InvoiceDetail, props?: Props, labels?: InvoicePdfLabels): Content;
|
|
44
|
+
/**
|
|
45
|
+
* `locale` is the language the amount in words is written in; `labels` the
|
|
46
|
+
* language of the labels, the document's. The overpayment row (issue #428) is
|
|
47
|
+
* labelled from `labels` unless a template's `labelOverpayment` replaces it.
|
|
48
|
+
*/
|
|
49
|
+
export declare function totalsSection(inv: InvoiceDetail, locale: AmountToWordsLocale, props?: Props, labels?: InvoicePdfLabels): Content;
|
|
34
50
|
export declare function notesSection(props: Props, inv: InvoiceDetail): Content;
|
|
35
|
-
export declare function footerSection(props: Props, inv: InvoiceDetail): Content;
|
|
51
|
+
export declare function footerSection(props: Props, inv: InvoiceDetail, labels?: InvoicePdfLabels): Content;
|
|
36
52
|
export declare function spacerSection(props?: Props): Content;
|
|
37
53
|
export declare function dividerSection(props?: Props): Content;
|
|
38
54
|
export declare function logoSection(props?: Props): Content;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../src/backend/pdf-components/sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"sections.d.ts","sourceRoot":"","sources":["../../../src/backend/pdf-components/sections.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAa,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAA2B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAiB,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGzF;;;;GAIG;AAEH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEvC;AACD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE3C;AACD,wBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,ioBAElC,CAAC;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AACzE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,CAAC;AAC5E,eAAO,MAAM,qBAAqB,EAAE,gBAEf,CAAC;AAUtB,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAiCrC,wEA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AgB,WAAW,CAAC,KAAK,GAAE,KAAU,GAAG,OAAO,CAiBtD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { unitPriceFractionDigits } from '@endora-commerce/contracts';
|
|
2
2
|
import { amountToWords } from '../services/amount-to-words.js';
|
|
3
|
+
import { fillPlaceholders, INVOICES_PROSE_EN } from '../invoices-prose.js';
|
|
3
4
|
/**
|
|
4
5
|
* Invoice PDF section builders (feature 047, US6). Each maps a slice of the
|
|
5
6
|
* invoice data (+ optional Puck props) to pdfmake `Content`. Shared by the
|
|
@@ -19,11 +20,19 @@ export function unitMoney(n) {
|
|
|
19
20
|
export function pct(rate) {
|
|
20
21
|
return `${Math.round(rate * 100)}%`;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Every label the PDF draws that a template prop does not supply, keyed by its
|
|
25
|
+
* key in this module's bundle. The renderer resolves them in the document's
|
|
26
|
+
* `language` before drawing (`document/invoice-document-type.ts`); a section
|
|
27
|
+
* built without them draws English.
|
|
28
|
+
*/
|
|
29
|
+
export const INVOICE_PDF_LABEL_KEYS = Object.keys(INVOICES_PROSE_EN).filter((key) => key.startsWith('pdf.'));
|
|
30
|
+
export const INVOICE_PDF_LABELS_EN = Object.fromEntries(INVOICE_PDF_LABEL_KEYS.map((key) => [key, INVOICES_PROSE_EN[key]]));
|
|
31
|
+
const TITLE_KEYS = {
|
|
32
|
+
invoice: 'pdf.title.invoice',
|
|
33
|
+
proforma: 'pdf.title.proforma',
|
|
34
|
+
correction: 'pdf.title.correction',
|
|
35
|
+
wz: 'pdf.title.wz',
|
|
27
36
|
};
|
|
28
37
|
function num(p, key, fallback) {
|
|
29
38
|
const v = p[key];
|
|
@@ -63,6 +72,7 @@ export function interpolate(text, inv) {
|
|
|
63
72
|
'invoice.issuedAt': inv.issuedAt.slice(0, 10),
|
|
64
73
|
'invoice.saleDate': inv.saleDate ?? inv.issuedAt.slice(0, 10),
|
|
65
74
|
'invoice.amountDue': money(inv.amountDue),
|
|
75
|
+
'invoice.overpayment': money(inv.overpayment),
|
|
66
76
|
'buyer.name': inv.buyer.name,
|
|
67
77
|
'seller.legalName': inv.seller.legalName,
|
|
68
78
|
'seller.taxId': inv.seller.taxId ?? '',
|
|
@@ -70,6 +80,7 @@ export function interpolate(text, inv) {
|
|
|
70
80
|
return text.replace(/\{\{\s*var\s+([\w.]+)\s*\}\}/g, (_m, key) => map[key] ?? '');
|
|
71
81
|
}
|
|
72
82
|
export function headerSection(inv, props = {}, options = {}) {
|
|
83
|
+
const labels = options.labels ?? INVOICE_PDF_LABELS_EN;
|
|
73
84
|
const titleSize = num(props, 'titleSize', 14);
|
|
74
85
|
const titleColor = optStr(props, 'titleColor');
|
|
75
86
|
const titleBold = bool(props, 'titleBold', true);
|
|
@@ -77,7 +88,10 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
77
88
|
const rows = [
|
|
78
89
|
[
|
|
79
90
|
{
|
|
80
|
-
text:
|
|
91
|
+
text: fillPlaceholders(labels['pdf.title.numbered'], {
|
|
92
|
+
title: labels[TITLE_KEYS[inv.kind]],
|
|
93
|
+
number: inv.number,
|
|
94
|
+
}),
|
|
81
95
|
bold: titleBold,
|
|
82
96
|
fontSize: titleSize,
|
|
83
97
|
color: titleColor,
|
|
@@ -92,7 +106,7 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
92
106
|
if (inv.ksefReferenceNumber && !options.suppressKsefNumber) {
|
|
93
107
|
rows.push([
|
|
94
108
|
{
|
|
95
|
-
text: `${str(props, 'labelKsefNumber', '
|
|
109
|
+
text: `${str(props, 'labelKsefNumber', labels['pdf.label.ksefNumber'])}: ${inv.ksefReferenceNumber}`,
|
|
96
110
|
alignment: align,
|
|
97
111
|
},
|
|
98
112
|
]);
|
|
@@ -100,7 +114,7 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
100
114
|
if (bool(props, 'showIssuedAt', true)) {
|
|
101
115
|
rows.push([
|
|
102
116
|
{
|
|
103
|
-
text: `${str(props, 'labelIssuedAt', '
|
|
117
|
+
text: `${str(props, 'labelIssuedAt', labels['pdf.label.issuedAt'])}: ${inv.issuedAt.slice(0, 10)}`,
|
|
104
118
|
alignment: align,
|
|
105
119
|
},
|
|
106
120
|
]);
|
|
@@ -108,7 +122,7 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
108
122
|
if (bool(props, 'showSaleDate', true)) {
|
|
109
123
|
rows.push([
|
|
110
124
|
{
|
|
111
|
-
text: `${str(props, 'labelSaleDate', '
|
|
125
|
+
text: `${str(props, 'labelSaleDate', labels['pdf.label.saleDate'])}: ${inv.saleDate ?? inv.issuedAt.slice(0, 10)}`,
|
|
112
126
|
alignment: align,
|
|
113
127
|
},
|
|
114
128
|
]);
|
|
@@ -116,7 +130,7 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
116
130
|
if (bool(props, 'showPaymentDue', true)) {
|
|
117
131
|
rows.push([
|
|
118
132
|
{
|
|
119
|
-
text: `${str(props, 'labelPaymentDue', '
|
|
133
|
+
text: `${str(props, 'labelPaymentDue', labels['pdf.label.paymentDue'])}: ${inv.paymentDueDate ?? '-'}`,
|
|
120
134
|
alignment: align,
|
|
121
135
|
},
|
|
122
136
|
]);
|
|
@@ -124,7 +138,7 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
124
138
|
if (bool(props, 'showPaymentMethod', true)) {
|
|
125
139
|
rows.push([
|
|
126
140
|
{
|
|
127
|
-
text: `${str(props, 'labelPaymentMethod', '
|
|
141
|
+
text: `${str(props, 'labelPaymentMethod', labels['pdf.label.paymentMethod'])}: ${inv.paymentMethod ?? '-'}`,
|
|
128
142
|
alignment: align,
|
|
129
143
|
},
|
|
130
144
|
]);
|
|
@@ -135,7 +149,7 @@ export function headerSection(inv, props = {}, options = {}) {
|
|
|
135
149
|
margin: marginBox(props, 0, 12),
|
|
136
150
|
};
|
|
137
151
|
}
|
|
138
|
-
export function partiesSection(inv, props = {}) {
|
|
152
|
+
export function partiesSection(inv, props = {}, labels = INVOICE_PDF_LABELS_EN) {
|
|
139
153
|
const seller = inv.seller;
|
|
140
154
|
const buyer = inv.buyer;
|
|
141
155
|
const labelFs = num(props, 'labelFontSize', 10);
|
|
@@ -143,14 +157,14 @@ export function partiesSection(inv, props = {}) {
|
|
|
143
157
|
const sellerPct = Math.min(70, Math.max(30, num(props, 'sellerWidthPercent', 50)));
|
|
144
158
|
const gap = num(props, 'columnGap', 16);
|
|
145
159
|
const sellerStack = [
|
|
146
|
-
{ text: str(props, 'sellerLabel', '
|
|
160
|
+
{ text: str(props, 'sellerLabel', labels['pdf.label.seller']), bold: true, fontSize: labelFs, margin: [0, 0, 0, 2] },
|
|
147
161
|
{ text: seller.legalName, fontSize: bodyFs },
|
|
148
162
|
{ text: seller.addressLine1, fontSize: bodyFs },
|
|
149
163
|
];
|
|
150
164
|
if (seller.addressLine2)
|
|
151
165
|
sellerStack.push({ text: seller.addressLine2, fontSize: bodyFs });
|
|
152
166
|
sellerStack.push({ text: `${seller.postalCode} ${seller.city}`, fontSize: bodyFs });
|
|
153
|
-
sellerStack.push({ text:
|
|
167
|
+
sellerStack.push({ text: `${labels['pdf.label.taxId']}: ${seller.taxId}`, fontSize: bodyFs });
|
|
154
168
|
if (bool(props, 'showSellerBank', true) && seller.bankAccount) {
|
|
155
169
|
sellerStack.push({ text: `${seller.bankName ?? ''} ${seller.bankAccount}`.trim(), fontSize: bodyFs });
|
|
156
170
|
}
|
|
@@ -158,7 +172,7 @@ export function partiesSection(inv, props = {}) {
|
|
|
158
172
|
sellerStack.push({ text: `SWIFT: ${seller.swift}`, fontSize: bodyFs });
|
|
159
173
|
}
|
|
160
174
|
const buyerStack = [
|
|
161
|
-
{ text: str(props, 'buyerLabel', '
|
|
175
|
+
{ text: str(props, 'buyerLabel', labels['pdf.label.buyer']), bold: true, fontSize: labelFs, margin: [0, 0, 0, 2] },
|
|
162
176
|
{ text: buyer.name, fontSize: bodyFs },
|
|
163
177
|
];
|
|
164
178
|
if (buyer.addressLine1)
|
|
@@ -167,7 +181,7 @@ export function partiesSection(inv, props = {}) {
|
|
|
167
181
|
buyerStack.push({ text: `${buyer.postalCode} ${buyer.city}`.trim(), fontSize: bodyFs });
|
|
168
182
|
}
|
|
169
183
|
if (bool(props, 'showBuyerTaxId', true) && buyer.taxId) {
|
|
170
|
-
buyerStack.push({ text:
|
|
184
|
+
buyerStack.push({ text: `${labels['pdf.label.taxId']}: ${buyer.taxId}`, fontSize: bodyFs });
|
|
171
185
|
}
|
|
172
186
|
return {
|
|
173
187
|
columns: [
|
|
@@ -178,7 +192,7 @@ export function partiesSection(inv, props = {}) {
|
|
|
178
192
|
margin: marginBox(props, 0, 16),
|
|
179
193
|
};
|
|
180
194
|
}
|
|
181
|
-
export function lineItemsSection(inv, props = {}) {
|
|
195
|
+
export function lineItemsSection(inv, props = {}, labels = INVOICE_PDF_LABELS_EN) {
|
|
182
196
|
const fontSize = num(props, 'fontSize', 8);
|
|
183
197
|
const headerBold = bool(props, 'headerBold', true);
|
|
184
198
|
const headerBg = optStr(props, 'headerBackground');
|
|
@@ -192,21 +206,21 @@ export function lineItemsSection(inv, props = {}) {
|
|
|
192
206
|
const showNet = bool(props, 'showNet', true);
|
|
193
207
|
const showGross = bool(props, 'showGross', true);
|
|
194
208
|
const cols = [
|
|
195
|
-
{ key: 'lp', label: '
|
|
196
|
-
{ key: 'name', label: '
|
|
209
|
+
{ key: 'lp', label: labels['pdf.column.ordinal'], width: 16 },
|
|
210
|
+
{ key: 'name', label: labels['pdf.column.name'], width: '*' },
|
|
197
211
|
];
|
|
198
212
|
if (showUnit)
|
|
199
|
-
cols.push({ key: 'unit', label: '
|
|
213
|
+
cols.push({ key: 'unit', label: labels['pdf.column.unit'], width: 28 });
|
|
200
214
|
if (showQty)
|
|
201
|
-
cols.push({ key: 'qty', label: '
|
|
215
|
+
cols.push({ key: 'qty', label: labels['pdf.column.quantity'], width: 32, right: true });
|
|
202
216
|
if (showUnitNet)
|
|
203
|
-
cols.push({ key: 'unitNet', label: '
|
|
217
|
+
cols.push({ key: 'unitNet', label: labels['pdf.column.unitNet'], width: 50, right: true });
|
|
204
218
|
if (showTaxRate)
|
|
205
|
-
cols.push({ key: 'tax', label: '
|
|
219
|
+
cols.push({ key: 'tax', label: labels['pdf.column.taxRate'], width: 32, right: true });
|
|
206
220
|
if (showNet)
|
|
207
|
-
cols.push({ key: 'net', label: '
|
|
221
|
+
cols.push({ key: 'net', label: labels['pdf.column.net'], width: 56, right: true });
|
|
208
222
|
if (showGross)
|
|
209
|
-
cols.push({ key: 'gross', label: '
|
|
223
|
+
cols.push({ key: 'gross', label: labels['pdf.column.gross'], width: 56, right: true });
|
|
210
224
|
const headerRow = cols.map((c) => ({
|
|
211
225
|
text: c.label,
|
|
212
226
|
bold: headerBold,
|
|
@@ -272,15 +286,20 @@ export function lineItemsSection(inv, props = {}) {
|
|
|
272
286
|
margin: marginBox(props, 0, 12),
|
|
273
287
|
};
|
|
274
288
|
}
|
|
275
|
-
export function vatSummarySection(inv, props = {}) {
|
|
289
|
+
export function vatSummarySection(inv, props = {}, labels = INVOICE_PDF_LABELS_EN) {
|
|
276
290
|
const fontSize = num(props, 'fontSize', 8);
|
|
277
291
|
const headerBold = bool(props, 'headerBold', true);
|
|
278
292
|
const headerBg = optStr(props, 'headerBackground');
|
|
279
293
|
const headerColor = optStr(props, 'headerColor');
|
|
280
294
|
const borderColor = optStr(props, 'borderColor') ?? '#cbd5e1';
|
|
281
295
|
const showTotalRow = bool(props, 'showTotalRow', true);
|
|
282
|
-
const totalLabel = str(props, 'totalLabel', '
|
|
283
|
-
const header = [
|
|
296
|
+
const totalLabel = str(props, 'totalLabel', labels['pdf.label.total']);
|
|
297
|
+
const header = [
|
|
298
|
+
labels['pdf.vat.rate'],
|
|
299
|
+
labels['pdf.column.net'],
|
|
300
|
+
labels['pdf.vat.amount'],
|
|
301
|
+
labels['pdf.column.gross'],
|
|
302
|
+
].map((t, i) => ({
|
|
284
303
|
text: t,
|
|
285
304
|
bold: headerBold,
|
|
286
305
|
fontSize,
|
|
@@ -316,7 +335,12 @@ export function vatSummarySection(inv, props = {}) {
|
|
|
316
335
|
margin: marginBox(props, 0, 12),
|
|
317
336
|
};
|
|
318
337
|
}
|
|
319
|
-
|
|
338
|
+
/**
|
|
339
|
+
* `locale` is the language the amount in words is written in; `labels` the
|
|
340
|
+
* language of the labels, the document's. The overpayment row (issue #428) is
|
|
341
|
+
* labelled from `labels` unless a template's `labelOverpayment` replaces it.
|
|
342
|
+
*/
|
|
343
|
+
export function totalsSection(inv, locale, props = {}, labels = INVOICE_PDF_LABELS_EN) {
|
|
320
344
|
const align = alignOf(props, 'right');
|
|
321
345
|
const fontSize = num(props, 'fontSize', 10);
|
|
322
346
|
const color = optStr(props, 'color');
|
|
@@ -324,7 +348,7 @@ export function totalsSection(inv, locale, props = {}) {
|
|
|
324
348
|
const stack = [];
|
|
325
349
|
if (bool(props, 'showPaid', true)) {
|
|
326
350
|
stack.push({
|
|
327
|
-
text: `${str(props, 'labelPaid', '
|
|
351
|
+
text: `${str(props, 'labelPaid', labels['pdf.label.paid'])}: ${money(inv.paidTotal)} ${inv.currency}`,
|
|
328
352
|
alignment: align,
|
|
329
353
|
fontSize,
|
|
330
354
|
color,
|
|
@@ -332,16 +356,25 @@ export function totalsSection(inv, locale, props = {}) {
|
|
|
332
356
|
}
|
|
333
357
|
if (bool(props, 'showAmountDue', true)) {
|
|
334
358
|
stack.push({
|
|
335
|
-
text: `${str(props, 'labelAmountDue', '
|
|
359
|
+
text: `${str(props, 'labelAmountDue', labels['pdf.label.amountDue'])}: ${money(inv.amountDue)} ${inv.currency}`,
|
|
336
360
|
alignment: align,
|
|
337
361
|
bold: bool(props, 'amountDueBold', true),
|
|
338
362
|
fontSize,
|
|
339
363
|
color: amountDueColor,
|
|
340
364
|
});
|
|
341
365
|
}
|
|
366
|
+
// Issue #428 — what was paid above the gross, beside an amount due of 0.
|
|
367
|
+
if (bool(props, 'showOverpayment', true) && inv.overpayment > 0) {
|
|
368
|
+
stack.push({
|
|
369
|
+
text: `${str(props, 'labelOverpayment', labels['pdf.label.overpayment'])}: ${money(inv.overpayment)} ${inv.currency}`,
|
|
370
|
+
alignment: align,
|
|
371
|
+
fontSize,
|
|
372
|
+
color,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
342
375
|
if (bool(props, 'showGross', true)) {
|
|
343
376
|
stack.push({
|
|
344
|
-
text: `${str(props, 'labelGross', '
|
|
377
|
+
text: `${str(props, 'labelGross', labels['pdf.label.total'])}: ${money(inv.grossTotal)} ${inv.currency}`,
|
|
345
378
|
alignment: align,
|
|
346
379
|
fontSize,
|
|
347
380
|
color,
|
|
@@ -349,7 +382,7 @@ export function totalsSection(inv, locale, props = {}) {
|
|
|
349
382
|
}
|
|
350
383
|
if (bool(props, 'showAmountInWords', true)) {
|
|
351
384
|
stack.push({
|
|
352
|
-
text: `${str(props, 'labelInWords', '
|
|
385
|
+
text: `${str(props, 'labelInWords', labels['pdf.label.inWords'])}: ${amountToWords(inv.grossTotal, inv.currency, locale)}`,
|
|
353
386
|
alignment: align,
|
|
354
387
|
italics: bool(props, 'amountInWordsItalics', true),
|
|
355
388
|
fontSize,
|
|
@@ -385,10 +418,10 @@ export function notesSection(props, inv) {
|
|
|
385
418
|
const raw = typeof props['text'] === 'string' ? props['text'] : '';
|
|
386
419
|
return textBlock(raw, inv, props, { fontSize: 11, showTopDivider: false, marginBottom: 8 });
|
|
387
420
|
}
|
|
388
|
-
export function footerSection(props, inv) {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
421
|
+
export function footerSection(props, inv, labels = INVOICE_PDF_LABELS_EN) {
|
|
422
|
+
// An empty footer text prints the default one in the document's language,
|
|
423
|
+
// as an empty label does (issue #437); the built-in layout leaves it empty.
|
|
424
|
+
const raw = optStr(props, 'text') ?? labels['pdf.footer.default'];
|
|
392
425
|
return textBlock(raw, inv, props, { fontSize: 9, showTopDivider: true, marginBottom: 8 });
|
|
393
426
|
}
|
|
394
427
|
export function spacerSection(props = {}) {
|