shareneus 1.5.82 → 1.5.83
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
|
}
|
|
@@ -420,7 +422,9 @@ function resolveShowBankDetails(invoiceData, printConfigData = {}) {
|
|
|
420
422
|
return isTruthy(value);
|
|
421
423
|
}
|
|
422
424
|
function shouldShowDueSection(printConfigData = {}) {
|
|
425
|
+
console.log('printCOnfigData?.Type', printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.Type);
|
|
423
426
|
const type = (0, pdf_shared_utils_1.firstValue)(printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.Type);
|
|
427
|
+
console.log('Normalized Type:', type);
|
|
424
428
|
if (!type) {
|
|
425
429
|
return false;
|
|
426
430
|
}
|
|
@@ -514,6 +518,7 @@ function resolveDueInfo(invoiceData, totals) {
|
|
|
514
518
|
const dueFromInvoice = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['Due', 'DueAmount', 'DueAmt', 'Balance', 'BalAmt']);
|
|
515
519
|
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
520
|
const due = dueFromInvoice !== 0 ? dueFromInvoice : Math.max(0, finalTotal - paid);
|
|
521
|
+
console.log('Due Info:', { paid, due, finalTotal });
|
|
517
522
|
return {
|
|
518
523
|
paid,
|
|
519
524
|
due,
|