shareneus 1.5.2 → 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 (47) 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/services/est.print-service.js +5 -5
  42. package/dist/services/ro-print-service.js +13 -13
  43. package/dist/services/ro-totals.service.d.ts +4 -4
  44. package/dist/services/ro-totals.service.js +140 -140
  45. package/dist/shared/math-operations.js +46 -41
  46. package/dist/shared/shared-pdf.service.js +8 -8
  47. package/package.json +1 -1
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SaleReceiptPrintService = 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");
7
6
  const math_operations_1 = require("../../shared/math-operations");
@@ -164,7 +163,7 @@ class SaleReceiptPrintService {
164
163
  Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax, DecimalsNumber);
165
164
  }
166
165
  else {
167
- Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Labor.Amt, Labor.Disc), DecimalsNumber);
166
+ Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Labor.Amt, Labor.Disc), DecimalsNumber);
168
167
  }
169
168
  });
170
169
  return LaborList;
@@ -173,11 +172,11 @@ class SaleReceiptPrintService {
173
172
  Items.forEach((Item) => {
174
173
  var _a;
175
174
  if (Consolidate) {
176
- let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
177
- let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
178
- let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
179
- let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
180
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
175
+ let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
176
+ let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
177
+ let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
178
+ let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
179
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
181
180
  }
182
181
  else {
183
182
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -202,7 +201,7 @@ class SaleReceiptPrintService {
202
201
  Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
203
202
  }
204
203
  else {
205
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
204
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
206
205
  }
207
206
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
208
207
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -410,7 +409,7 @@ class SaleReceiptPrintService {
410
409
  Data.Due = 0;
411
410
  }
412
411
  else {
413
- Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
412
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
414
413
  }
415
414
  if (Data.Due < 0) {
416
415
  Data.Due = 0;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CNPrintService = 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");
@@ -67,11 +67,11 @@ class CNPrintService {
67
67
  static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
68
68
  Items.forEach((Item) => {
69
69
  if (Consolidate) {
70
- let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
71
- let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
72
- let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
73
- let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
74
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
70
+ let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
71
+ let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
72
+ let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
73
+ let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
74
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
75
75
  }
76
76
  else {
77
77
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -86,7 +86,7 @@ class CNPrintService {
86
86
  Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
87
87
  }
88
88
  else {
89
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
89
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
90
90
  }
91
91
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
92
92
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -11,9 +11,9 @@ export declare class CreditNoteTotalsService {
11
11
  static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
12
12
  static GetTaxGroupingForPartsByPerc(Parts: any, TaxCodes: any, DecimalsNumber: any): any[];
13
13
  static ComparePartsByPerc(Parts: any, TaxCodes: any): any[];
14
- static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
14
+ static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): number;
15
15
  static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
16
- static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): any;
16
+ static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): number;
17
17
  static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
18
18
  static GetLaborCGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
19
19
  static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CreditNoteTotalsService = 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
  class CreditNoteTotalsService {
7
7
  static GetTotalsValue(opCodesList, PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings = {}) {
8
8
  // LPerc = TrUtils.SetPercToStringIfNull(LPerc);
@@ -33,11 +33,11 @@ class CreditNoteTotalsService {
33
33
  if (tr_utils_1.TrUtils.IsZero(Part.Qty)) {
34
34
  Part.Qty = 1;
35
35
  }
36
- Part.DiscountedPrice = (0, aggregation_1.addition)(Part.Disc, Part.RecDisc);
36
+ Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, Part.RecDisc);
37
37
  // Part.AfterPartDisc = Part.NetAmt;
38
- Part.AfterPartDisc = (0, aggregation_1.subtraction)(Part.UnAmt, Part.Disc, Part.RecDisc);
38
+ Part.AfterPartDisc = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
39
39
  if (IsIndependentTax) {
40
- Part.AfterPartTax = (0, aggregation_1.addition)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
40
+ Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
41
41
  }
42
42
  else {
43
43
  Part.AfterPartTax = Part.AfterPartDisc;
@@ -84,9 +84,9 @@ class CreditNoteTotalsService {
84
84
  let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
85
85
  // let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
86
86
  let CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
87
- finalTotalsData.STotal = (0, aggregation_1.addition)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
87
+ finalTotalsData.STotal = (0, math_operations_1.Add)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
88
88
  let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, 0, CustPartTaxTotal, [], PartsList, IsIndependentTax);
89
- finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
89
+ finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
90
90
  finalTotalsData.Total = Math.round(CustTotal);
91
91
  if (DetailedInfo) {
92
92
  finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
@@ -102,7 +102,7 @@ class CreditNoteTotalsService {
102
102
  static GetPartsTotalAfterDiscount(PartsList) {
103
103
  let PartsTotalAfterDisc = 0;
104
104
  PartsList.forEach((Part) => {
105
- PartsTotalAfterDisc = (0, aggregation_1.addition)(PartsTotalAfterDisc, Part.AfterPartDisc);
105
+ PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
106
106
  });
107
107
  return PartsTotalAfterDisc;
108
108
  }
@@ -113,7 +113,7 @@ class CreditNoteTotalsService {
113
113
  finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
114
114
  // finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
115
115
  // + finalTotalsData.CustLaborDiscTotal);
116
- finalTotalsData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
116
+ finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
117
117
  // finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
118
118
  // finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
119
119
  // finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
@@ -123,8 +123,8 @@ class CreditNoteTotalsService {
123
123
  finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
124
124
  finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
125
125
  finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
126
- // finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
127
- finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
126
+ // finalTotalsData.CustLaborAfterTax = Add(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
127
+ finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
128
128
  finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
129
129
  finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
130
130
  finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
@@ -183,15 +183,15 @@ class CreditNoteTotalsService {
183
183
  overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
184
184
  }
185
185
  PartsList.forEach((Part) => {
186
- PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.DiscountedPrice);
186
+ PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
187
187
  });
188
- return (0, aggregation_1.addition)(PartsDiscountedTotal, overallPartDisc);
188
+ return (0, math_operations_1.Add)(PartsDiscountedTotal, overallPartDisc);
189
189
  }
190
190
  static GetPartsTaxTotalFor(PartsList, IsIndependentTax) {
191
191
  let TotalTaxAmt = 0;
192
192
  if (IsIndependentTax) {
193
193
  PartsList.forEach((Part) => {
194
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
194
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
195
195
  });
196
196
  }
197
197
  return TotalTaxAmt;
@@ -200,20 +200,20 @@ class CreditNoteTotalsService {
200
200
  // let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
201
201
  let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
202
202
  if (IsIndependentTax) {
203
- return (0, aggregation_1.addition)(PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
203
+ return (0, math_operations_1.Add)(PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
204
204
  }
205
205
  else {
206
- return (0, aggregation_1.subtraction)(PartsTotalAfterDisc, finalTotalsData.Disc);
206
+ return (0, math_operations_1.Subtract)(PartsTotalAfterDisc, finalTotalsData.Disc);
207
207
  }
208
208
  }
209
209
  static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
210
- let ItemsTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
210
+ let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
211
211
  if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
212
212
  if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
213
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
213
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
214
214
  }
215
215
  else {
216
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, MainPDisc);
216
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
217
217
  }
218
218
  }
219
219
  return ItemsTotal;
@@ -222,7 +222,7 @@ class CreditNoteTotalsService {
222
222
  let TotalTaxAmt = 0;
223
223
  if (IsIndependentTax) {
224
224
  opCodesList.forEach((Labor) => {
225
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.CGST);
225
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST);
226
226
  });
227
227
  }
228
228
  return TotalTaxAmt;
@@ -231,7 +231,7 @@ class CreditNoteTotalsService {
231
231
  let TotalTaxAmt = 0;
232
232
  if (IsIndependentTax) {
233
233
  opCodesList.forEach((Labor) => {
234
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.IGST);
234
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.IGST);
235
235
  });
236
236
  }
237
237
  return TotalTaxAmt;
@@ -240,7 +240,7 @@ class CreditNoteTotalsService {
240
240
  let TotalTaxAmt = 0;
241
241
  if (IsIndependentTax) {
242
242
  opCodesList.forEach((Labor) => {
243
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.SGST);
243
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.SGST);
244
244
  });
245
245
  }
246
246
  return TotalTaxAmt;
@@ -252,10 +252,10 @@ class CreditNoteTotalsService {
252
252
  let TotalTaxAmt = 0;
253
253
  if (IsIndependentTax) {
254
254
  PartsList.forEach((Part) => {
255
- TotalCGSTAmt = (0, aggregation_1.addition)(TotalCGSTAmt, Part.CGST);
256
- TotalIGSTAmt = (0, aggregation_1.addition)(TotalIGSTAmt, Part.IGST);
257
- TotalSGSTAmt = (0, aggregation_1.addition)(TotalSGSTAmt, Part.SGST);
258
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
255
+ TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
256
+ TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
257
+ TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
258
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
259
259
  });
260
260
  }
261
261
  return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
@@ -275,7 +275,7 @@ class CreditNoteTotalsService {
275
275
  Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
276
276
  Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
277
277
  Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
278
- Part.CombinedTaxPercentage = (0, aggregation_1.addition)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
278
+ Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
279
279
  });
280
280
  return Parts;
281
281
  }
@@ -322,13 +322,13 @@ class CreditNoteTotalsService {
322
322
  let HSN = MatchedPart[0].HSN;
323
323
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
324
324
  MatchedPart.forEach((argMatchedGSTPart) => {
325
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
326
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
327
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
328
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
329
- CGSTAmt = (0, aggregation_1.addition)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
330
- SGSTAmt = (0, aggregation_1.addition)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
331
- IGSTAmt = (0, aggregation_1.addition)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
325
+ TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
326
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
327
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
328
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
329
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
330
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
331
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
332
332
  });
333
333
  TaxInfo.HSN = HSN;
334
334
  TaxInfo.CGSTAmt = CGSTAmt;
@@ -7,7 +7,7 @@ const code_enums_1 = require("../../enums/code-enums");
7
7
  const tr_utils_1 = require("../../utils/tr-utils");
8
8
  const enums_1 = require("../../enums/enums");
9
9
  const my_date_1 = require("../../utils/my-date");
10
- const aggregation_1 = require("../../aggregation/aggregation");
10
+ const math_operations_1 = require("../../shared/math-operations");
11
11
  class DebitNotePrintService {
12
12
  static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, IsCustBillTo) {
13
13
  var _a, _b, _c, _d;
@@ -93,11 +93,11 @@ class DebitNotePrintService {
93
93
  static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
94
94
  Items.forEach((Item) => {
95
95
  if (Consolidate) {
96
- let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
97
- let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
98
- let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
99
- let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
100
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
96
+ let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
97
+ let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
98
+ let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
99
+ let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
100
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
101
101
  }
102
102
  else {
103
103
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -112,7 +112,7 @@ class DebitNotePrintService {
112
112
  Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
113
113
  }
114
114
  else {
115
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
115
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
116
116
  }
117
117
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
118
118
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -220,7 +220,7 @@ class DebitNotePrintService {
220
220
  Data.Due = 0;
221
221
  }
222
222
  else {
223
- Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
223
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
224
224
  }
225
225
  if (Data.Due < 0) {
226
226
  Data.Due = 0;
@@ -9,9 +9,9 @@ export declare class DebitNoteTotalsService {
9
9
  static GetSubTotalFor(PartsList: any): any;
10
10
  static GetPartsTotalAfterDiscount(PartsList: any): any;
11
11
  static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
12
- static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
12
+ static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): number;
13
13
  static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
14
- static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, PartsTaxAmount: number, PartsList: any, IsIndependentTax: boolean): any;
14
+ static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, PartsTaxAmount: number, PartsList: any, IsIndependentTax: boolean): number;
15
15
  static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
16
16
  static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
17
17
  static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DebitNoteTotalsService = 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 DebitNoteTotalsService {
7
7
  static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
@@ -33,11 +33,11 @@ class DebitNoteTotalsService {
33
33
  static ResetLaborPartValues(PartsList, IsIndependentTax) {
34
34
  PartsList.forEach((Part) => {
35
35
  Part = this.ResetLaborPartValueIfInvalid(Part);
36
- Part.DiscountedPrice = (0, aggregation_1.addition)(Part.Disc, Part.RecDisc);
36
+ Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, Part.RecDisc);
37
37
  // Part.AfterPartDisc = Part.NetAmt;
38
- Part.AfterPartDisc = (0, aggregation_1.subtraction)(Part.UnAmt, Part.Disc, Part.RecDisc);
38
+ Part.AfterPartDisc = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
39
39
  if (IsIndependentTax) {
40
- Part.AfterPartTax = (0, aggregation_1.addition)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
40
+ Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
41
41
  }
42
42
  else {
43
43
  Part.AfterPartTax = Part.AfterPartDisc;
@@ -84,9 +84,9 @@ class DebitNoteTotalsService {
84
84
  let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
85
85
  // let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
86
86
  let CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
87
- finalTotalsData.STotal = (0, aggregation_1.addition)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
87
+ finalTotalsData.STotal = (0, math_operations_1.Add)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
88
88
  let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustPartTaxTotal, PartsList, IsIndependentTax);
89
- finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
89
+ finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
90
90
  finalTotalsData.Total = Math.round(CustTotal);
91
91
  if (DetailedInfo) {
92
92
  finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
@@ -102,7 +102,7 @@ class DebitNoteTotalsService {
102
102
  static GetPartsTotalAfterDiscount(PartsList) {
103
103
  let PartsTotalAfterDisc = 0;
104
104
  PartsList.forEach((Part) => {
105
- PartsTotalAfterDisc = (0, aggregation_1.addition)(PartsTotalAfterDisc, Part.AfterPartDisc);
105
+ PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
106
106
  });
107
107
  return PartsTotalAfterDisc;
108
108
  }
@@ -113,7 +113,7 @@ class DebitNoteTotalsService {
113
113
  finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
114
114
  // finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
115
115
  // + finalTotalsData.CustLaborDiscTotal);
116
- finalTotalsData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
116
+ finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
117
117
  // finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
118
118
  // finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
119
119
  // finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
@@ -123,8 +123,8 @@ class DebitNoteTotalsService {
123
123
  finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
124
124
  finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
125
125
  finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
126
- // finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
127
- finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
126
+ // finalTotalsData.CustLaborAfterTax = Add(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
127
+ finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
128
128
  finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
129
129
  finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
130
130
  finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
@@ -145,15 +145,15 @@ class DebitNoteTotalsService {
145
145
  overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
146
146
  }
147
147
  PartsList.forEach((Part) => {
148
- PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.DiscountedPrice);
148
+ PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
149
149
  });
150
- return (0, aggregation_1.addition)(PartsDiscountedTotal, overallPartDisc);
150
+ return (0, math_operations_1.Add)(PartsDiscountedTotal, overallPartDisc);
151
151
  }
152
152
  static GetPartsTaxTotalFor(PartsList, IsIndependentTax) {
153
153
  let TotalTaxAmt = 0;
154
154
  if (IsIndependentTax) {
155
155
  PartsList.forEach((Part) => {
156
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
156
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
157
157
  });
158
158
  }
159
159
  return TotalTaxAmt;
@@ -162,20 +162,20 @@ class DebitNoteTotalsService {
162
162
  // let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
163
163
  let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
164
164
  if (IsIndependentTax) {
165
- return (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
165
+ return (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
166
166
  }
167
167
  else {
168
- return (0, aggregation_1.subtraction)(PartsTotalAfterDisc, finalTotalsData.Disc);
168
+ return (0, math_operations_1.Subtract)(PartsTotalAfterDisc, finalTotalsData.Disc);
169
169
  }
170
170
  }
171
171
  static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
172
- let ItemsTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
172
+ let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
173
173
  if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
174
174
  if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
175
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
175
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
176
176
  }
177
177
  else {
178
- ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, MainPDisc);
178
+ ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
179
179
  }
180
180
  }
181
181
  return ItemsTotal;
@@ -187,10 +187,10 @@ class DebitNoteTotalsService {
187
187
  let TotalTaxAmt = 0;
188
188
  if (IsIndependentTax) {
189
189
  PartsList.forEach((Part) => {
190
- TotalCGSTAmt = (0, aggregation_1.addition)(TotalCGSTAmt, Part.CGST);
191
- TotalSGSTAmt = (0, aggregation_1.addition)(TotalSGSTAmt, Part.SGST);
192
- TotalIGSTAmt = (0, aggregation_1.addition)(TotalIGSTAmt, Part.IGST);
193
- TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
190
+ TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
191
+ TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
192
+ TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
193
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
194
194
  });
195
195
  }
196
196
  return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
@@ -210,7 +210,7 @@ class DebitNoteTotalsService {
210
210
  Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
211
211
  Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
212
212
  Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
213
- Part.CombinedTaxPercentage = (0, aggregation_1.addition)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
213
+ Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
214
214
  });
215
215
  return Parts;
216
216
  }
@@ -246,10 +246,10 @@ class DebitNoteTotalsService {
246
246
  let HSN = MatchedPart[0].HSN;
247
247
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
248
248
  MatchedPart.forEach((argMatchedGSTPart) => {
249
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, argMatchedGSTPart.AfterPartDisc);
250
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.CGST);
251
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.IGST);
252
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
249
+ TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, argMatchedGSTPart.AfterPartDisc);
250
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTPart.CGST);
251
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTPart.IGST);
252
+ TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTPart.SGST);
253
253
  });
254
254
  TaxInfo.HSN = HSN;
255
255
  TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoiceprintService = void 0;
4
- const aggregation_1 = require("../../aggregation/aggregation");
4
+ const math_operations_1 = require("../../shared/math-operations");
5
5
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
6
6
  const shared_print_service_1 = require("../../shared/shared-print.service");
7
7
  const my_date_1 = require("../../utils/my-date");
@@ -194,12 +194,12 @@ class InvoiceprintService {
194
194
  let FinalTotal = 0;
195
195
  Parts.forEach((part) => {
196
196
  // console.log('part', part);
197
- Qty = (0, aggregation_1.addition)(Qty, tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber));
198
- CGSTAMT = (0, aggregation_1.addition)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
199
- SGSTAMT = (0, aggregation_1.addition)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
200
- IGSTAMT = (0, aggregation_1.addition)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
201
- Taxable = (0, aggregation_1.addition)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
202
- FinalTotal = (0, aggregation_1.addition)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
197
+ Qty = (0, math_operations_1.Add)(Qty, tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber));
198
+ CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
199
+ SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
200
+ IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
201
+ Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
202
+ FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
203
203
  });
204
204
  let dpartadding1 = {};
205
205
  dpartadding1.SNo = '';
@@ -313,11 +313,11 @@ class InvoiceprintService {
313
313
  Labor.forEach((operation) => {
314
314
  // console.log('operation', operation);
315
315
  // Qty = Qty + operation.Qty;
316
- CGSTAMT = (0, aggregation_1.addition)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
317
- SGSTAMT = (0, aggregation_1.addition)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
318
- IGSTAMT = (0, aggregation_1.addition)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
319
- Taxable = (0, aggregation_1.addition)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
320
- FinalTotal = (0, aggregation_1.addition)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
316
+ CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
317
+ SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
318
+ IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
319
+ Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
320
+ FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
321
321
  });
322
322
  let dpartadding1 = {};
323
323
  dpartadding1.SNo = '';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvPrintService = 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");
@@ -214,7 +214,7 @@ class InvPrintService {
214
214
  else {
215
215
  Labor.DiscPerc = Labor.Perc;
216
216
  if (!tr_utils_1.TrUtils.IsZero(Number(Labor.UnPr))) {
217
- Labor.DiscPerc = (0, aggregation_1.division)((0, aggregation_1.multiply)(100, Labor.Disc), Labor.UnPr);
217
+ Labor.DiscPerc = (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(100, Labor.Disc), Labor.UnPr);
218
218
  }
219
219
  else {
220
220
  Labor.DiscPerc = 0;
@@ -231,7 +231,7 @@ class InvPrintService {
231
231
  Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax, DecimalsNumber);
232
232
  }
233
233
  else {
234
- Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Labor.Amt, Labor.Disc), DecimalsNumber);
234
+ Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Labor.Amt, Labor.Disc), DecimalsNumber);
235
235
  }
236
236
  });
237
237
  return LaborList;
@@ -239,11 +239,11 @@ class InvPrintService {
239
239
  static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
240
240
  Items.forEach((Item) => {
241
241
  if (Consolidate) {
242
- let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
243
- let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
244
- let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
245
- let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
246
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
242
+ let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
243
+ let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
244
+ let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
245
+ let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
246
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
247
247
  }
248
248
  else {
249
249
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -265,7 +265,7 @@ class InvPrintService {
265
265
  else {
266
266
  Item.DiscPerc = Item.Perc;
267
267
  if (!tr_utils_1.TrUtils.IsZero(Number(Item.UnPr))) {
268
- Item.DiscPerc = (0, aggregation_1.division)((0, aggregation_1.multiply)(100, Item.Disc), Item.UnPr);
268
+ Item.DiscPerc = (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(100, Item.Disc), Item.UnPr);
269
269
  }
270
270
  else {
271
271
  Item.DiscPerc = 0;
@@ -278,7 +278,7 @@ class InvPrintService {
278
278
  Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
279
279
  }
280
280
  else {
281
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
281
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
282
282
  }
283
283
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
284
284
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -456,7 +456,7 @@ class InvPrintService {
456
456
  Data.Due = 0;
457
457
  }
458
458
  else {
459
- Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
459
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
460
460
  }
461
461
  if (Data.Due < 0) {
462
462
  Data.Due = 0;