shareneus 1.4.50 → 1.4.52

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 (87) hide show
  1. package/dist/accounting/counter-sales/auto-sales-receipt-pdf.service.js +1 -1
  2. package/dist/accounting/counter-sales/sales-receipt-pdf.service.js +1 -1
  3. package/dist/accounting/counter-sales/sales-receipt-print.service.js +1 -1
  4. package/dist/accounting/credit-note/credit-note-pdf.service.js +1 -1
  5. package/dist/accounting/debit-note/debit-note-print.service.js +1 -1
  6. package/dist/accounting/invoice/inv-pdf.service.js +13 -12
  7. package/dist/accounting/invoice/inv-print.service.js +6 -6
  8. package/dist/accounting/invoice/invoice-landscape-pdf.service.d.ts +1 -1
  9. package/dist/accounting/invoice/invoice-landscape-pdf.service.js +7 -6
  10. package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +13 -12
  11. package/dist/accounting/invoice/invoice-portrait-pdf.d.ts +5 -5
  12. package/dist/accounting/invoice/invoice-portrait-pdf.js +31 -30
  13. package/dist/accounting/invoice/invoice-total.service.js +1 -1
  14. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.d.ts +4 -4
  15. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +12 -11
  16. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.d.ts +4 -4
  17. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +12 -11
  18. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.d.ts +4 -4
  19. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +11 -10
  20. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.d.ts +4 -4
  21. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +19 -18
  22. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.d.ts +4 -4
  23. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +11 -11
  24. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.d.ts +4 -4
  25. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +11 -11
  26. package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.d.ts +3 -3
  27. package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +13 -12
  28. package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.d.ts +4 -4
  29. package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +14 -13
  30. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.d.ts +4 -4
  31. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +15 -14
  32. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.d.ts +4 -4
  33. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +15 -14
  34. package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.d.ts +4 -4
  35. package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +10 -10
  36. package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.d.ts +4 -4
  37. package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +15 -14
  38. package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.d.ts +4 -4
  39. package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +13 -12
  40. package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.d.ts +4 -4
  41. package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +14 -14
  42. package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.d.ts +4 -4
  43. package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +14 -14
  44. package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.d.ts +4 -4
  45. package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +14 -13
  46. package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.d.ts +4 -4
  47. package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +8 -8
  48. package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.d.ts +4 -4
  49. package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +12 -11
  50. package/dist/accounting/invoice/shared-inv-pdf.service.js +1 -1
  51. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.d.ts +4 -4
  52. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +9 -9
  53. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.d.ts +5 -5
  54. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +11 -11
  55. package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +3 -3
  56. package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +10 -10
  57. package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +3 -3
  58. package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +7 -7
  59. package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +1 -1
  60. package/dist/appointments/consultations/consultation-fee-receipt.service.js +4 -4
  61. package/dist/inventory/items/issue-parts-pdf.service.js +1 -1
  62. package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +2 -2
  63. package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.js +8 -7
  64. package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.d.ts +4 -4
  65. package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +9 -9
  66. package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.d.ts +4 -4
  67. package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +9 -9
  68. package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +3 -3
  69. package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +8 -8
  70. package/dist/purchases/purchase-order/purchase-order-pdf.service.js +5 -5
  71. package/dist/purchases/purchase-order/purchase-order-print.service.d.ts +2 -2
  72. package/dist/purchases/purchase-order/purchase-order-print.service.js +25 -25
  73. package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.js +1 -1
  74. package/dist/purchases/vendor-debit-note/vendor-debit-note-pdf.service.js +1 -1
  75. package/dist/sales/delivery-challan/dc-landscape-pdf.service.d.ts +1 -1
  76. package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +7 -6
  77. package/dist/sales/sales/sales-pdf.service.js +1 -1
  78. package/dist/sales/sales/sales-print.service.js +6 -6
  79. package/dist/services/reports/pdf/repair-orders-pdf.service.d.ts +4 -4
  80. package/dist/services/reports/pdf/repair-orders-pdf.service.js +9 -9
  81. package/dist/services/ro-pdf.service.js +2 -2
  82. package/dist/services/separate-wo-print.service.js +1 -1
  83. package/dist/shared/shared-pdf.service.d.ts +3 -3
  84. package/dist/shared/shared-pdf.service.js +33 -32
  85. package/dist/utils/tr-utils.d.ts +1 -1
  86. package/dist/utils/tr-utils.js +2 -2
  87. package/package.json +1 -1
