shareneus 1.5.1 → 1.5.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.
Files changed (48) hide show
  1. package/dist/accounting/counter-sales/sales-receipt-print.service.js +8 -9
  2. package/dist/accounting/credit-note/cn-print.service.js +7 -7
  3. package/dist/accounting/credit-note/credit-note-totals.service.d.ts +2 -2
  4. package/dist/accounting/credit-note/credit-note-totals.service.js +33 -33
  5. package/dist/accounting/debit-note/debit-note-print.service.js +8 -8
  6. package/dist/accounting/debit-note/debit-note-totals.service.d.ts +2 -2
  7. package/dist/accounting/debit-note/debit-note-totals.service.js +27 -27
  8. package/dist/accounting/invoice/inv-pdf.service.js +12 -12
  9. package/dist/accounting/invoice/inv-print.service.js +11 -11
  10. package/dist/accounting/invoice/invoice-landscape-pdf.service.js +4 -4
  11. package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +12 -12
  12. package/dist/accounting/invoice/invoice-portrait-pdf.js +5 -5
  13. package/dist/accounting/invoice/invoice-total.service.d.ts +8 -8
  14. package/dist/accounting/invoice/invoice-total.service.js +79 -79
  15. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +2 -2
  16. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +4 -4
  17. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +4 -4
  18. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +3 -3
  19. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +3 -3
  20. package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +2 -2
  21. package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +2 -2
  22. package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +2 -2
  23. package/dist/appointments/appointments/appointment-total.service.js +12 -12
  24. package/dist/appointments/consultations/consultation-fee-receipt.service.js +2 -2
  25. package/dist/purchases/purchase-order/po-totals.service.js +13 -13
  26. package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +1 -1
  27. package/dist/purchases/purchase-order/purchase-order-totals.service.js +58 -58
  28. package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +1 -1
  29. package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +20 -20
  30. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +7 -7
  31. package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +2 -2
  32. package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +26 -26
  33. package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +4 -4
  34. package/dist/sales/delivery-challan/delivery-challan-print.service.js +7 -7
  35. package/dist/sales/delivery-challan/delivery-challan-totals.js +35 -35
  36. package/dist/sales/sales/sales-print.service.js +9 -9
  37. package/dist/sales/sales/sales-totals.service.js +32 -32
  38. package/dist/sales-receive/sales-receive-print.service.js +10 -10
  39. package/dist/sales-receive/sales-receive-totals.service.d.ts +2 -2
  40. package/dist/sales-receive/sales-receive-totals.service.js +32 -32
  41. package/dist/sales-receive/sales-total-calculation.js +1 -1
  42. package/dist/services/est.print-service.js +5 -5
  43. package/dist/services/ro-print-service.js +13 -13
  44. package/dist/services/ro-totals.service.d.ts +4 -4
  45. package/dist/services/ro-totals.service.js +140 -140
  46. package/dist/shared/math-operations.js +46 -41
  47. package/dist/shared/shared-pdf.service.js +8 -8
  48. package/package.json +1 -1
@@ -5,9 +5,9 @@ const tr_utils_1 = require("../../utils/tr-utils");
5
5
  const code_enums_1 = require("../../enums/code-enums");
6
6
  const my_date_1 = require("../../utils/my-date");
7
7
  const enums_1 = require("../../enums/enums");
8
- const aggregation_1 = require("../../aggregation/aggregation");
9
8
  const shared_print_service_1 = require("../../shared/shared-print.service");
10
9
  const sales_totals_service_1 = require("./sales-totals.service");
10
+ const math_operations_1 = require("../../shared/math-operations");
11
11
  class SalesPrintService {
12
12
  static GetSalesPrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, isOtherIndustry) {
13
13
  var _a, _b;
@@ -108,16 +108,16 @@ class SalesPrintService {
108
108
  DiscAmt = DiscAmt + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.Disc) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.RecDisc);
109
109
  TaxAmt = TaxAmt + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.CGST) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.SGST)
110
110
  + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
111
- let NetAmt = (0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc, Item.RecDisc);
111
+ let NetAmt = (0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc, Item.RecDisc);
112
112
  TotalAmt = TotalAmt + tr_utils_1.TrUtils.SetValueToZeroIfNull(NetAmt) +
113
113
  tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.CGST) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.SGST)
114
114
  + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
