ztechno_core 0.0.108 → 0.0.110
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.
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
export type Coordinates = [number, number];
|
|
2
2
|
export type CompanyInfo = {
|
|
3
|
-
baseUrl: string;
|
|
4
|
-
website: string;
|
|
5
3
|
company: string;
|
|
4
|
+
companyShort: string;
|
|
6
5
|
copyright: string;
|
|
7
6
|
kvk: string;
|
|
8
7
|
kvkUrl: string;
|
|
@@ -38,6 +37,7 @@ export type RenderContext = {
|
|
|
38
37
|
projectsHtml: string;
|
|
39
38
|
};
|
|
40
39
|
export type RenderData = {
|
|
40
|
+
baseUrl: string;
|
|
41
41
|
company: CompanyInfo;
|
|
42
42
|
address: Address;
|
|
43
43
|
contact: ContactInfo;
|
|
@@ -22,7 +22,7 @@ class InvoiceService {
|
|
|
22
22
|
return this.opt.siteConfig;
|
|
23
23
|
}
|
|
24
24
|
get baseUrl() {
|
|
25
|
-
return this.opt.siteConfig.
|
|
25
|
+
return this.opt.siteConfig.baseUrl;
|
|
26
26
|
}
|
|
27
27
|
constructor(opt) {
|
|
28
28
|
this.opt = opt;
|
|
@@ -637,7 +637,7 @@ class InvoiceService {
|
|
|
637
637
|
// === COMPANY LOGO (left-aligned) ===
|
|
638
638
|
const logoPath = path_1.default.join(process.cwd(), '../zwebsite/public/img/invoice/invoice-logo.png');
|
|
639
639
|
if (fs_1.default.existsSync(logoPath)) {
|
|
640
|
-
doc.image(logoPath, 50, 50, { width:
|
|
640
|
+
doc.image(logoPath, 50, 50, { width: 150 }); // Left side of A4 page
|
|
641
641
|
}
|
|
642
642
|
const cfg = this.opt.siteConfig;
|
|
643
643
|
// === SUPPLIER INFORMATION (right-aligned, Dutch law: name, address, BTW, KVK) ===
|
|
@@ -693,7 +693,7 @@ class InvoiceService {
|
|
|
693
693
|
const col4 = 390; // Unit price (excl. VAT)
|
|
694
694
|
const col5 = 480; // Total Ex. VAT
|
|
695
695
|
doc.fontSize(9).font('Helvetica-Bold');
|
|
696
|
-
doc.text('
|
|
696
|
+
doc.text('Product / Dienst', col1, tableTop);
|
|
697
697
|
doc.text('Aantal', col2, tableTop);
|
|
698
698
|
doc.text('BTW %', col3, tableTop);
|
|
699
699
|
doc.text('Prijs excl.', col4, tableTop);
|
|
@@ -834,18 +834,18 @@ class InvoiceService {
|
|
|
834
834
|
const subject = isReceipt ? `Betalingsbevestiging ${invoice.invoice_number}` : `Factuur ${invoice.invoice_number}`;
|
|
835
835
|
const title = isReceipt ? `Betaling ontvangen ${invoice.invoice_number}` : `Factuur ${invoice.invoice_number}`;
|
|
836
836
|
const content = isReceipt
|
|
837
|
-
? `<br>Beste ${customer.name},<br><br>We hebben uw betaling ontvangen. De factuur vindt u in de bijlage.<br><br>Dank u wel, ${cfg.company.
|
|
838
|
-
: `<br>Beste ${customer.name},<br><br>U vindt uw factuur in de bijlage.<br><br><a href="${pay?.payUrl}" style="display:inline-block;padding:10px 16px;background:#0d6efd;color:#fff;text-decoration:none;border-radius:6px;">Betaal nu</a><br><br>Dank u wel, ${cfg.company.
|
|
837
|
+
? `<br>Beste ${customer.name},<br><br>We hebben uw betaling ontvangen. De factuur vindt u in de bijlage.<br><br>Dank u wel, ${cfg.company.companyShort}<br>`
|
|
838
|
+
: `<br>Beste ${customer.name},<br><br>U vindt uw factuur in de bijlage.<br><br><a href="${pay?.payUrl}" style="display:inline-block;padding:10px 16px;background:#0d6efd;color:#fff;text-decoration:none;border-radius:6px;">Betaal nu</a><br><br>Dank u wel, ${cfg.company.companyShort}<br>`;
|
|
839
839
|
await this.mailService.sendAdvanced({
|
|
840
|
-
from: `${cfg.company.
|
|
840
|
+
from: `${cfg.company.company} <${cfg.contact.contact}>`,
|
|
841
841
|
recipient: to,
|
|
842
842
|
subject,
|
|
843
843
|
template: 'template.html',
|
|
844
844
|
inject: {
|
|
845
845
|
title,
|
|
846
846
|
content,
|
|
847
|
-
logoSrc: `${cfg.
|
|
848
|
-
baseUrl: cfg.
|
|
847
|
+
logoSrc: `${cfg.baseUrl}/img/logo-small.png`,
|
|
848
|
+
baseUrl: cfg.baseUrl,
|
|
849
849
|
},
|
|
850
850
|
attachments: [
|
|
851
851
|
{
|