@@ -452,7 +452,7 @@ class SalesReceiptprintService {
452
452
  // console.log('ROPrintData', ROPrintData);
453
453
  let CommonDetails = [
454
454
  shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, null, moreDiscDetails),
455
- shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale),
455
+ shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber),
456
456
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
457
457
  shared_pdf_service_1.SharedPDFService.GetBankDetials(ROPrintData.Entity.Bank, ROPrintData.Entity.PrBank),
458
458
  shared_pdf_service_1.SharedPDFService.GetUnderLine(),
@@ -595,7 +595,7 @@ class SalesReceiptpdfService {
595
595
  static CommonTotalDetails(ROPrintData, index, numberofCopies, moreDiscDetails) {
596
596
  let CommonDetails = [
597
597
  shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, null, moreDiscDetails),
598
- shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
598
+ shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
599
599
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
600
600
  shared_pdf_service_1.SharedPDFService.GetUnderLine(),
601
601
  shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
@@ -409,7 +409,7 @@ class SaleReceiptPrintService {
409
409
  Data.Due = 0;
410
410
  }
411
411
  else {
412
- Data.Due = tr_utils_1.TrUtils.FixedTo((Total - PaidTotal), DecimalsNumber);
412
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
413
413
  }
414
414
  if (Data.Due < 0) {
415
415
  Data.Due = 0;
@@ -564,7 +564,7 @@ class CreditNotePdfService {
564
564
  static CommonTotalDetails(ROPrintData, moreDiscDetails) {
565
565
  let CommonDetails = [
566
566
  shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(ROPrintData, 0, 0, 0, 0, 0, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, moreDiscDetails),
567
- shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
567
+ shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
568
568
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
569
569
  shared_pdf_service_1.SharedPDFService.GetUnderLine(),
570
570
  shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
@@ -220,7 +220,7 @@ class DebitNotePrintService {
220
220
  Data.Due = 0;
221
221
  }
222
222
  else {
223
- Data.Due = tr_utils_1.TrUtils.FixedTo((Total - PaidTotal), DecimalsNumber);
223
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
224
224
  }
225
225
  if (Data.Due < 0) {
226
226
  Data.Due = 0;
@@ -1,6 +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
5
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
5
6
  const shared_print_service_1 = require("../../shared/shared-print.service");
6
7
  const my_date_1 = require("../../utils/my-date");
@@ -193,12 +194,12 @@ class InvoiceprintService {
193
194
  let FinalTotal = 0;
194
195
  Parts.forEach((part) => {
195
196
  // console.log('part', part);
196
- Qty = Qty + tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber);
197
- CGSTAMT = CGSTAMT + tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber);
198
- SGSTAMT = SGSTAMT + tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber);
199
- IGSTAMT = IGSTAMT + tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber);
200
- Taxable = Taxable + tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber);
201
- FinalTotal = FinalTotal + tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber);
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));
202
203
  });
203
204
  let dpartadding1 = {};
204
205
  dpartadding1.SNo = '';
@@ -312,11 +313,11 @@ class InvoiceprintService {
312
313
  Labor.forEach((operation) => {
313
314
  // console.log('operation', operation);
314
315
  // Qty = Qty + operation.Qty;
315
- CGSTAMT = CGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber);
316
- SGSTAMT = SGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber);
317
- IGSTAMT = IGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber);
318
- Taxable = Taxable + tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber);
319
- FinalTotal = FinalTotal + tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber);
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));
320
321
  });
321
322
  let dpartadding1 = {};
322
323
  dpartadding1.SNo = '';
@@ -689,7 +690,7 @@ class InvoiceprintService {
689
690
  // ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj,ROPrintData.STotal),
690
691
  shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails1(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupDataByPerc, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, ROPrintData.CustLaborTaxGroupDataByPerc, ROPrintData.STotal, isAuto, moreDiscDetails),
691
692
  this.GetNumberInWords(ROPrintData.CustRoundedTotal),
692
- shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale),
693
+ shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber),
693
694
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
694
695
  this.GetBanckdetailswithQRCode(ROPrintData),
695
696
  shared_pdf_service_1.SharedPDFService.GetUnderLine(),
@@ -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 = Item.AfterPartDisc / Item.Qty;
243
- let CTaxAmtPerItem = Item.CGST / Item.Qty;
244
- let STaxAmtPerItem = Item.SGST / Item.Qty;
245
- let ITaxAmtPerItem = Item.IGST / Item.Qty;
246
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem), DecimalsNumber);
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);
247
247
  }
