ztechno_core 0.0.123 → 0.0.125
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.
|
@@ -144,7 +144,7 @@ class InvoicesOrm extends orm_1.ZOrm {
|
|
|
144
144
|
await this.sqlService.query(/*SQL*/ `
|
|
145
145
|
CREATE TABLE IF NOT EXISTS \`${this.alias}\` (
|
|
146
146
|
id BIGINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
|
|
147
|
-
invoice_number VARCHAR(
|
|
147
|
+
invoice_number VARCHAR(44) NOT NULL,
|
|
148
148
|
customer_id BIGINT UNSIGNED NOT NULL,
|
|
149
149
|
subscription_id BIGINT UNSIGNED NULL,
|
|
150
150
|
subscription_period_start DATETIME,
|
|
@@ -782,20 +782,20 @@ class InvoiceService {
|
|
|
782
782
|
P.rule().skip(10);
|
|
783
783
|
// === TOTALS (Dutch law: subtotal, VAT breakdown per rate, subtotal incl. VAT) ===
|
|
784
784
|
P.size(10);
|
|
785
|
-
P.row('Subtotaal excl. BTW:',
|
|
785
|
+
P.row('Subtotaal excl. BTW:', 290, this.formatMoney(subtotal, invoice.currency), col5);
|
|
786
786
|
let totalVat = 0;
|
|
787
787
|
for (const [rate, { vat }] of Object.entries(vatByRate)) {
|
|
788
788
|
totalVat += vat;
|
|
789
|
-
P.row(`BTW ${rate}%`,
|
|
789
|
+
P.row(`BTW ${rate}%`, 290, this.formatMoney(vat, invoice.currency), col5);
|
|
790
790
|
}
|
|
791
791
|
const serviceTotalIncVat = subtotal + totalVat;
|
|
792
792
|
// === SUBSIDY SECTION (shown before grand total when subsidies are present) ===
|
|
793
793
|
let subsidyTotal = 0;
|
|
794
794
|
if (subsidyItems.length > 0) {
|
|
795
795
|
P.bold().size(10);
|
|
796
|
-
P.row('Totaal incl. BTW:',
|
|
796
|
+
P.row('Totaal incl. BTW:', 290, this.formatMoney(serviceTotalIncVat, invoice.currency), col5)
|
|
797
797
|
.skip(4)
|
|
798
|
-
.dashedRule(
|
|
798
|
+
.dashedRule(290, 560)
|
|
799
799
|
.skip(8);
|
|
800
800
|
P.bold().size(9);
|
|
801
801
|
P.text('Geschatte Subsidie', 50, { width: 300 }, 12);
|
|
@@ -807,7 +807,7 @@ class InvoiceService {
|
|
|
807
807
|
doc.text(`- ${this.formatMoney(Math.abs(subsidyAmount), invoice.currency)}`, col5, P.y);
|
|
808
808
|
P.skip(14);
|
|
809
809
|
}
|
|
810
|
-
P.dashedRule(
|
|
810
|
+
P.dashedRule(290, 560).skip(8);
|
|
811
811
|
}
|
|
812
812
|
const grandTotal = serviceTotalIncVat + subsidyTotal; // subsidyTotal is negative
|
|
813
813
|
P.size(10);
|
|
@@ -816,7 +816,7 @@ class InvoiceService {
|
|
|
816
816
|
P.row('Uw Totale Investering incl. Subsidie:', 290, this.formatMoney(grandTotal, invoice.currency), col5, 20);
|
|
817
817
|
} else {
|
|
818
818
|
P.bold();
|
|
819
|
-
P.row('Totaal incl. BTW:',
|
|
819
|
+
P.row('Totaal incl. BTW:', 290, this.formatMoney(grandTotal, invoice.currency), col5, 20);
|
|
820
820
|
P.normal();
|
|
821
821
|
}
|
|
822
822
|
// === TWO-COLUMN FOOTER: Description & Terms (left) | Bank details (right) ===
|