shareneus 1.6.60 → 1.6.62

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.
@@ -192,11 +192,10 @@ class IssuePartsprintService {
192
192
  let Taxable = 0;
193
193
  let FinalTotal = 0;
194
194
  Parts.forEach((part) => {
195
- console.log('part', part);
196
195
  Qty = Qty + part.Qty;
197
- CGSTAMT = CGSTAMT + part.CGSTAmt;
198
- SGSTAMT = SGSTAMT + part.SGSTAmt;
199
- IGSTAMT = IGSTAMT + part.IGSTAmt;
196
+ CGSTAMT = CGSTAMT + Number(part.CGSTAmt);
197
+ SGSTAMT = SGSTAMT + Number(part.SGSTAmt);
198
+ IGSTAMT = IGSTAMT + Number(part.IGSTAmt);
200
199
  Taxable = Taxable + part.AfterPartDisc;
201
200
  FinalTotal = FinalTotal + part.AfterPartTax;
202
201
  });
@@ -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.60",
3
+ "version": "1.6.62",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",