248
248
  else {
249
249
  Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
@@ -446,7 +446,7 @@ class InvPrintService {
446
446
  Data.Due = 0;
447
447
  }
448
448
  else {
449
- Data.Due = tr_utils_1.TrUtils.FixedTo((Total - PaidTotal), DecimalsNumber);
449
+ Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
450
450
  }
451
451
  if (Data.Due < 0) {
452
452
  Data.Due = 0;
@@ -399,7 +399,7 @@ export declare class InvoiceLandscapePdfService {
399
399
  text: string[];
400
400
  marginLeft: number;
401
401
  };
402
- static TotalDetails(ROPrintData: any, moreDiscDetails: boolean): {
402
+ static TotalDetails(ROPrintData: any, moreDiscDetails: boolean, DecimalsNumber: number): {
403
403
  style: string;
404
404
  marginTop: number;
405
405
  table: {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoiceLandscapePdfService = void 0;
4
+ const aggregation_1 = require("../../aggregation/aggregation");
4
5
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
5
6
  const shared_print_service_1 = require("../../shared/shared-print.service");
6
7
  const my_date_1 = require("../../utils/my-date");
@@ -833,7 +834,7 @@ class InvoiceLandscapePdfService {
833
834
  // ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
834
835
  // TrUtils.isTaxable(ROPrintData.Settings.Tax), '0.00',
835
836
  // ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, null),
836
- this.TotalDetails(ROPrintData, moreDiscDetails),
837
+ this.TotalDetails(ROPrintData, moreDiscDetails, ROPrintData.Entity.DecimalsNumber),
837
838
  // SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts),
838
839
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
839
840
  // SharedPDFService.GetUnderLine(),
@@ -875,16 +876,16 @@ class InvoiceLandscapePdfService {
875
876
  text: ['Customer Signature'], marginLeft: 90
876
877
  };
877
878
  }
878
- static TotalDetails(ROPrintData, moreDiscDetails) {
879
+ static TotalDetails(ROPrintData, moreDiscDetails, DecimalsNumber) {
879
880
  let totalDisc;
880
881
  let totalTax;
881
882
  if (!ROPrintData.Consolidate) {
882
- totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborITax) + Number(ROPrintData.CustPartITax));
883
+ totalTax = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(ROPrintData.CustLaborITax), Number(ROPrintData.CustPartITax), DecimalsNumber));
883
884
  if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
884
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborDiscTotal) + Number(ROPrintData.CustPartsDiscTotal));
885
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal), DecimalsNumber));
885
886
  }
886
887
  else {
887
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborDiscTotal) + Number(ROPrintData.CustPartsDiscTotal));
888
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal), DecimalsNumber));
888
889
  }
889
890
  }
890
891
  return [
@@ -902,7 +903,7 @@ class InvoiceLandscapePdfService {
902
903
  // ROPrintData.ShowTaxColumn, ROPrintData.From),
903
904
  shared_pdf_service_1.SharedPDFService.GetBankDetials(ROPrintData.Entity.Bank, ROPrintData.Entity.PrBank),
904
905
  {
905
- columns: [{ text: '', width: moreDiscDetails ? 153 : 175 }, shared_pdf_service_1.SharedPDFService.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, null, moreDiscDetails)]
906
+ columns: [{ text: '', width: moreDiscDetails ? 153 : 175 }, shared_pdf_service_1.SharedPDFService.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, null, moreDiscDetails, ROPrintData.Entity.DecimalsNumber)]
906
907
  }
907
908
  // SharedPDFService.GetCustomer(ROPrintData.Customer, ROPrintData.Type, ROPrintData.For,
908
909
  // ROPrintData.Product, ROPrintData.Settings, 'Customer Name & Address', false)
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoiceLetterheadPdfService = void 0;
4
+ const aggregation_1 = require("../../aggregation/aggregation");
4
5
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
5
6
  const shared_print_service_1 = require("../../shared/shared-print.service");
6
7
  const my_date_1 = require("../../utils/my-date");
@@ -193,12 +194,12 @@ class InvoiceLetterheadPdfService {
193
194
  let FinalTotal = 0;
194
195
  Parts.forEach((part) => {
195
196
  // console.log('part', part);
196
- Qty = Qty + tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber);
197
- CGSTAMT = CGSTAMT + tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber);
198
- SGSTAMT = SGSTAMT + tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber);
199
- IGSTAMT = IGSTAMT + tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber);
200
- Taxable = Taxable + tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber);
201
- FinalTotal = FinalTotal + tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber);
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));
202
203
  });
