shareneus 1.6.60 → 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.
@@ -194,12 +194,14 @@ class IssuePartsprintService {
194
194
  Parts.forEach((part) => {
195
195
  console.log('part', part);
196
196
  Qty = Qty + part.Qty;
197
+ console.log(part.CGSTAmt, part.SGSTAmt, part.IGSTAmt);
197
198
  CGSTAMT = CGSTAMT + part.CGSTAmt;
198
199
  SGSTAMT = SGSTAMT + part.SGSTAmt;
199
200
  IGSTAMT = IGSTAMT + part.IGSTAmt;
200
201
  Taxable = Taxable + part.AfterPartDisc;
201
202
  FinalTotal = FinalTotal + part.AfterPartTax;
202
203
  });
204
+ console.log(CGSTAMT, SGSTAMT, IGSTAMT);
203
205
  let dpartadding1 = {};
204
206
  dpartadding1.SNo = '';
205
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.60",
3
+ "version": "1.6.61",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",