shareneus 1.6.59 → 1.6.61

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.
@@ -87,10 +87,19 @@ class IssuePartsprintService {
87
87
  }
88
88
  else {
89
89
  for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
90
- if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
91
- ROPrintData.PrintInfo[i].Text = '';
90
+ // if (TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
91
+ // ROPrintData.PrintInfo[i].Text = '';
92
+ // }
93
+ const printInfo = ROPrintData.PrintInfo[i];
94
+ const hasText = !tr_utils_1.TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
95
+ const hasPartsOrOps = (!tr_utils_1.TrUtils.IsNull(printInfo.Items) && printInfo.Items.length > 0)
96
+ || (!tr_utils_1.TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
97
+ if (hasText) {
98
+ List.push(ROPrintData.PrintInfo[i].Text);
99
+ }
100
+ if (hasPartsOrOps) {
101
+ List.push(this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber));
92
102
  }
93
- List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber));
94
103
  }
95
104
  }
96
105
  }
@@ -183,14 +192,16 @@ class IssuePartsprintService {
183
192
  let Taxable = 0;
184
193
  let FinalTotal = 0;
185
194
  Parts.forEach((part) => {
186
- // console.log('part', part);
195
+ console.log('part', part);
187
196
  Qty = Qty + part.Qty;
197
+ console.log(part.CGSTAmt, part.SGSTAmt, part.IGSTAmt);
188
198
  CGSTAMT = CGSTAMT + part.CGSTAmt;
189
199
  SGSTAMT = SGSTAMT + part.SGSTAmt;
190
200
  IGSTAMT = IGSTAMT + part.IGSTAmt;
191
201
  Taxable = Taxable + part.AfterPartDisc;
192
202
  FinalTotal = FinalTotal + part.AfterPartTax;
193
203
  });
204
+ console.log(CGSTAMT, SGSTAMT, IGSTAMT);
194
205
  let dpartadding1 = {};
195
206
  dpartadding1.SNo = '';
196
207
  dpartadding1.Desc = 'Spare Total';
@@ -5,6 +5,7 @@ exports.getAvailablePageWidth = getAvailablePageWidth;
5
5
  exports.calculateSectionTotals = calculateSectionTotals;
6
6
  exports.readNumericValue = readNumericValue;
7
7
  exports.formatAmount = formatAmount;
8
+ const math_operations_1 = require("../math-operations");
8
9
  const pdf_table_config_1 = require("./pdf-table.config");
9
10
  const pdf_table_header_1 = require("./pdf-table.header");
10
11
  const pdf_table_row_1 = require("./pdf-table.row");
@@ -89,8 +90,10 @@ function getAvailablePageWidth(pageSize, orientation, margins) {
89
90
  function calculateSectionTotals(rows) {
90
91
  return rows.reduce((acc, row) => {
91
92
  const sign = (row === null || row === void 0 ? void 0 : row.Ret) ? -1 : 1;
92
- acc.qty += sign * readNumericValue(row, ['Qty']);
93
- acc.priceTotal += sign * readNumericValue(row, ['UnPr', 'Pr', 'UnCo']);
93
+ const quantity = (row === null || row === void 0 ? void 0 : row.Qty) == null ? 1 : readNumericValue(row, ['Qty']);
94
+ acc.qty += sign * quantity;
95
+ const taxableAmt = Number((0, math_operations_1.Multiply)(quantity, readNumericValue(row, ['UnPr', 'Pr', 'UnCo'])));
96
+ acc.priceTotal += sign * (Number.isFinite(taxableAmt) ? taxableAmt : 0);
94
97
  acc.discountAmount += sign * readNumericValue(row, ['Disc']);
95
98
  acc.cgstAmount += sign * readNumericValue(row, ['CGSTAmt', 'CGST']);
96
99
  acc.sgstAmount += sign * readNumericValue(row, ['SGSTAmt', 'SGST']);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.59",
3
+ "version": "1.6.61",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",