203
204
  let dpartadding1 = {};
204
205
  dpartadding1.SNo = '';
@@ -312,11 +313,11 @@ class InvoiceLetterheadPdfService {
312
313
  Labor.forEach((operation) => {
313
314
  // console.log('operation', operation);
314
315
  // Qty = Qty + operation.Qty;
315
- CGSTAMT = CGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber);
316
- SGSTAMT = SGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber);
317
- IGSTAMT = IGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber);
318
- Taxable = Taxable + tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber);
319
- FinalTotal = FinalTotal + tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber);
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));
320
321
  });
321
322
  let dpartadding1 = {};
322
323
  dpartadding1.SNo = '';
@@ -689,7 +690,7 @@ class InvoiceLetterheadPdfService {
689
690
  // ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj,ROPrintData.STotal),
690
691
  shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails1(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupDataByPerc, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, ROPrintData.CustLaborTaxGroupDataByPerc, ROPrintData.STotal, isAuto, moreDiscDetails),
691
692
  this.GetNumberInWords(ROPrintData.CustRoundedTotal),
692
- shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale),
693
+ shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale, ROPrintData.Entity.DecimalsNumber),
693
694
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
694
695
  this.GetBanckdetailswithQRCode(ROPrintData),
695
696
  shared_pdf_service_1.SharedPDFService.GetUnderLine(),
@@ -5,7 +5,7 @@ export declare class InvoicePortraitPrintService {
5
5
  hLineColor: (i: any, node: any) => "gray" | "white";
6
6
  vLineColor: (i: any, node: any) => "gray" | "white";
7
7
  };
