@tomei/finance 0.6.23 → 0.6.24
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.
|
Binary file
|
|
@@ -17,12 +17,20 @@
|
|
|
17
17
|
<div class="tm_invoice tm_style1" id="tm_download_section">
|
|
18
18
|
<div class="tm_invoice_in">
|
|
19
19
|
<div class="tm_invoice_head tm_align_center tm_mb20">
|
|
20
|
-
<div class="tm_invoice_left">
|
|
20
|
+
<div class="tm_invoice_left" style="width: max-content;">
|
|
21
21
|
<div class="tm_logo">
|
|
22
22
|
<img src="./assets/img/logo.svg" alt="Logo" />
|
|
23
23
|
</div>
|
|
24
|
+
<div>
|
|
25
|
+
<p class="tm_m0" style="font-size: small;">
|
|
26
|
+
<b class="tm_primary_color">TXG Financial Solutions Sdn Bhd</b> (200201019252)(586915-X)
|
|
27
|
+
</p>
|
|
28
|
+
<p class="tm_m0" style="font-size: smaller;">
|
|
29
|
+
4-3, Jalan 2/131A, Project Jaya Industrial Estate, Batu 6, Jalan Kelang Lama, 58200 Kuala Lumpur, Malaysia.
|
|
30
|
+
</p>
|
|
31
|
+
</div>
|
|
24
32
|
</div>
|
|
25
|
-
<div class="tm_invoice_right tm_text_right tm_invoice_title">
|
|
33
|
+
<div class="tm_invoice_right tm_text_right tm_invoice_title" style="width: 30%;">
|
|
26
34
|
<div class="tm_primary_color tm_f50 tm_text_uppercase">
|
|
27
35
|
Invoice
|
|
28
36
|
</div>
|
|
@@ -143,7 +151,7 @@
|
|
|
143
151
|
Credit Card - 236***********928 <br />Amount: $1732
|
|
144
152
|
</p>
|
|
145
153
|
</div>
|
|
146
|
-
<div class="tm_item_total_section">
|
|
154
|
+
<div class="tm_item_total_section" style="padding-left: 120px;">
|
|
147
155
|
<table>
|
|
148
156
|
<tbody>
|
|
149
157
|
<tr>
|
package/package.json
CHANGED
package/src/document/document.ts
CHANGED
|
@@ -334,14 +334,12 @@ export default class Document extends AccountSystemEntity {
|
|
|
334
334
|
const page = await browser.newPage();
|
|
335
335
|
|
|
336
336
|
const imagePath = path.resolve(
|
|
337
|
-
'./invoice-template/assets/img/
|
|
337
|
+
'./invoice-template/assets/img/ezcash-logo.png',
|
|
338
338
|
);
|
|
339
339
|
const imageBuffer = await readFileContent(imagePath);
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
// temporary to hide the logo
|
|
344
|
-
const imageDataUrl = '';
|
|
340
|
+
const imageDataUrl = `data:image/svg+xml;base64,${imageBuffer.toString(
|
|
341
|
+
'base64',
|
|
342
|
+
)}`;
|
|
345
343
|
|
|
346
344
|
const imgTag = `<img src="${imageDataUrl}" alt="Logo">`;
|
|
347
345
|
|
|
@@ -558,18 +556,19 @@ export default class Document extends AccountSystemEntity {
|
|
|
558
556
|
]);
|
|
559
557
|
|
|
560
558
|
/* converting HTML to PDF */
|
|
561
|
-
const browser = await puppeteer.launch(
|
|
559
|
+
const browser = await puppeteer.launch({
|
|
560
|
+
headless: true,
|
|
561
|
+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
|
|
562
|
+
});
|
|
562
563
|
const page = await browser.newPage();
|
|
563
564
|
|
|
564
565
|
const imagePath = path.resolve(
|
|
565
|
-
'./invoice-template/assets/img/
|
|
566
|
+
'./invoice-template/assets/img/ezcash-logo.png',
|
|
566
567
|
);
|
|
567
568
|
const imageBuffer = await readFileContent(imagePath);
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
// temporary to hide tomei logo
|
|
572
|
-
const imageDataUrl = '';
|
|
569
|
+
const imageDataUrl = `data:image/svg+xml;base64,${imageBuffer.toString(
|
|
570
|
+
'base64',
|
|
571
|
+
)}`;
|
|
573
572
|
|
|
574
573
|
const imgTag = `<img src="${imageDataUrl}" alt="Logo">`;
|
|
575
574
|
|