shareneus 1.5.78 → 1.5.80

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.
@@ -55,6 +55,7 @@ function buildPurchasePartyDetailsSection(PDFInvoiceData, customerLayout) {
55
55
  }
56
56
  function buildPartyDetailsSectionLayout(config) {
57
57
  var _a, _b, _c, _d, _e, _f;
58
+ console.log('Secondary Party:', config === null || config === void 0 ? void 0 : config.secondaryParty);
58
59
  const primaryStack = ((_a = config === null || config === void 0 ? void 0 : config.primaryParty) === null || _a === void 0 ? void 0 : _a.hasData)
59
60
  ? buildPartyStack(config.primaryTitle, config.primaryParty, config.customerLayout)
60
61
  : [{ text: '' }];
@@ -107,12 +108,14 @@ function resolveSalesBillToDetails(transactionData) {
107
108
  };
108
109
  }
109
110
  function resolveSalesShipToDetails(transactionData) {
111
+ console.log('Resolving Ship To Details from Transaction Data:', transactionData);
110
112
  const shipTo = (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipTo) || {};
111
113
  const address = normalizeAddress((shipTo === null || shipTo === void 0 ? void 0 : shipTo.Adrs)
112
114
  || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipAddress)
113
115
  || (transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShipToAddress));
114
116
  const name = (0, pdf_shared_utils_1.firstValue)(shipTo === null || shipTo === void 0 ? void 0 : shipTo.Name, shipTo === null || shipTo === void 0 ? void 0 : shipTo.CName);
115
117
  const gstin = (0, pdf_shared_utils_1.firstValue)(shipTo === null || shipTo === void 0 ? void 0 : shipTo.GSTIN, shipTo === null || shipTo === void 0 ? void 0 : shipTo.GSTNo);
118
+ console.log('Ship To Details:', { name, gstin, address });
116
119
  return {
117
120
  name,
118
121
  addressLines: buildAddressLines(address),
@@ -25,14 +25,24 @@ function buildInvoiceTableData(PDFInvoiceData, PrintConfig, availableWidth) {
25
25
  const descriptionColumnIndex = getDescriptionColumnIndexFromHeaders(fallbackHeaderRow);
26
26
  const itemTotals = calculateSectionTotals(items);
27
27
  const serviceTotals = calculateSectionTotals(services);
28
+ const itemSectionRows = items.length > 0
29
+ ? [
30
+ buildSectionLabelRow(fallbackHeaderRow.length, descriptionColumnIndex, 'Items'),
31
+ ...items.map((item, index) => buildFallbackDataRow(item, index, fallbackHeaderRow, fixedTo)),
32
+ buildFallbackSectionTotalRow(fallbackHeaderRow, 'Items Total', itemTotals, fixedTo)
33
+ ]
34
+ : [];
35
+ const serviceSectionRows = services.length > 0
36
+ ? [
37
+ buildSectionLabelRow(fallbackHeaderRow.length, descriptionColumnIndex, 'Services'),
38
+ ...services.map((service, index) => buildFallbackDataRow(service, index, fallbackHeaderRow, fixedTo)),
39
+ buildFallbackSectionTotalRow(fallbackHeaderRow, 'Services Total', serviceTotals, fixedTo)
40
+ ]
41
+ : [];
28
42
  body = [
29
43
  fallbackHeaderRow,
30
- buildSectionLabelRow(fallbackHeaderRow.length, descriptionColumnIndex, 'Items'),
31
- ...items.map((item, index) => buildFallbackDataRow(item, index, fallbackHeaderRow, fixedTo)),
32
- buildFallbackSectionTotalRow(fallbackHeaderRow, 'Items Total', itemTotals, fixedTo),
33
- buildSectionLabelRow(fallbackHeaderRow.length, descriptionColumnIndex, 'Services'),
34
- ...services.map((service, index) => buildFallbackDataRow(service, index, fallbackHeaderRow, fixedTo)),
35
- buildFallbackSectionTotalRow(fallbackHeaderRow, 'Services Total', serviceTotals, fixedTo)
44
+ ...itemSectionRows,
45
+ ...serviceSectionRows
36
46
  ];
37
47
  widths = fitWidthsToPage(fallbackHeaderRow.map((col) => col === null || col === void 0 ? void 0 : col.width), availableWidth, fallbackHeaderRow.length);
38
48
  }
@@ -40,14 +50,24 @@ function buildInvoiceTableData(PDFInvoiceData, PrintConfig, availableWidth) {
40
50
  const descriptionColumnIndex = getDescriptionColumnIndexFromColumns(renderColumns);
41
51
  const itemTotals = calculateSectionTotals(items);
42
52
  const serviceTotals = calculateSectionTotals(services);
53
+ const itemSectionRows = items.length > 0
54
+ ? [
55
+ buildSectionLabelRow(renderColumns.length, descriptionColumnIndex, 'Items'),
56
+ ...items.map((item, index) => (0, pdf_table_row_1.buildDataRow)(item, index, renderColumns, fixedTo)),
57
+ buildSectionTotalRow(renderColumns, 'Items Total', itemTotals, fixedTo)
58
+ ]
59
+ : [];
60
+ const serviceSectionRows = services.length > 0
61
+ ? [
62
+ buildSectionLabelRow(renderColumns.length, descriptionColumnIndex, 'Services'),
63
+ ...services.map((service, index) => (0, pdf_table_row_1.buildDataRow)(service, index, renderColumns, fixedTo)),
64
+ buildSectionTotalRow(renderColumns, 'Services Total', serviceTotals, fixedTo)
65
+ ]
66
+ : [];
43
67
  body = [
44
68
  ...headerRows,
45
- buildSectionLabelRow(renderColumns.length, descriptionColumnIndex, 'Items'),
46
- ...items.map((item, index) => (0, pdf_table_row_1.buildDataRow)(item, index, renderColumns, fixedTo)),
47
- buildSectionTotalRow(renderColumns, 'Items Total', itemTotals, fixedTo),
48
- buildSectionLabelRow(renderColumns.length, descriptionColumnIndex, 'Services'),
49
- ...services.map((service, index) => (0, pdf_table_row_1.buildDataRow)(service, index, renderColumns, fixedTo)),
50
- buildSectionTotalRow(renderColumns, 'Services Total', serviceTotals, fixedTo)
69
+ ...itemSectionRows,
70
+ ...serviceSectionRows
51
71
  ];
52
72
  widths = fitWidthsToPage(renderColumns.map((col) => col === null || col === void 0 ? void 0 : col.width), availableWidth, renderColumns.length);
53
73
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.78",
3
+ "version": "1.5.80",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",