8
- static InvoiceDueStatus(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean): any;
8
+ static InvoiceDueStatus(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean, DecimalsNumber: number): any;
9
9
  static GetMainHeaderInfo(InvoicePDFData: any): {
10
10
  columns: ({
11
11
  image: any;
@@ -148,7 +148,7 @@ export declare class InvoicePortraitPrintService {
148
148
  text: string[];
149
149
  marginLeft: number;
150
150
  };
151
- static GetItemsTable(Services: any, Items: any, ShowTaxColumn: boolean, SType: any, printOptions: any, size: any): {
151
+ static GetItemsTable(Services: any, Items: any, ShowTaxColumn: boolean, SType: any, printOptions: any, size: any, DecimalsNumber: number): {
152
152
  style: string;
153
153
  marginTop: number;
154
154
  marginBottom: number;
@@ -166,9 +166,9 @@ export declare class InvoicePortraitPrintService {
166
166
  };
167
167
  static GetWidths(ShowTaxColumn: any, printOptions: any): (string | number)[];
168
168
  static GetAddress(Entity: any): string;
169
- static BuildTableBodyForLaborAndParts(Services: any, Items: any, ShowTaxColumn: any, SType: any, printOptions: any, size: any): any;
169
+ static BuildTableBodyForLaborAndParts(Services: any, Items: any, ShowTaxColumn: any, SType: any, printOptions: any, size: any, DecimalsNumber: number): any;
170
170
  static GetHeaderNames(ShowTaxColumn: any, SType: any, printOptions: any): any;
171
- static TotalDetails(ROPrintData: any, moreDiscDetails: boolean): {
171
+ static TotalDetails(ROPrintData: any, moreDiscDetails: boolean, DecimalsNumber: number): {
172
172
  style: string;
173
173
  marginTop: number;
174
174
  table: {
@@ -221,7 +221,7 @@ export declare class InvoicePortraitPrintService {
221
221
  };
222
222
  }[];
223
223
  };
224
- static GrandTotal(InvoiceData: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, totalTax: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, Adj: any, Consolidate: any, subTotal: any, moreDiscDetails: boolean): {
224
+ static GrandTotal(InvoiceData: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, totalTax: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, Adj: any, Consolidate: any, subTotal: any, moreDiscDetails: boolean, DecimalsNumber: number): {
225
225
  style: string[];
226
226
  lineHeight: number;
227
227
  marginBottom: number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.InvoicePortraitPrintService = void 0;
4
+ const aggregation_1 = require("../../aggregation/aggregation");
4
5
  const enums_1 = require("../../enums/enums");
5
6
  const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
6
7
  const my_date_1 = require("../../utils/my-date");
@@ -36,9 +37,9 @@ class InvoicePortraitPrintService {
36
37
  },
37
38
  layout: this.HeaderLayOut()
38
39
  },
39
- this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.SType, printOptions, size),
40
- [this.TotalDetails(InvoicePDFData, moreDiscDetails)],
41
- [this.InvoiceDueStatus(InvoicePDFData.Type, InvoicePDFData.Paid, InvoicePDFData.Due, InvoicePDFData.Sts, InvoicePDFData.isCountersale),
40
+ this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.SType, printOptions, size, InvoicePDFData.Entity.DecimalsNumber),
41
+ [this.TotalDetails(InvoicePDFData, moreDiscDetails, InvoicePDFData.Entity.DecimalsNumber)],
42
+ [this.InvoiceDueStatus(InvoicePDFData.Type, InvoicePDFData.Paid, InvoicePDFData.Due, InvoicePDFData.Sts, InvoicePDFData.isCountersale, InvoicePDFData.Entity.DecimalsNumber)
42
43
  ],
43
44
  {
44
45
  style: 'tableExample',
@@ -102,7 +103,7 @@ class InvoicePortraitPrintService {
102
103
  }
103
104
  };
104
105
  }
105
- static InvoiceDueStatus(Type, Paid, Due, Status, isCounter) {
106
+ static InvoiceDueStatus(Type, Paid, Due, Status, isCounter, DecimalsNumber) {
106
107
  if (Type === 'Invoice' && !isCounter) {
107
108
  return {
108
109
  // lineHeight: 0.7,
@@ -111,8 +112,8 @@ class InvoicePortraitPrintService {
111
112
  marginBottom: 5,
112
113
  table: {
113
114
  widths: ['*', '*', '*'],
114
- body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid) },
115
- { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due) },
115
+ body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
116
+ { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) },
116
117
  { text: 'Status : ' + Status }]]
117
118
  },
118
119
  layout: this.LayOutStyle(),
@@ -379,7 +380,7 @@ class InvoicePortraitPrintService {
379
380
  text: ['Customer Signature'], marginLeft: 90
380
381
  };
381
382
  }
382
- static GetItemsTable(Services, Items, ShowTaxColumn, SType, printOptions, size) {
383
+ static GetItemsTable(Services, Items, ShowTaxColumn, SType, printOptions, size, DecimalsNumber) {
383
384
  return {
384
385
  style: 'tableExample',
385
386
  marginTop: 3,
@@ -387,7 +388,7 @@ class InvoicePortraitPrintService {
387
388
  table: {
388
389
  widths: this.GetWidths(ShowTaxColumn, printOptions),
389
390
  headerRows: 1,
390
- body: this.BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size)
391
+ body: this.BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size, DecimalsNumber)
391
392
  },
392
393
  layout: {
393
394
  hLineWidth: function (i, node) {
@@ -426,7 +427,7 @@ class InvoicePortraitPrintService {
426
427
  static GetAddress(Entity) {
427
428
  return Entity.Adrs1 + ', ' + Entity.Adrs2 + ', ' + Entity.City + '-' + Entity.PIN + ', Cell : ' + Entity.Phone;
428
429
  }
429
- static BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size) {
430
+ static BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size, DecimalsNumber) {
430
431
  let body = this.GetHeaderNames(ShowTaxColumn, SType, printOptions);
431
432
  let j = 1;
432
433
  if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
@@ -443,20 +444,20 @@ class InvoicePortraitPrintService {
443
444
  dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
444
445
  dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
445
446
  dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
446
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Pr), alignment: 'right', style: ['headerstyle'], });
447
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Pr, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
447
448
  if (printOptions.Disc !== 'NO') {
448
449
  if (printOptions.Disc === 'PERC') {
449
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
450
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
450
451
  }
451
452
  else {
452
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
453
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
453
454
  }
454
455
  }
455
456
  if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
456
457
  let Tax = (_a = item.TaxName) === null || _a === void 0 ? void 0 : _a.split('%');
457
458
  dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
458
459
  }
459
- dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
460
+ dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal, DecimalsNumber) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
460
461
  body.push(dataRow);
461
462
  if (index + 1 === j * 9) {
462
463
  j++;
@@ -511,21 +512,21 @@ class InvoicePortraitPrintService {
511
512
  dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate((_b = item['Batch']) === null || _b === void 0 ? void 0 : _b.ExDt), alignment: 'center', style: ['headerstyle'], });
512
513
  dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
513
514
  dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
514
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
515
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
515
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
516
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
516
517
  if (printOptions.Disc !== 'NO') {
517
518
  if (printOptions.Disc === 'PERC') {
518
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
519
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
519
520
  }
520
521
  else {
521
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
522
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
522
523
  }
523
524
  }
524
525
  if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
525
526
  let Tax = (_c = item.TaxName) === null || _c === void 0 ? void 0 : _c.split('%');
526
527
  dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Number(Tax[0]), alignment: 'right', style: ['headerstyle'], });
527
528
  }
528
- dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
529
+ dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal, DecimalsNumber) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
529
530
  body.push(dataRow);
