shareneus 1.5.82 → 1.5.84
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.
|
@@ -16,9 +16,11 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
|
|
|
16
16
|
const notes = (0, pdf_shared_utils_1.firstValue)(normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Notes, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Note, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Remarks, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Remark);
|
|
17
17
|
const terms = (0, pdf_shared_utils_1.firstValue)(normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.TermsAndConditions, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.TermsCondition, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Terms, normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.TC);
|
|
18
18
|
const dueInfo = resolveDueInfo(normalizedInvoice, totals);
|
|
19
|
+
console.log('Due Info:', dueInfo);
|
|
19
20
|
const qrPayload = resolveQrPayload(normalizedInvoice);
|
|
20
21
|
const hasTopSection = taxSummary.hasData || bankDetails.hasData || totals.hasData;
|
|
21
22
|
const hasBottomSection = !!(notes || terms || totalInWords || (showDueSection && dueInfo.hasData) || qrPayload);
|
|
23
|
+
console.log('hasTopSection:', hasTopSection, 'hasBottomSection:', hasBottomSection);
|
|
22
24
|
if (!hasTopSection && !hasBottomSection) {
|
|
23
25
|
return [];
|
|
24
26
|
}
|
|
@@ -82,6 +84,7 @@ function buildPostTotalsInfoSection(data) {
|
|
|
82
84
|
margin: [0, 0, 0, 4]
|
|
83
85
|
}
|
|
84
86
|
];
|
|
87
|
+
console.log('showDueSection:', data.showDueSection, 'paidAmount:', data.paidAmount, 'dueAmount:', data.dueAmount);
|
|
85
88
|
if (data.showDueSection) {
|
|
86
89
|
const paidText = `Paid : Rs.${formatAmountFixed2(data.paidAmount)}`;
|
|
87
90
|
const dueText = `Due : Rs.${formatAmountFixed2(data.dueAmount)}`;
|
|
@@ -102,6 +105,8 @@ function buildPostTotalsInfoSection(data) {
|
|
|
102
105
|
margin: [0, 0, 0, 6]
|
|
103
106
|
});
|
|
104
107
|
}
|
|
108
|
+
console.log('termsText:', termsText);
|
|
109
|
+
console.log('hasQr:', hasQr);
|
|
105
110
|
if (termsText) {
|
|
106
111
|
leftStack.push({
|
|
107
112
|
text: `\u2022 ${termsText}`,
|
|
@@ -110,6 +115,7 @@ function buildPostTotalsInfoSection(data) {
|
|
|
110
115
|
lineHeight: 1.1
|
|
111
116
|
});
|
|
112
117
|
}
|
|
118
|
+
console.log('leftStack:', leftStack);
|
|
113
119
|
const leftColumn = {
|
|
114
120
|
width: hasQr ? '74%' : '*',
|
|
115
121
|
stack: leftStack
|
|
@@ -420,7 +426,9 @@ function resolveShowBankDetails(invoiceData, printConfigData = {}) {
|
|
|
420
426
|
return isTruthy(value);
|
|
421
427
|
}
|
|
422
428
|
function shouldShowDueSection(printConfigData = {}) {
|
|
429
|
+
console.log('printCOnfigData?.Type', printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.Type);
|
|
423
430
|
const type = (0, pdf_shared_utils_1.firstValue)(printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.Type);
|
|
431
|
+
console.log('Normalized Type:', type);
|
|
424
432
|
if (!type) {
|
|
425
433
|
return false;
|
|
426
434
|
}
|
|
@@ -514,6 +522,7 @@ function resolveDueInfo(invoiceData, totals) {
|
|
|
514
522
|
const dueFromInvoice = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['Due', 'DueAmount', 'DueAmt', 'Balance', 'BalAmt']);
|
|
515
523
|
const finalTotal = parseNumber((0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.FinalTotal, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Total, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.GrandTotal, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.NetTotal));
|
|
516
524
|
const due = dueFromInvoice !== 0 ? dueFromInvoice : Math.max(0, finalTotal - paid);
|
|
525
|
+
console.log('Due Info:', { paid, due, finalTotal });
|
|
517
526
|
return {
|
|
518
527
|
paid,
|
|
519
528
|
due,
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shareneus",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.84",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"build": "tsc"
|
|
9
|
-
},
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
10
|
"keywords": [],
|
|
11
11
|
"author": "",
|
|
12
12
|
"license": "ISC",
|