115
115
  if (Consolidate) {
116
- let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterItemDisc, Item.Qty);
117
- let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
118
- let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
119
- let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
120
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
116
+ let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterItemDisc, Item.Qty);
117
+ let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
118
+ let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
119
+ let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
120
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
121
121
  }
122
122
  else {
123
123
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -135,7 +135,7 @@ class SalesPrintService {
135
135
  Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterItemTax, DecimalsNumber);
136
136
  }
137
137
  else {
138
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
138
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
139
139
  }
140
140
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
141
141
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -293,7 +293,7 @@ class SalesPrintService {
293
293
  Data.Due = 0;
294
294
  }
295
295
  else {
296
- Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
296
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
297
297
  }
298
298
  if (Data.Due < 0) {
299
299
  Data.Due = 0;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SalesTotalsService = void 0;
4
- const aggregation_1 = require("../../aggregation/aggregation");
4
+ const math_operations_1 = require("../../shared/math-operations");
5
5
  const tr_utils_1 = require("../../utils/tr-utils");
6
6
  class SalesTotalsService {
7
7
  static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, PDisc, PPerc, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable, EntitySettings) {
@@ -32,11 +32,11 @@ class SalesTotalsService {
32
32
  static ResetLaborItemValues(ItemsList, IsIndependentTax) {
33
33
  ItemsList.forEach((Item) => {
34
34
  Item = this.ResetLaborItemValueIfInvalid(Item);
35
- Item.DiscountedPrice = (0, aggregation_1.addition)(Item.Disc, Item.RecDisc);
36
- let NetAmt = (0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc, Item.RecDisc);
35
+ Item.DiscountedPrice = (0, math_operations_1.Add)(Item.Disc, Item.RecDisc);
36
+ let NetAmt = (0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc, Item.RecDisc);
37
37
  Item.AfterItemDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(NetAmt);
38
38
  if (IsIndependentTax) {
39
- Item.AfterItemTax = (0, aggregation_1.addition)(Item.AfterItemDisc, Item.CGST, Item.SGST, Item.IGST);
39
+ Item.AfterItemTax = (0, math_operations_1.Add)(Item.AfterItemDisc, Item.CGST, Item.SGST, Item.IGST);
40
40
  }
41
41
  else {
42
42
  Item.AfterItemTax = Item.AfterItemDisc;
@@ -76,10 +76,10 @@ class SalesTotalsService {
76
76
  // let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
77
77
  let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
78
78
  let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList);
79
- finalTotalsData.SubTotal = (0, aggregation_1.addition)(CustomerAfterDiscTotals, CustItemsDiscTotal);
79
+ finalTotalsData.SubTotal = (0, math_operations_1.Add)(CustomerAfterDiscTotals, CustItemsDiscTotal);
80
80
  let CustTotal = this.GetCustomerTotalBasedOnTaxType(CustItemTaxTotal, ItemsList, IsIndependentTax);
81
81
  if (isRoundable) {
82
- finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
82
+ finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
83
83
  finalTotalsData.Total = Math.round(CustTotal);
84
84
  }
85
85
  else {
@@ -99,7 +99,7 @@ class SalesTotalsService {
99
99
  static GetItemsTotalAfterDiscount(ItemsList) {
100
100
  let ItemsTotalAfterDisc = 0;
101
101
  ItemsList.forEach((Item) => {
102
- ItemsTotalAfterDisc = (0, aggregation_1.addition)(ItemsTotalAfterDisc, Item.AfterItemDisc);
102
+ ItemsTotalAfterDisc = (0, math_operations_1.Add)(ItemsTotalAfterDisc, Item.AfterItemDisc);
103
103
  });
104
104
  return ItemsTotalAfterDisc;
105
105
  }
@@ -108,8 +108,8 @@ class SalesTotalsService {
108
108
  finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList);
109
109
  // finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
110
110
  finalTotalsData.CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
111
- finalTotalsData.CustLaborTotalBeforeDisc = (0, aggregation_1.addition)(finalTotalsData.CustLaborTotalAfterDisc, finalTotalsData.CustLaborDiscTotal);
112
- finalTotalsData.CustItemsTotalBeforeDisc = (0, aggregation_1.addition)(finalTotalsData.CustItemsTotalAfterDisc, finalTotalsData.CustItemsDiscTotal);
111
+ finalTotalsData.CustLaborTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustLaborTotalAfterDisc, finalTotalsData.CustLaborDiscTotal);
112
+ finalTotalsData.CustItemsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustItemsTotalAfterDisc, finalTotalsData.CustItemsDiscTotal);
113
113
  // finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
114
114
  // finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
115
115
  // finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
@@ -120,7 +120,7 @@ class SalesTotalsService {
120
120
  finalTotalsData.CustItemIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
121
121
  finalTotalsData.CustItemSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
122
122
  // finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
123
- finalTotalsData.CustItemAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
123
+ finalTotalsData.CustItemAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
124
124
  finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
125
125
  finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
126
126
  finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
@@ -137,14 +137,14 @@ class SalesTotalsService {
137
137
  static GetLaborDiscountedTotal(LaborList) {
138
138
  let LaborDiscountedTotal = 0;
139
139
  LaborList.forEach((Labor) => {
140
- LaborDiscountedTotal = (0, aggregation_1.addition)(LaborDiscountedTotal, Labor.DiscountedPrice);
140
+ LaborDiscountedTotal = (0, math_operations_1.Add)(LaborDiscountedTotal, Labor.DiscountedPrice);
141
141
  });
142
142
  return LaborDiscountedTotal;
143
143
  }
144
144
  static GetItemDiscountedTotal(ItemsList) {
145
145
  let ItemsDiscountedTotal = 0;
146
146
  ItemsList.forEach((Item) => {
147
- ItemsDiscountedTotal = (0, aggregation_1.addition)(ItemsDiscountedTotal, Item.DiscountedPrice);
147
+ ItemsDiscountedTotal = (0, math_operations_1.Add)(ItemsDiscountedTotal, Item.DiscountedPrice);
148
148
  });
149
149
  return ItemsDiscountedTotal;
150
150
  }
@@ -152,7 +152,7 @@ class SalesTotalsService {
152
152
  let TotalTaxAmt = 0;
153
153
  if (IsIndependentTax) {
154
154
  ItemsList.forEach((Item) => {
155
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
155
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
156
156
  });
157
157
  }
158
158
  return TotalTaxAmt;
@@ -161,32 +161,32 @@ class SalesTotalsService {
161
161
  // let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
162
162
  let ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
163
163
  if (IsIndependentTax) {
164
- return (0, aggregation_1.addition)(ItemsTotalAfterDisc, ItemsTaxAmount);
164
+ return (0, math_operations_1.Add)(ItemsTotalAfterDisc, ItemsTaxAmount);
165
165
  }
166
166
  else {
167
167
  return ItemsTotalAfterDisc;
168
168
  }
169
169
  }
170
170
  static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
171
- let LaborTotal = (0, aggregation_1.addition)(LaborTotalAfterDisc, LaborTaxAmount);
171
+ let LaborTotal = (0, math_operations_1.Add)(LaborTotalAfterDisc, LaborTaxAmount);
172
172
  if (!tr_utils_1.TrUtils.IsZero(MainLDisc)) {
173
173
  if (!tr_utils_1.TrUtils.IsEmpty(LDiscInPerc)) {
174
- LaborTotal = (0, aggregation_1.subtraction)(LaborTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(LaborTotal, Number(LDiscInPerc)), 100));
174
+ LaborTotal = (0, math_operations_1.Subtract)(LaborTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(LaborTotal, Number(LDiscInPerc)), 100));
175
175
  }
176
176
  else {
177
- LaborTotal = (0, aggregation_1.subtraction)(LaborTotal, MainLDisc);
177
+ LaborTotal = (0, math_operations_1.Subtract)(LaborTotal, MainLDisc);
178
178
  }
179
179
  }
180
180
  return LaborTotal;
181
181
  }
182
182
  static ItemsTotalAfterDiscount(ItemsTotalAfterDisc, ItemsTaxAmount, MainPDisc, PDiscInPerc) {
183
- let ItemsTotal = (0, aggregation_1.addition)(ItemsTotalAfterDisc, ItemsTaxAmount);
183
+ let ItemsTotal = (0, math_operations_1.Add)(ItemsTotalAfterDisc, ItemsTaxAmount);
184
184
  if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
185
185
  if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
186
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
186
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
187
187
  }
188
188
  else {
189
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, MainPDisc);
189
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
190
190
  }
191
191
  }
192
192
  return ItemsTotal;
@@ -195,7 +195,7 @@ class SalesTotalsService {
195
195
  let TotalTaxAmt = 0;
196
196
  if (IsIndependentTax) {
197
197
  opCodesList.forEach((Labor) => {
198
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.CGST);
198
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST);
199
199
  });
200
200
  }
201
201
  return TotalTaxAmt;
@@ -204,7 +204,7 @@ class SalesTotalsService {
204
204
  let TotalTaxAmt = 0;
205
205
  if (IsIndependentTax) {
206
206
  opCodesList.forEach((Labor) => {
207
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.IGST);
207
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.IGST);
208
208
  });
209
209
  }
210
210
  return TotalTaxAmt;
@@ -213,7 +213,7 @@ class SalesTotalsService {
213
213
  let TotalTaxAmt = 0;
214
214
  if (IsIndependentTax) {
215
215
  opCodesList.forEach((Labor) => {
216
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.SGST);
216
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.SGST);
217
217
  });
218
218
  }
219
219
  return TotalTaxAmt;
@@ -225,10 +225,10 @@ class SalesTotalsService {
225
225
  let TotalTaxAmt = 0;
226
226
  if (IsIndependentTax) {
227
227
  ItemsList.forEach((Item) => {
228
- TotalCGSTAmt = (0, aggregation_1.addition)(TotalCGSTAmt, Item.CGST);
229
- TotalSGSTAmt = (0, aggregation_1.addition)(TotalSGSTAmt, Item.SGST);
230
- TotalIGSTAmt = (0, aggregation_1.addition)(TotalIGSTAmt, Item.IGST);
231
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
228
+ TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Item.CGST);
229
+ TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Item.SGST);
230
+ TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Item.IGST);
231
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
232
232
  });
233
233
  }