530
531
  if (index + 1 === j * 9) {
531
532
  j++;
@@ -579,16 +580,16 @@ class InvoicePortraitPrintService {
579
580
  }
580
581
  return HeadingNames;
581
582
  }
582
- static TotalDetails(ROPrintData, moreDiscDetails) {
583
+ static TotalDetails(ROPrintData, moreDiscDetails, DecimalsNumber) {
583
584
  let totalDisc;
584
585
  let totalTax;
585
586
  if (!ROPrintData.Consolidate) {
586
- totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborITax) + Number(ROPrintData.CustPartITax));
587
+ totalTax = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(ROPrintData.CustLaborITax), Number(ROPrintData.CustPartITax)), DecimalsNumber);
587
588
  if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
588
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborDiscTotal) + Number(ROPrintData.CustPartsDiscTotal));
589
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal)), DecimalsNumber);
589
590
  }
590
591
  else {
591
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborDiscTotal) + Number(ROPrintData.CustPartsDiscTotal));
592
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal)), DecimalsNumber);
592
593
  }
593
594
  }
594
595
  return [
@@ -601,7 +602,7 @@ class InvoicePortraitPrintService {
601
602
  [
602
603
  this.PartsTaxAmounts(ROPrintData.CustTaxGroupData, true, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn),
603
604
  {
604
- columns: [{ text: '', width: moreDiscDetails ? 120 : 150 }, this.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, ROPrintData.STotal, moreDiscDetails)]
605
+ columns: [{ text: '', width: moreDiscDetails ? 120 : 150 }, this.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, ROPrintData.STotal, moreDiscDetails, ROPrintData.Entity.DecimalsNumber)],
605
606
  }
606
607
  ],
607
608
  ]
@@ -620,28 +621,28 @@ class InvoicePortraitPrintService {
620
621
  return '';
621
622
  }
622
623
  }
623
- static GrandTotal(InvoiceData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, subTotal, moreDiscDetails) {
624
+ static GrandTotal(InvoiceData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, subTotal, moreDiscDetails, DecimalsNumber) {
624
625
  let AccountFields = [];
625
626
  if (moreDiscDetails) {
626
627
  if (!tr_utils_1.TrUtils.IsZero(InvoiceData.PDisc)) {
627
- AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.PDisc) });
628
+ AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.PDisc, DecimalsNumber) });
628
629
  }
629
630
  if (!tr_utils_1.TrUtils.IsZero(InvoiceData.LDisc)) {
630
- AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.LDisc) });
631
+ AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.LDisc, DecimalsNumber) });
631
632
  }
632
633
  if (!tr_utils_1.TrUtils.IsZero(InvoiceData.Disc)) {
633
- AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.Disc) });
634
+ AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.Disc, DecimalsNumber) });
634
635
  }
635
636
  }
636
637
  else {
637
638
  AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
638
639
  }
639
640
  if (!Consolidate && !tr_utils_1.TrUtils.IsNull(subTotal)) {
640
- AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(subTotal))) });
641
+ AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(subTotal)), DecimalsNumber) });
641
642
  }
642
643
  else {
643
644
  if (!Consolidate) {
644
- AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))) });
645
+ AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))), DecimalsNumber) });
645
646
  }
646
647
  }
647
648
  if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
@@ -649,7 +650,7 @@ class InvoicePortraitPrintService {
649
650
  }
650
651
  if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
651
652
  if (Adj > 0) {
652
- Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
653
+ Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj, DecimalsNumber);
653
654
  }
654
655
  AccountFields.push({ name: 'Adjust', value: Adj });
655
656
  }
