ztechno_core 0.0.133 → 0.0.135
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.
|
@@ -42,6 +42,7 @@ export declare class InvoiceService {
|
|
|
42
42
|
payTokenSecret: string;
|
|
43
43
|
invoiceNumberMode?: 'sequence' | 'id';
|
|
44
44
|
invoiceNumberFormat?: (id: number) => string;
|
|
45
|
+
hideProductPrice?: boolean;
|
|
45
46
|
});
|
|
46
47
|
/** Returns the audit service for querying audit logs and timeline */
|
|
47
48
|
getAuditService(): InvoiceAuditService;
|
|
@@ -831,6 +831,7 @@ class InvoiceService {
|
|
|
831
831
|
doc.image(logoPath, 50, 50, { width: 150 }); // Left side of A4 page
|
|
832
832
|
}
|
|
833
833
|
const cfg = this.opt.siteConfig;
|
|
834
|
+
const { hideProductPrice } = this.opt;
|
|
834
835
|
// === SUPPLIER INFORMATION (right-aligned, Dutch law: name, address, BTW, KVK) ===
|
|
835
836
|
const rightCol = 320;
|
|
836
837
|
doc.fontSize(18).text(cfg.company.company, rightCol, 50, { width: 230, align: 'right' });
|
|
@@ -879,16 +880,18 @@ class InvoiceService {
|
|
|
879
880
|
// === LINE ITEMS TABLE (Dutch law: description, quantity, unit price excl. VAT, VAT rate, total) ===
|
|
880
881
|
const tableTop = doc.y;
|
|
881
882
|
const col1 = 50; // Description
|
|
882
|
-
const col2 = 280; //
|
|
883
|
-
const col3 = 330; //
|
|
883
|
+
const col2 = 280; // VAT %
|
|
884
|
+
const col3 = 330; // Qty
|
|
884
885
|
const col4 = 390; // Unit price (excl. VAT)
|
|
885
886
|
const col5 = 480; // Total Ex. VAT
|
|
886
887
|
doc.fontSize(9).font('Helvetica-Bold');
|
|
887
888
|
doc.text('Product / Dienst', col1, tableTop);
|
|
888
|
-
doc.text('
|
|
889
|
-
doc.text('
|
|
890
|
-
|
|
891
|
-
|
|
889
|
+
doc.text('BTW %', col2, tableTop);
|
|
890
|
+
doc.text('Aantal', col3, tableTop);
|
|
891
|
+
if (!hideProductPrice) {
|
|
892
|
+
doc.text('Prijs excl.', col4, tableTop);
|
|
893
|
+
doc.text('Totaal excl.', col5, tableTop);
|
|
894
|
+
}
|
|
892
895
|
doc.font('Helvetica');
|
|
893
896
|
doc
|
|
894
897
|
.moveTo(50, tableTop + 14)
|
|
@@ -951,10 +954,12 @@ class InvoiceService {
|
|
|
951
954
|
vatByRate[vatRate].vat += lineTotal - lineSubtotal;
|
|
952
955
|
P.size(9);
|
|
953
956
|
doc.text(item.description, col1, P.y, { width: 225 });
|
|
954
|
-
doc.text(
|
|
955
|
-
doc.text(
|
|
956
|
-
|
|
957
|
-
|
|
957
|
+
doc.text(`${vatRate.toFixed(0)}%`, col2, P.y);
|
|
958
|
+
doc.text(String(item.quantity), col3, P.y);
|
|
959
|
+
if (!hideProductPrice) {
|
|
960
|
+
doc.text(this.formatMoney(Number(item.unit_price), invoice.currency), col4, P.y);
|
|
961
|
+
doc.text(this.formatMoney(lineSubtotal, invoice.currency), col5, P.y);
|
|
962
|
+
}
|
|
958
963
|
P.skip(16);
|
|
959
964
|
}
|
|
960
965
|
P.rule().skip(10);
|