234
234
  return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
@@ -248,7 +248,7 @@ class SalesTotalsService {
248
248
  Item.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
249
249
  Item.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
250
250
  Item.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
251
- Item.CombinedTaxPercentage = (0, aggregation_1.addition)(Item.CGSTAmt, Item.SGSTAmt, Item.IGSTAmt);
251
+ Item.CombinedTaxPercentage = (0, math_operations_1.Add)(Item.CGSTAmt, Item.SGSTAmt, Item.IGSTAmt);
252
252
  });
253
253
  return Items;
254
254
  }
@@ -292,10 +292,10 @@ class SalesTotalsService {
292
292
  let HSN = MatchedItem[0].HSN;
293
293
  TaxInfo.CombinedTaxPercentage = MatchedItem[0].CombinedTaxPercentage;
294
294
  MatchedItem.forEach((argMatchedGSTItem) => {
295
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, argMatchedGSTItem.AfterItemDisc);
296
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.CGST);
297
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.IGST);
298
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
295
+ TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, argMatchedGSTItem.AfterItemDisc);
296
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.CGST);
297
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.IGST);
298
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.SGST);
299
299
  });
300
300
  TaxInfo.HSN = HSN;
301
301
  TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SalesReceivePrintService = void 0;
4
- const aggregation_1 = require("../aggregation/aggregation");
5
4
  const code_enums_1 = require("../enums/code-enums");