@@ -156,7 +156,7 @@ class InvoiceTotalsService {
156
156
  let CustPartsTotalAfterDisc1 = this.GetPartsAfterDiscount1(PartsList);
157
157
  let AmtAfterIndvidualItemDisc = (0, aggregation_1.addition)(CustLaborTotalAfterDisc1, CustPartsTotalAfterDisc1);
158
158
  finalTotalsData.SIndTotal = AmtAfterIndvidualItemDisc;
159
- finalTotalsData.Disc = !tr_utils_1.TrUtils.IsEmpty(finalTotalsData.Perc) ? tr_utils_1.TrUtils.ConvertPercToVal(finalTotalsData.Perc, AmtAfterIndvidualItemDisc) : finalTotalsData.Disc;
159
+ finalTotalsData.Disc = !tr_utils_1.TrUtils.IsEmpty(finalTotalsData.Perc) ? tr_utils_1.TrUtils.ConvertPercToVal(finalTotalsData.Perc, AmtAfterIndvidualItemDisc, DecimalsNumber) : finalTotalsData.Disc;
160
160
  let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, CustPartTaxTotal, LaborList, PartsList, IsIndependentTax, Adjust);
161
161
  let RetCustTotal = this.GetRetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, RetCustParrtTaxTotal, LaborList, PartsList, IsIndependentTax, Adjust, DecimalsNumber);
162
162
  let NonRetCustTotal = this.GetNonRetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, NonRetCustParrtTaxTotal, LaborList, PartsList, IsIndependentTax, Adjust, DecimalsNumber);
@@ -13,11 +13,11 @@ export declare class ServiceAdvisorWiseLaborXlsxFileService {
13
13
  };
14
14
  };
15
15
  static ws: any;
16
- static GetServiceAdvisorLaborsExcelData(MainData: any): any;
16
+ static GetServiceAdvisorLaborsExcelData(MainData: any, EntitySettings: any): any;
17
17
  static setHeadingInCell(): void;
18
- static setWorkOrderDetailsInCell(MainData: any): void;
19
- static SetWorkOrderDataInExcel(WorkOrder: any, index: any): void;
20
- static ConvertToString(Text: any, IsString: any): any;
18
+ static setWorkOrderDetailsInCell(MainData: any, DecimalsNumber: number): void;
19
+ static SetWorkOrderDataInExcel(WorkOrder: any, index: any, DecimalsNumber: number): void;
20
+ static ConvertToString(Text: any, IsString: any, DecimalsNumber: number): any;
21
21
  static SetDataInCell(Data: any, ColRange: number, RowNum: any): void;
22
22
  static getcelltype(cell: any): any;
23
23
  }
@@ -27,8 +27,9 @@ exports.ServiceAdvisorWiseLaborXlsxFileService = void 0;
27
27
  const XLSX = __importStar(require("xlsx"));
28
28
  const my_date_1 = require("../../../../utils/my-date");
29
29
  const tr_utils_1 = require("../../../../utils/tr-utils");
