shareneus 1.7.1 → 1.7.3

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.
@@ -449,7 +449,7 @@ class PosReceiptPrintService {
449
449
  if (ShowTaxColumn) {
450
450
  dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
451
451
  }
452
- dataRow.push({ text: item.Batch, alignment: 'center', style: ['headerstyle'], });
452
+ dataRow.push({ text: item.BN, alignment: 'center', style: ['headerstyle'], });
453
453
  dataRow.push({ text: item.ExDt, alignment: 'center', style: ['headerstyle'], });
454
454
  dataRow.push({ text: item.Make, alignment: 'center', style: ['headerstyle'], });
455
455
  dataRow.push({ text: item.Sch, alignment: 'center', style: ['headerstyle'], });
@@ -70,7 +70,7 @@ class SaleReceiptPrintService {
70
70
  InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
71
71
  InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
72
72
  InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
73
- let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts, InvoicePrintData.Entity.DecimalsNumber);
73
+ let PaymentData = this.GetPaymentsTotal(argInvoiceData.Pay, InvoicePrintData.Total, argInvoiceData.Sts, InvoicePrintData.Entity.DecimalsNumber);
74
74
  // if (argInvoiceData.Settings.DiscLvl !== 'REC') {
75
75
  // InvoicePrintData.FixedDisc = null;
76
76
  // }
@@ -214,7 +214,7 @@ class SaleReceiptPrintService {
214
214
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
215
215
  }
216
216
  Item.ExDt = this.GetExpiryDate(Item);
217
- Item.Batch = this.GetBatchesData(Item, OBN);
217
+ Item.BN = this.GetBatchesData(Item, OBN);
218
218
  Item.TCode = this.GetTCodeFromTaxes(Item);
219
219
  Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(itemCGST, DecimalsNumber);
220
220
  if (tr_utils_1.TrUtils.IsNull(Item.ConUt)) {
@@ -441,7 +441,7 @@ class SaleReceiptPrintService {
441
441
  let Data = {};
442
442
  let PaidTotal = 0;
443
443
  for (i = 0; i < InvoicePayments.length; i++) {
444
- PaidTotal += InvoicePayments[i].Paid;
444
+ PaidTotal += InvoicePayments[i].Amt;
445
445
  }
446
446
  if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
447
447
  Data.Due = 0;
@@ -7,7 +7,6 @@ exports.getCellAlignment = getCellAlignment;
7
7
  const pdf_table_config_1 = require("./pdf-table.config");
8
8
  const my_date_1 = require("../../utils/my-date");
9
9
  function buildDataRow(item, index, headerConfig, fixedTo = 2) {
10
- console.log('Building data row for headerConfig:', headerConfig);
11
10
  return headerConfig.map((column) => {
12
11
  var _a;
13
12
  if (column.type === 'tax') {
@@ -51,7 +50,6 @@ function buildDataRow(item, index, headerConfig, fixedTo = 2) {
51
50
  }
52
51
  function formatFieldValue(item, fieldConfig, fixedTo) {
53
52
  const rawValue = getFirstFieldValue(item, fieldConfig === null || fieldConfig === void 0 ? void 0 : fieldConfig.dbFields);
54
- console.log('rawValue for fieldConfig', fieldConfig === null || fieldConfig === void 0 ? void 0 : fieldConfig.dbFields, 'is', rawValue);
55
53
  if (isExpiryField(fieldConfig)) {
56
54
  return formatExpiryDateValue(rawValue);
57
55
  }
@@ -95,7 +93,6 @@ function negateNumericLikeValue(value) {
95
93
  return String(normalized === 0 ? 0 : -Math.abs(normalized));
96
94
  }
97
95
  function getFirstFieldValue(item, dbFields = []) {
98
- console.log('Getting first field value from item', item, 'using dbFields', dbFields);
99
96
  for (const field of dbFields) {
100
97
  const value = readValue(item, field);
101
98
  if (value !== undefined && value !== null && value !== '') {
@@ -105,8 +102,6 @@ function getFirstFieldValue(item, dbFields = []) {
105
102
  return '';
106
103
  }
107
104
  function readValue(item, field) {
108
- console.log('Reading value for field', field, 'from item', item);
109
- console.log('Direct value', item[field]);
110
105
  if (!item || !field) {
111
106
  return undefined;
112
107
  }
@@ -114,13 +109,11 @@ function readValue(item, field) {
114
109
  return item[field];
115
110
  }
116
111
  const dottedPathValue = field.split('.').reduce((current, key) => {
117
- console.log('Current value for key', key, 'is', current);
118
112
  if (current && current[key] !== undefined) {
119
113
  return current[key];
120
114
  }
121
115
  return undefined;
122
116
  }, item);
123
- console.log('Value for field', field, 'is', dottedPathValue);
124
117
  if (dottedPathValue !== undefined) {
125
118
  return dottedPathValue;
126
119
  }
@@ -384,10 +384,7 @@ function shouldNegateFallbackHeaderValue(item, headerText) {
384
384
  || normalized === 'LINE TOTAL';
385
385
  }
386
386
  function getDisplayValueForFallbackRow(item, dbFields = [], shouldNegate = false) {
387
- console.log(item, dbFields, shouldNegate);
388
- console.log((0, pdf_table_row_1.getFirstFieldValue)(item, dbFields));
389
387
  const value = (0, pdf_table_row_1.getFirstFieldValue)(item, dbFields);
390
- console.log('value', value);
391
388
  if (!shouldNegate) {
392
389
  return value;
393
390
  }
@@ -66,7 +66,7 @@ function buildTopSectionColumns(taxSummary, sType, showBankDetails, bankDetails,
66
66
  const inWords = totalInWords || '-';
67
67
  if (taxSummary.hasData) {
68
68
  return [
69
- { width: '42%', stack: buildTaxSummaryTableStack(null, taxSummary.rows, sType) },
69
+ { width: '42%', stack: buildTaxSummaryTableStack(null, taxSummary.rows, sType), marginTop: 2 },
70
70
  { width: '28%', stack: showBankDetails ? buildInfoCardStack('Bank Details', bankDetails.lines) : [{ text: '' }] },
71
71
  { width: '30%', stack: buildInfoCardStack(null, totals.lines, { rightAlign: true }) }
72
72
  ];
@@ -85,7 +85,7 @@ function buildTopSectionColumns(taxSummary, sType, showBankDetails, bankDetails,
85
85
  { width: '*', text: inWords, bold: true, fontSize: 9, color: '#111827' }
86
86
  ],
87
87
  columnGap: 6,
88
- margin: [0, 0, 0, 4]
88
+ margin: [0, 2, 0, 4]
89
89
  },
90
90
  { width: '30%', stack: buildInfoCardStack(null, totals.lines, { rightAlign: true }) }
91
91
  ];
@@ -102,7 +102,7 @@ function buildPostTotalsInfoSection(data) {
102
102
  { width: '*', text: inWords, bold: true, fontSize: 9, color: '#111827' }
103
103
  ],
104
104
  columnGap: 6,
105
- margin: [0, 0, 0, 4]
105
+ margin: [0, 2, 0, 4]
106
106
  });
107
107
  }
108
108
  if (data.showDueSection && !data.isPoSPrint) {
@@ -132,7 +132,7 @@ function buildPostTotalsInfoSection(data) {
132
132
  width: '60%',
133
133
  stack: [
134
134
  { text: '* Goods once sold will not be taken back or exchanged', fontSize: 6, color: '#111827' },
135
- { text: '* PLEASE GET YOUR MEDICINES CHECKED BY YOUR DOCTOR BEFORE USE *', fontSize: 6, color: '#111827' }
135
+ { text: '* PLEASE GET YOUR MEDICINES CHECKED BY YOUR DOCTOR BEFORE USE', fontSize: 6, color: '#111827' }
136
136
  ],
137
137
  margin: [5, 0, 0, 6],
138
138
  lineHeight: 1.1
@@ -605,7 +605,7 @@ function resolveTotals(invoiceData, totalTax, printConfigData = {}) {
605
605
  { label: 'Total', amount: totalBeforeRound },
606
606
  { label: 'Rounding', amount: roundOff },
607
607
  ...(roundOff !== 0 ? [{ label: 'Final Total', amount: resolvedFinalTotal }] : []),
608
- ...(isPoSPrint ? [{ label: 'Due', amount: dueAmount }] : [])
608
+ ...(isPoSPrint ? [{ label: 'Due', amount: dueFromInvoice }] : [])
609
609
  ];
610
610
  const lines = totalLines
611
611
  .filter((line) => parseNumber(line === null || line === void 0 ? void 0 : line.amount) !== 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.01",
3
+ "version": "1.7.03",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",