6
5
  const enums_1 = require("../enums/enums");
6
+ const math_operations_1 = require("../shared/math-operations");
7
7
  const shared_print_service_1 = require("../shared/shared-print.service");
8
8
  const my_date_1 = require("../utils/my-date");
9
9
  const tr_utils_1 = require("../utils/tr-utils");
@@ -34,7 +34,7 @@ class SalesReceivePrintService {
34
34
  if (ConsolidateGST) {
35
35
  // finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
36
36
  // finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
37
- finalTotalsData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(finalTotalsData.totalTaxOnItems, (0, aggregation_1.subtraction)(finalTotalsData.subtotalOnItems, finalTotalsData.totalDiscountOnItems));
37
+ finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.totalTaxOnItems, (0, math_operations_1.Subtract)(finalTotalsData.subtotalOnItems, finalTotalsData.totalDiscountOnItems));
38
38
  }
39
39
  SalesReceivePrintData = tr_utils_1.TrUtils.ConcatObjects(SalesReceivePrintData, finalTotalsData);
40
40
  SalesReceivePrintData.Items = this.GetItemsPrintInfo(SalesReceivePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, IsTaxable, SalesReceivePrintData.Entity.DecimalsNumber);
@@ -72,12 +72,12 @@ class SalesReceivePrintService {
72
72
  static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, IsTaxable, DecimalsNumber) {
73
73
  Items.forEach((Item) => {
74
74
  if (Consolidate) {
75
- let AfterPartDisc = (0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc, Item.RecDisc);
76
- let AfterDiscForEach = (0, aggregation_1.division)(AfterPartDisc, Item.Qty);
77
- let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
78
- let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
79
- let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
80
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
75
+ let AfterPartDisc = (0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc, Item.RecDisc);
76
+ let AfterDiscForEach = (0, math_operations_1.Divide)(AfterPartDisc, Item.Qty);
77
+ let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
78
+ let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
79
+ let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
80
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
81
81
  }
82
82
  else {
83
83
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -90,7 +90,7 @@ class SalesReceivePrintService {
90
90
  Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
91
91
  // Calculate amount after tax based on tax type
92
92
  if (IsTaxable) {
93
- Item.AfterPartTax = (0, aggregation_1.addition)(Item.AfterPartDisc, Item.CGST, Item.SGST, Item.IGST);
93
+ Item.AfterPartTax = (0, math_operations_1.Add)(Item.AfterPartDisc, Item.CGST, Item.SGST, Item.IGST);
94
94
  }
95
95
  else {
96
96
  Item.AfterPartTax = Item.AfterPartDisc;
@@ -99,7 +99,7 @@ class SalesReceivePrintService {
99
99
  Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
100
100
  }
101
101
  else {
102
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
102
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
103
103
  }
104
104
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
105
105
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -116,7 +116,7 @@ export declare class SalesReceiveTotalsService {
116
116
  * @param finalTotalsData - Existing totals data
117
117
  * @returns Total discounted amount including overall part discount
118
118
  */
119
- static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
119
+ static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): number;
120
120
  /**
121
121
  * Calculates total tax amount for all parts
122
122
  * @param PartsList - Array of parts
@@ -134,7 +134,7 @@ export declare class SalesReceiveTotalsService {
134
134
  * @param IsIndependentTax - Whether tax is calculated independently
135
135
  * @returns Final customer total based on tax type
136
136
  */
137
- static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): any;
137
+ static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): number;
138
138
  /**
139
139
  * Calculates items total after applying discounts (percentage or fixed)
140
140
  * @param PartsTotalAfterDisc - Parts total after discount
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SalesReceiveTotalsService = void 0;
4
+ const math_operations_1 = require("../shared/math-operations");
4
5
  const tr_utils_1 = require("../utils/tr-utils");
5
- const aggregation_1 = require("../aggregation/aggregation");
6
6
  /**
7
7
  * Service class for calculating sales receive totals including taxes, discounts and final amounts
8
8
  */
@@ -64,12 +64,12 @@ class SalesReceiveTotalsService {
64
64
  Part.Qty = 1;
65
65
  }
66
66
  // Calculate total discounted price
67
- Part.DiscountedPrice = (0, aggregation_1.addition)(Part.Disc, Part.RecDisc);
67
+ Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, Part.RecDisc);
68
68
  // Calculate amount after discount
69
- Part.AfterPartDisc = (0, aggregation_1.subtraction)(Part.UnAmt, Part.Disc, Part.RecDisc);
69
+ Part.AfterPartDisc = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
70
70
  // Calculate amount after tax based on tax type
71
71
  if (IsIndependentTax) {
72
- Part.AfterPartTax = (0, aggregation_1.addition)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
72
+ Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
73
73
  }
74
74
  else {
75
75
  Part.AfterPartTax = Part.AfterPartDisc;
@@ -150,11 +150,11 @@ class SalesReceiveTotalsService {
150
150
  let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
151
151
  let CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
152
152
  // Calculate sum total
153
- finalTotalsData.STotal = (0, aggregation_1.addition)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
153
+ finalTotalsData.STotal = (0, math_operations_1.Add)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
154
154
  // Calculate final customer total
155
155
  let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, 0, CustPartTaxTotal, [], PartsList, IsIndependentTax);
156
156
  // Calculate rounding difference and final total
157
- finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
157
+ finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
158
158
  finalTotalsData.Total = Math.round(CustTotal);
159
159
  // Add detailed information if requested
160
160
  if (DetailedInfo) {
@@ -181,7 +181,7 @@ class SalesReceiveTotalsService {
181
181
  static GetPartsTotalAfterDiscount(PartsList) {
182
182
  let PartsTotalAfterDisc = 0;
183
183
  PartsList.forEach((Part) => {
184
- PartsTotalAfterDisc = (0, aggregation_1.addition)(PartsTotalAfterDisc, Part.AfterPartDisc);
184
+ PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
185
185
  });
186
186
  return PartsTotalAfterDisc;
187
187
  }
@@ -199,7 +199,7 @@ class SalesReceiveTotalsService {
199
199
  // Add parts discount and total information
200
200
  finalTotalsData.CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
201
201
  finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
202
- finalTotalsData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
202
+ finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
203
203
  // Get GST tax breakdown
204
204
  let TaxInfo = this.GetPartGSTTaxTotal(PartsList, IsIndependentTax);
205
205
  finalTotalsData.CustPartITax = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[3]);
@@ -207,7 +207,7 @@ class SalesReceiveTotalsService {
207
207
  finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
208
208
  finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
209
209
  // Calculate after tax amount
210
- finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
210
+ finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
211
211
  // Add tax grouping information
212
212
  finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
213
213
  finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
@@ -289,9 +289,9 @@ class SalesReceiveTotalsService {
289
289
  }
290
290
  // Sum up individual part discounts
291
291
  PartsList.forEach((Part) => {
292
- PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.DiscountedPrice);
292
+ PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
293
293
  });
294
- return (0, aggregation_1.addition)(PartsDiscountedTotal, overallPartDisc);
294
+ return (0, math_operations_1.Add)(PartsDiscountedTotal, overallPartDisc);
295
295
  }
296
296
  /**
297
297
  * Calculates total tax amount for all parts
@@ -303,7 +303,7 @@ class SalesReceiveTotalsService {
303
303
  let TotalTaxAmt = 0;
304
304
  if (IsIndependentTax) {
305
305
  PartsList.forEach((Part) => {
306
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
306
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
307
307
  });
308
308
  }
309
309
  return TotalTaxAmt;
@@ -322,11 +322,11 @@ class SalesReceiveTotalsService {
322
322
  let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
323
323
  if (IsIndependentTax) {
324
324
  // Add tax amounts to the total
325
- return (0, aggregation_1.addition)(PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
325
+ return (0, math_operations_1.Add)(PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
326
326
  }
327
327
  else {
328
328
  // Subtract discount from the total
329
- return (0, aggregation_1.subtraction)(PartsTotalAfterDisc, finalTotalsData.Disc);
329
+ return (0, math_operations_1.Subtract)(PartsTotalAfterDisc, finalTotalsData.Disc);
330
330
  }
331
331
  }
332
332
  /**
@@ -338,16 +338,16 @@ class SalesReceiveTotalsService {
338
338
  * @returns Final items total after all discounts
339
339
  */
340
340
  static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
341
- let ItemsTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
341
+ let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
342
342
  // Apply discount if present
343
343
  if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
344
344
  if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
345
345
  // Apply percentage discount
346
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
346
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
347
347
  }
348
348
  else {
349
349
  // Apply fixed discount
350
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, MainPDisc);
350
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
351
351
  }
352
352
  }
353
353
  return ItemsTotal;
@@ -362,7 +362,7 @@ class SalesReceiveTotalsService {
362
362
  let TotalTaxAmt = 0;
363
363
  if (IsIndependentTax) {
364
364
  opCodesList.forEach((Labor) => {
365
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.CGST);
365
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST);
366
366
  });
367
367
  }
368
368
  return TotalTaxAmt;
@@ -377,7 +377,7 @@ class SalesReceiveTotalsService {
377
377
  let TotalTaxAmt = 0;
378
378
  if (IsIndependentTax) {
379
379
  opCodesList.forEach((Labor) => {
380
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.IGST);
380
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.IGST);
381
381
  });
382
382
  }