30
+ const aggregation_1 = require("../../../../aggregation/aggregation");
30
31
  class ServiceAdvisorWiseLaborXlsxFileService {
31
- static GetServiceAdvisorLaborsExcelData(MainData) {
32
+ static GetServiceAdvisorLaborsExcelData(MainData, EntitySettings) {
32
33
  this.wb = {};
33
34
  this.ws = {};
34
35
  this.Row = 0;
@@ -41,7 +42,7 @@ class ServiceAdvisorWiseLaborXlsxFileService {
41
42
  this.wb.SheetNames = [];
42
43
  // MainData = this.GetTotals(MainData);
43
44
  this.setHeadingInCell();
44
- this.setWorkOrderDetailsInCell(MainData);
45
+ this.setWorkOrderDetailsInCell(MainData, EntitySettings.DecimalsNumber);
45
46
  this.ws['!ref'] = XLSX.utils.encode_range(this.range);
46
47
  this.ws['!merges'] = this.MergeArray;
47
48
  this.ws["!cols"] = [{ wch: 15 }, { wch: 15 }, { wch: 30 }, { wch: 40 }, { wch: 15 }, { wch: 15 }, { wch: 40 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }];
@@ -139,17 +140,17 @@ class ServiceAdvisorWiseLaborXlsxFileService {
139
140
  });
140
141
  this.Row += 2;
141
142
  }
142
- static setWorkOrderDetailsInCell(MainData) {
143
+ static setWorkOrderDetailsInCell(MainData, DecimalsNumber) {
143
144
  MainData.forEach((InvoiceList, index) => {
144
- this.SetWorkOrderDataInExcel(InvoiceList, index);
145
+ this.SetWorkOrderDataInExcel(InvoiceList, index, DecimalsNumber);
145
146
  });
146
147
  }
147
- static SetWorkOrderDataInExcel(WorkOrder, index) {
148
+ static SetWorkOrderDataInExcel(WorkOrder, index, DecimalsNumber) {
148
149
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
149
150
  WorkOrder.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(WorkOrder.CrDate);
150
- WorkOrder.Discount = tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull((_a = WorkOrder.Ops) === null || _a === void 0 ? void 0 : _a.Disc) + tr_utils_1.TrUtils.SetValueToZeroIfNull((_b = WorkOrder.Ops) === null || _b === void 0 ? void 0 : _b.RecDisc));
151
- WorkOrder.Tax = tr_utils_1.TrUtils.FixPriceValue(((_c = WorkOrder.Ops) === null || _c === void 0 ? void 0 : _c.CGST) + ((_d = WorkOrder.Ops) === null || _d === void 0 ? void 0 : _d.SGST) + ((_e = WorkOrder.Ops) === null || _e === void 0 ? void 0 : _e.IGST));
152
- WorkOrder.Total = tr_utils_1.TrUtils.FixPriceValue(((_f = WorkOrder.Ops) === null || _f === void 0 ? void 0 : _f.NetAmt) + Number(WorkOrder.Tax));
151
+ WorkOrder.Discount = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(tr_utils_1.TrUtils.SetValueToZeroIfNull((_a = WorkOrder.Ops) === null || _a === void 0 ? void 0 : _a.Disc), tr_utils_1.TrUtils.SetValueToZeroIfNull((_b = WorkOrder.Ops) === null || _b === void 0 ? void 0 : _b.RecDisc)), DecimalsNumber);
152
+ WorkOrder.Tax = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)((_c = WorkOrder.Ops) === null || _c === void 0 ? void 0 : _c.CGST, (_d = WorkOrder.Ops) === null || _d === void 0 ? void 0 : _d.SGST, (_e = WorkOrder.Ops) === null || _e === void 0 ? void 0 : _e.IGST), DecimalsNumber);
153
+ WorkOrder.Total = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)((_f = WorkOrder.Ops) === null || _f === void 0 ? void 0 : _f.NetAmt, Number(WorkOrder.Tax)), DecimalsNumber);
153
154
  // if(!TrUtils.IsNull(WorkOrder.Prod) && !TrUtils.IsNull(WorkOrder.Prod.DDate)){
154
155
  // WorkOrder.Prod.DDate= TrUtils.ConvertDateToReadableFormat(WorkOrder.Prod.DDate);
155
156
  // }else{
@@ -174,7 +175,7 @@ class ServiceAdvisorWiseLaborXlsxFileService {
174
175
  ];
175
176
  let ColStart = 0;
176
177
  InvoiceData.forEach((InvData) => {
177
- InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
178
+ InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
178
179
  this.SetDataInCell(InvData.text, ColStart, this.Row);
179
180
  this.MergeArray.push({
180
181
  s: { r: this.Row, c: ColStart },
@@ -184,7 +185,7 @@ class ServiceAdvisorWiseLaborXlsxFileService {
184
185
  });
185
186
  this.Row += 1;
186
187
  }
187
- static ConvertToString(Text, IsString) {
188
+ static ConvertToString(Text, IsString, DecimalsNumber) {
188
189
  if (IsString) {
189
190
  if (Text == null) {
190
191
  Text = '';
@@ -196,7 +197,7 @@ class ServiceAdvisorWiseLaborXlsxFileService {
196
197
  }
197
198
  }
198
199
  if (typeof Text === 'number') {
199
- return Number(tr_utils_1.TrUtils.FixedTo(Text));
200
+ return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
200
201
  }
201
202
  else {
202
203
  return Text;
@@ -13,11 +13,11 @@ export declare class ServiceAdvisorWisePartXlsxFileService {
13
13
  };
14
14
  };
15
15
  static ws: any;
16
- static GetServiceAdvisorPartsExcelData(MainData: any): any;
16
+ static GetServiceAdvisorPartsExcelData(MainData: any, EntitySettings: any): any;
17
17
  static setHeadingInCell(): void;
18
- static setWorkOrderDetailsInCell(MainData: any): void;
19
- static SetWorkOrderDataInExcel(WorkOrder: any, index: any): void;
20
- static ConvertToString(Text: any, IsString: any): any;
18
+ static setWorkOrderDetailsInCell(MainData: any, DecimalsNumber: number): void;
19
+ static SetWorkOrderDataInExcel(WorkOrder: any, index: any, DecimalsNumber: number): void;
20
+ static ConvertToString(Text: any, IsString: any, DecimalsNumber: number): any;
21
21
  static SetDataInCell(Data: any, ColRange: number, RowNum: any): void;
22
22
  static getcelltype(cell: any): any;
23
23
  }