383
383
  return TotalTaxAmt;
@@ -392,7 +392,7 @@ class SalesReceiveTotalsService {
392
392
  let TotalTaxAmt = 0;
393
393
  if (IsIndependentTax) {
394
394
  opCodesList.forEach((Labor) => {
395
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.SGST);
395
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.SGST);
396
396
  });
397
397
  }
398
398
  return TotalTaxAmt;
@@ -410,10 +410,10 @@ class SalesReceiveTotalsService {
410
410
  let TotalTaxAmt = 0;
411
411
  if (IsIndependentTax) {
412
412
  PartsList.forEach((Part) => {
413
- TotalCGSTAmt = (0, aggregation_1.addition)(TotalCGSTAmt, Part.CGST);
414
- TotalIGSTAmt = (0, aggregation_1.addition)(TotalIGSTAmt, Part.IGST);
415
- TotalSGSTAmt = (0, aggregation_1.addition)(TotalSGSTAmt, Part.SGST);
416
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
413
+ TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
414
+ TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
415
+ TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
416
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
417
417
  });
418
418
  }
419
419
  return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
@@ -451,7 +451,7 @@ class SalesReceiveTotalsService {
451
451
  Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
452
452
  Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
453
453
  // Calculate combined tax percentage
454
- Part.CombinedTaxPercentage = (0, aggregation_1.addition)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
454
+ Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
455
455
  });
456
456
  return Parts;
457
457
  }
@@ -509,13 +509,13 @@ class SalesReceiveTotalsService {
509
509
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
510
510
  // Calculate totals for all parts in this HSN group
511
511
  MatchedPart.forEach((argMatchedGSTPart) => {
512
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
513
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
514
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
515
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
516
- CGSTAmt = (0, aggregation_1.addition)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
517
- SGSTAmt = (0, aggregation_1.addition)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
518
- IGSTAmt = (0, aggregation_1.addition)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
512
+ TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
513
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
514
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
515
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
516
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
517
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
518
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
519
519
  });
520
520
  // Build tax information object
521
521
  TaxInfo.HSN = HSN;
@@ -181,7 +181,7 @@ function CalculateTaxSummary(items, taxCodes) {
181
181
  const tax = taxMap[item.TCode];
182
182
  if (!tax)
183
183
  return acc;
184
- const percent = (tax.IGST || (tax.CGST || 0) + (tax.SGST || 0)) + "%";
184
+ const percent = (((tax.IGST || 0) + (tax.CGST || 0) + (tax.SGST || 0)) + "%");
185
185
  // taxable value after discounts
186
186
  const taxable = (0, math_operations_1.Subtract)((0, util_1.GetNumber)(item.UnAmt), (0, math_operations_1.Add)((0, util_1.GetNumber)(item.Disc), (0, util_1.GetNumber)(item.RecDisc)));
187
187
  if (!acc[percent]) {
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EstPrintService = void 0;
4
- const aggregation_1 = require("../aggregation/aggregation");
5
4
  const code_enums_1 = require("../enums/code-enums");
6
5
  const enums_1 = require("../enums/enums");
6
+ const math_operations_1 = require("../shared/math-operations");
7
7
  const shared_print_service_1 = require("../shared/shared-print.service");
8
8
  const my_date_1 = require("../utils/my-date");
9
9
  const tr_utils_1 = require("../utils/tr-utils");
@@ -913,7 +913,7 @@ class EstPrintService {
913
913
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.EstPr, DecimalsNumber);
914
914
  }
915
915
  else {
916
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.division)(Item.NetAmt, Item.Qty), DecimalsNumber);
916
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Divide)(Item.NetAmt, Item.Qty), DecimalsNumber);
917
917
  }
918
918
  });
919
919
  return Items;
@@ -931,19 +931,19 @@ class EstPrintService {
931
931
  }
932
932
  static GetLaborCombinedPrintInfo(LaborList, DecimalsNumber) {
933
933
  LaborList.forEach((Labor) => {
934
- Labor.AssPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(Labor.AssPr, Labor.NetAmt), DecimalsNumber);
934
+ Labor.AssPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(Labor.AssPr, Labor.NetAmt), DecimalsNumber);
935
935
  });
936
936
  return LaborList;
937
937
  }
938
938
  static GetItemsCombinedPrintInfo(Items, DecimalsNumber) {
939
939
  Items.forEach((Item) => {
940
- Item.AssPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.division)((0, aggregation_1.addition)(Item.AssAmt, Item.NetAmt), Item.Qty), DecimalsNumber);
940
+ Item.AssPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Divide)((0, math_operations_1.Add)(Item.AssAmt, Item.NetAmt), Item.Qty), DecimalsNumber);
941
941
  });
942
942
  return Items;
943
943
  }
944
944
  static GetSplitInfoForParts(Items, DecimalsNumber) {
945
945
  Items.forEach((Item) => {
946
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.division)(Item.NetAmt, Item.Qty), DecimalsNumber);
946
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Divide)(Item.NetAmt, Item.Qty), DecimalsNumber);
947
947
  });
948
948
  return Items;
949
949
  }