shareneus 1.4.49 → 1.4.50
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.
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +8 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +14 -14
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +8 -8
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +10 -10
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +14 -13
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/operator-wise-details.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +8 -8
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +8 -8
- package/dist/gst/excel/GSTR-RO-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR-RO-excel.service.js +8 -8
- package/dist/gst/excel/GSTR1-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR1-excel.service.js +10 -10
- package/dist/gst/excel/GSTR2-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR2-excel.service.js +9 -9
- package/dist/gst/excel/tally-sales-import.service.d.ts +4 -4
- package/dist/gst/excel/tally-sales-import.service.js +8 -8
- package/dist/inventory/items/issue-parts-pdf.service.d.ts +6 -6
- package/dist/inventory/items/issue-parts-pdf.service.js +32 -32
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +11 -10
- package/dist/inventory/items/reports/excel/item-wise-mout-details.d.ts +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +8 -8
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.d.ts +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +8 -8
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +12 -12
- package/dist/inventory/items/reports/excel/stock-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/stock-excel.service.js +8 -8
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.d.ts +4 -4
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +9 -9
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.d.ts +6 -6
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +14 -14
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.d.ts +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.js +20 -20
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +8 -8
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +31 -32
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +6 -6
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +19 -19
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +2 -2
- package/dist/sales/delivery-challan/delivery-challan-totals.d.ts +6 -6
- package/dist/sales/delivery-challan/delivery-challan-totals.js +20 -20
- package/dist/sales/sales/sales-print.service.js +1 -1
- package/dist/sales/sales/sales-totals.service.d.ts +6 -6
- package/dist/sales/sales/sales-totals.service.js +19 -19
- package/dist/services/est.print-service.js +1 -1
- package/dist/services/reports/excel/insurance-expire-excel.service.d.ts +4 -4
- package/dist/services/reports/excel/insurance-expire-excel.service.js +8 -8
- package/dist/services/reports/excel/next-service-date-excel.service.d.ts +4 -4
- package/dist/services/reports/excel/next-service-date-excel.service.js +8 -8
- package/dist/services/reports/excel/repair-orders-excel.service.d.ts +5 -5
- package/dist/services/reports/excel/repair-orders-excel.service.js +11 -11
- package/dist/services/ro-print-service.js +1 -1
- package/dist/services/ro-totals.service.d.ts +11 -11
- package/dist/services/ro-totals.service.js +50 -50
- package/dist/utils/tr-utils.js +2 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ exports.VendorDebitNoteTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class VendorDebitNoteTotalsService {
|
|
7
|
-
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
7
|
+
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
10
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
@@ -13,9 +13,9 @@ class VendorDebitNoteTotalsService {
|
|
|
13
13
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
ItemsList = this.CalculateLaborItemValues(ItemsList, IsIndependentTax);
|
|
16
|
-
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
16
|
+
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, EntitySettings.DecimalsNumber);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
// finalTotalsData.Ops = opCodesList;
|
|
@@ -56,11 +56,11 @@ class VendorDebitNoteTotalsService {
|
|
|
56
56
|
Item.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
57
57
|
return Item;
|
|
58
58
|
}
|
|
59
|
-
static GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
59
|
+
static GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, DecimalsNumber) {
|
|
60
60
|
let finalTotalsData = {};
|
|
61
61
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
62
62
|
finalTotalsData.Settings = Settings;
|
|
63
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo);
|
|
63
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber);
|
|
64
64
|
return finalTotalsData;
|
|
65
65
|
}
|
|
66
66
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -77,11 +77,11 @@ class VendorDebitNoteTotalsService {
|
|
|
77
77
|
}
|
|
78
78
|
return finalTotalsData;
|
|
79
79
|
}
|
|
80
|
-
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo) {
|
|
80
|
+
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber) {
|
|
81
81
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(ItemsList);
|
|
82
82
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
83
83
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
84
|
-
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
84
|
+
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
85
85
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
86
86
|
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
87
87
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
@@ -91,8 +91,8 @@ class VendorDebitNoteTotalsService {
|
|
|
91
91
|
finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
92
92
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
93
93
|
if (DetailedInfo) {
|
|
94
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
95
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
94
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
95
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
96
96
|
}
|
|
97
97
|
return finalTotalsData;
|
|
98
98
|
}
|
|
@@ -108,7 +108,7 @@ class VendorDebitNoteTotalsService {
|
|
|
108
108
|
});
|
|
109
109
|
return ItemsTotalAfterDisc;
|
|
110
110
|
}
|
|
111
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes) {
|
|
111
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, DecimalsNumber) {
|
|
112
112
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList, IsIndependentTax, finalTotalsData);
|
|
113
113
|
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
114
114
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -131,15 +131,15 @@ class VendorDebitNoteTotalsService {
|
|
|
131
131
|
// finalTotalsData.CustItemSGST = this.GetItemSGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
132
132
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
|
|
133
133
|
finalTotalsData.CustItemAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
|
|
134
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
135
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
136
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
134
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
135
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
136
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
137
137
|
for (var key in finalTotalsData) {
|
|
138
138
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
139
139
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
140
140
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
141
141
|
&& typeof finalTotalsData[key] === 'number') {
|
|
142
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
142
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
return finalTotalsData;
|
|
@@ -201,11 +201,11 @@ class VendorDebitNoteTotalsService {
|
|
|
201
201
|
}
|
|
202
202
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
203
203
|
}
|
|
204
|
-
static GetTaxGroupingForItemsByHSN(Items, TaxCodes) {
|
|
204
|
+
static GetTaxGroupingForItemsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
205
205
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
206
206
|
// Items = this.ResetItemsHSNIfInvalid(Items);
|
|
207
207
|
let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
|
|
208
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
|
|
208
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
|
|
209
209
|
}
|
|
210
210
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
211
211
|
Items.forEach((Item) => {
|
|
@@ -251,7 +251,7 @@ class VendorDebitNoteTotalsService {
|
|
|
251
251
|
});
|
|
252
252
|
return FinalMatchedItems;
|
|
253
253
|
}
|
|
254
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
|
|
254
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
|
|
255
255
|
let HSNTaxInfo = [];
|
|
256
256
|
FinalMatchedItems.forEach((MatchedItem) => {
|
|
257
257
|
let TaxInfo = {};
|
|
@@ -266,8 +266,8 @@ class VendorDebitNoteTotalsService {
|
|
|
266
266
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
267
267
|
});
|
|
268
268
|
TaxInfo.HSN = HSN;
|
|
269
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
270
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
269
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
270
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
271
271
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
272
272
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
273
273
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -27,7 +27,7 @@ class DeliveryChallanPrintService {
|
|
|
27
27
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
28
28
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
29
29
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
30
|
-
let finalTotalsData = delivery_challan_totals_1.DeliveryChallanTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round);
|
|
30
|
+
let finalTotalsData = delivery_challan_totals_1.DeliveryChallanTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round, InvoicePrintData.Entity);
|
|
31
31
|
if (ConsolidateGST) {
|
|
32
32
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
33
33
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
@@ -83,7 +83,7 @@ class DeliveryChallanPrintService {
|
|
|
83
83
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
84
84
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
85
85
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
86
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((AfterDiscForEach
|
|
86
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare class DeliveryChallanTotalsService {
|
|
2
|
-
static GetTotalsValue(PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean): any;
|
|
2
|
+
static GetTotalsValue(PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean, EntitySettings: any): any;
|
|
3
3
|
static CalculateLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborPartValueIfInvalid(Part: any): any;
|
|
6
|
-
static GetFinalChallanDataForSave(PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean): any;
|
|
6
|
+
static GetFinalChallanDataForSave(PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean, DecimalsNumber: number): any;
|
|
7
7
|
static SetMainDiscountValues(Disc: any, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean, DecimalsNumber: number): any;
|
|
9
9
|
static GetSubTotalFor(PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any): any;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
12
12
|
static GetLaborDiscountedTotal(LaborList: any): any;
|
|
13
13
|
static GetPartDiscountedTotal(PartsList: any): any;
|
|
14
14
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
@@ -19,9 +19,9 @@ export declare class DeliveryChallanTotalsService {
|
|
|
19
19
|
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
20
20
|
static GetLaborSGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
21
21
|
static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
|
|
22
|
-
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
22
|
+
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
23
23
|
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
24
24
|
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
25
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any): any[];
|
|
25
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
26
26
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
27
27
|
}
|
|
@@ -4,15 +4,15 @@ exports.DeliveryChallanTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class DeliveryChallanTotalsService {
|
|
7
|
-
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable) {
|
|
7
|
+
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
10
10
|
// LDisc = TrUtils.SetValueToZeroIfNull(LDisc);
|
|
11
11
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
12
12
|
PartsList = this.CalculateLaborPartValues(PartsList, IsIndependentTax);
|
|
13
|
-
let finalTotalsData = this.GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable);
|
|
13
|
+
let finalTotalsData = this.GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable, EntitySettings.DecimalsNumber);
|
|
14
14
|
if (DetailedInfo) {
|
|
15
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes);
|
|
15
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
16
16
|
}
|
|
17
17
|
if (WithItems) {
|
|
18
18
|
finalTotalsData.Items = PartsList;
|
|
@@ -50,11 +50,11 @@ class DeliveryChallanTotalsService {
|
|
|
50
50
|
Part.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.IGST);
|
|
51
51
|
return Part;
|
|
52
52
|
}
|
|
53
|
-
static GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable) {
|
|
53
|
+
static GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable, DecimalsNumber) {
|
|
54
54
|
let finalTotalsData = {};
|
|
55
55
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
56
56
|
finalTotalsData.Settings = Settings;
|
|
57
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable);
|
|
57
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber);
|
|
58
58
|
return finalTotalsData;
|
|
59
59
|
}
|
|
60
60
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -65,7 +65,7 @@ class DeliveryChallanTotalsService {
|
|
|
65
65
|
}
|
|
66
66
|
return finalTotalsData;
|
|
67
67
|
}
|
|
68
|
-
static GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable) {
|
|
68
|
+
static GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber) {
|
|
69
69
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(PartsList);
|
|
70
70
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
71
71
|
let CustPartTaxTotal = this.GetPartsTaxTotalFor(PartsList, IsIndependentTax);
|
|
@@ -75,15 +75,15 @@ class DeliveryChallanTotalsService {
|
|
|
75
75
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(CustPartTaxTotal, PartsList, IsIndependentTax);
|
|
76
76
|
// console.log('CustTotal', CustTotal);
|
|
77
77
|
if (isRoundable) {
|
|
78
|
-
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo(Math.round(CustTotal)
|
|
78
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
79
79
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
82
|
+
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
83
83
|
}
|
|
84
84
|
if (DetailedInfo) {
|
|
85
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
86
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
85
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
86
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
return finalTotalsData;
|
|
89
89
|
}
|
|
@@ -100,7 +100,7 @@ class DeliveryChallanTotalsService {
|
|
|
100
100
|
});
|
|
101
101
|
return PartsTotalAfterDisc;
|
|
102
102
|
}
|
|
103
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes) {
|
|
103
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes, DecimalsNumber) {
|
|
104
104
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList);
|
|
105
105
|
finalTotalsData.CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList);
|
|
106
106
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -122,15 +122,15 @@ class DeliveryChallanTotalsService {
|
|
|
122
122
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
123
123
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
124
124
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
125
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes);
|
|
126
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
127
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
125
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
126
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
127
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
128
128
|
for (var key in finalTotalsData) {
|
|
129
129
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
130
130
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
131
131
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
132
132
|
&& typeof finalTotalsData[key] === 'number') {
|
|
133
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
133
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return finalTotalsData;
|
|
@@ -234,11 +234,11 @@ class DeliveryChallanTotalsService {
|
|
|
234
234
|
}
|
|
235
235
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
236
236
|
}
|
|
237
|
-
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes) {
|
|
237
|
+
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes, DecimalsNumber) {
|
|
238
238
|
Parts = this.GetCombinedTaxPercentage(Parts, TaxCodes);
|
|
239
239
|
// Parts = this.ResetPartsHSNIfInvalid(Parts);
|
|
240
240
|
let FinalMatchedParts = this.ComparePartsByHSN(Parts, TaxCodes);
|
|
241
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes);
|
|
241
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
|
|
242
242
|
}
|
|
243
243
|
static GetCombinedTaxPercentage(Parts, TaxCodes) {
|
|
244
244
|
Parts.forEach((Part) => {
|
|
@@ -284,7 +284,7 @@ class DeliveryChallanTotalsService {
|
|
|
284
284
|
});
|
|
285
285
|
return FinalMatchedParts;
|
|
286
286
|
}
|
|
287
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes) {
|
|
287
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber) {
|
|
288
288
|
let HSNTaxInfo = [];
|
|
289
289
|
FinalMatchedParts.forEach((MatchedPart) => {
|
|
290
290
|
let TaxInfo = {};
|
|
@@ -299,8 +299,8 @@ class DeliveryChallanTotalsService {
|
|
|
299
299
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
300
300
|
});
|
|
301
301
|
TaxInfo.HSN = HSN;
|
|
302
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
303
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
302
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
303
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
304
304
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
305
305
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
306
306
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -34,7 +34,7 @@ class SalesPrintService {
|
|
|
34
34
|
// argInvoiceData.Items = argInvoiceData.Items.filter((item: any) => {
|
|
35
35
|
// return TrUtils.IsNull(item.Type);
|
|
36
36
|
// });
|
|
37
|
-
let finalTotalsData = sales_totals_service_1.SalesTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round);
|
|
37
|
+
let finalTotalsData = sales_totals_service_1.SalesTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round, InvoicePrintData.Entity);
|
|
38
38
|
if (ConsolidateGST) {
|
|
39
39
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustItemAfterTax;
|
|
40
40
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare class SalesTotalsService {
|
|
2
|
-
static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, PDisc: any, PPerc: string, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean): any;
|
|
2
|
+
static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, PDisc: any, PPerc: string, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean, EntitySettings: any): any;
|
|
3
3
|
static CalculateLaborItemValues(ItemsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborItemValues(ItemsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborItemValueIfInvalid(Item: any): any;
|
|
6
|
-
static GetFinalRODataForSave(ItemsList: any, IsIndependentTax: boolean, PDisc: string, PPerc: string, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean): any;
|
|
6
|
+
static GetFinalRODataForSave(ItemsList: any, IsIndependentTax: boolean, PDisc: string, PPerc: string, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean, DecimalsNumber: number): any;
|
|
7
7
|
static SetMainDiscountValues(PPerc: string, PDisc: any, Disc: any, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean, DecimalsNumber: number): any;
|
|
9
9
|
static GetSubTotalFor(ItemsList: any): any;
|
|
10
10
|
static GetItemsTotalAfterDiscount(ItemsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any): any;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any, DecimalsNumber: any): any;
|
|
12
12
|
static GetLaborDiscountedTotal(LaborList: any): any;
|
|
13
13
|
static GetItemDiscountedTotal(ItemsList: any): any;
|
|
14
14
|
static GetItemsTaxTotalFor(ItemsList: any, IsIndependentTax: boolean): any;
|
|
@@ -19,9 +19,9 @@ export declare class SalesTotalsService {
|
|
|
19
19
|
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
20
20
|
static GetLaborSGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
21
21
|
static GetItemGSTTaxTotal(ItemsList: any, IsIndependentTax: boolean): number[];
|
|
22
|
-
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
22
|
+
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
23
23
|
static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
|
|
24
24
|
static CompareItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
25
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any): any[];
|
|
25
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
26
26
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
27
27
|
}
|
|
@@ -4,7 +4,7 @@ exports.SalesTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class SalesTotalsService {
|
|
7
|
-
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, PDisc, PPerc, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable) {
|
|
7
|
+
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, PDisc, PPerc, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
PPerc = tr_utils_1.TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
10
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
@@ -13,9 +13,9 @@ class SalesTotalsService {
|
|
|
13
13
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
ItemsList = this.CalculateLaborItemValues(ItemsList, IsIndependentTax);
|
|
16
|
-
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable);
|
|
16
|
+
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable, EntitySettings);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, EntitySettings);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
finalTotalsData.Items = ItemsList;
|
|
@@ -53,11 +53,11 @@ class SalesTotalsService {
|
|
|
53
53
|
Item.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
54
54
|
return Item;
|
|
55
55
|
}
|
|
56
|
-
static GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable) {
|
|
56
|
+
static GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable, DecimalsNumber) {
|
|
57
57
|
let finalTotalsData = {};
|
|
58
58
|
finalTotalsData = this.SetMainDiscountValues(PPerc, PDisc, Disc, Perc, finalTotalsData, DetailedInfo);
|
|
59
59
|
finalTotalsData.Settings = Settings;
|
|
60
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable);
|
|
60
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber);
|
|
61
61
|
return finalTotalsData;
|
|
62
62
|
}
|
|
63
63
|
static SetMainDiscountValues(PPerc, PDisc, Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -71,7 +71,7 @@ class SalesTotalsService {
|
|
|
71
71
|
}
|
|
72
72
|
return finalTotalsData;
|
|
73
73
|
}
|
|
74
|
-
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable) {
|
|
74
|
+
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber) {
|
|
75
75
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(ItemsList);
|
|
76
76
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
77
77
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
@@ -83,11 +83,11 @@ class SalesTotalsService {
|
|
|
83
83
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
|
-
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
86
|
+
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
if (DetailedInfo) {
|
|
89
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
90
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
89
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
90
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
91
91
|
}
|
|
92
92
|
return finalTotalsData;
|
|
93
93
|
}
|
|
@@ -103,7 +103,7 @@ class SalesTotalsService {
|
|
|
103
103
|
});
|
|
104
104
|
return ItemsTotalAfterDisc;
|
|
105
105
|
}
|
|
106
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes) {
|
|
106
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, DecimalsNumber) {
|
|
107
107
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList);
|
|
108
108
|
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList);
|
|
109
109
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -121,15 +121,15 @@ class SalesTotalsService {
|
|
|
121
121
|
finalTotalsData.CustItemSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
122
122
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
123
123
|
finalTotalsData.CustItemAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
|
|
124
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
125
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
126
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
124
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
125
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
126
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
127
127
|
for (var key in finalTotalsData) {
|
|
128
128
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
129
129
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
130
130
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
131
131
|
&& typeof finalTotalsData[key] === 'number') {
|
|
132
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
132
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
return finalTotalsData;
|
|
@@ -233,11 +233,11 @@ class SalesTotalsService {
|
|
|
233
233
|
}
|
|
234
234
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
235
235
|
}
|
|
236
|
-
static GetTaxGroupingForItemsByHSN(Items, TaxCodes) {
|
|
236
|
+
static GetTaxGroupingForItemsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
237
237
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
238
238
|
// Items = this.ResetItemsHSNIfInvalid(Items);
|
|
239
239
|
let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
|
|
240
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
|
|
240
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
|
|
241
241
|
}
|
|
242
242
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
243
243
|
Items.forEach((Item) => {
|
|
@@ -283,7 +283,7 @@ class SalesTotalsService {
|
|
|
283
283
|
});
|
|
284
284
|
return FinalMatchedItems;
|
|
285
285
|
}
|
|
286
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
|
|
286
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
|
|
287
287
|
let HSNTaxInfo = [];
|
|
288
288
|
FinalMatchedItems.forEach((MatchedItem) => {
|
|
289
289
|
let TaxInfo = {};
|
|
@@ -298,8 +298,8 @@ class SalesTotalsService {
|
|
|
298
298
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
299
299
|
});
|
|
300
300
|
TaxInfo.HSN = HSN;
|
|
301
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
302
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
301
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
302
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
303
303
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
304
304
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
305
305
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -54,7 +54,7 @@ class EstPrintService {
|
|
|
54
54
|
ROPrintData.ShowAccParts = this.CheckAndShowItemsAsAR(argROData);
|
|
55
55
|
}
|
|
56
56
|
argROData = this.ReverseItemsForROPrint(argROData, isReverse);
|
|
57
|
-
let finalTotalsData = ro_totals_service_1.ROTotalsService.GetTotalsValue(argROData, TaxCodes, false, true, true, ROPrintData.Entity.Round);
|
|
57
|
+
let finalTotalsData = ro_totals_service_1.ROTotalsService.GetTotalsValue(argROData, TaxCodes, false, true, true, ROPrintData.Entity.Round, ROPrintData.Entity);
|
|
58
58
|
finalTotalsData = this.CheckAndGetCombinedTotals(AsCustomerAndInsurance, AsInsuranceOrCustomer, finalTotalsData, ROPrintData.Entity.DecimalsNumber);
|
|
59
59
|
finalTotalsData.Settings = tr_utils_1.TrUtils.Stringify(argROData.Settings);
|
|
60
60
|
if (AsCustomerOnly) {
|
|
@@ -13,11 +13,11 @@ export declare class InsuranceExpireXlsxFileService {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
static ws: any;
|
|
16
|
-
static GetInsuranceExpireExcelData(MainData: any, searchValue: any, HeaderName: any): any;
|
|
16
|
+
static GetInsuranceExpireExcelData(MainData: any, searchValue: any, HeaderName: any, EntitySettings: any): any;
|
|
17
17
|
static setHeadingInCell(HeaderName: any, searchValue: any): void;
|
|
18
|
-
static setInvoiceDetailsInCell(MainData: any): void;
|
|
19
|
-
static SetInvoiceDataInExcel(InvoiceInfo: any): void;
|
|
20
|
-
static ConvertToString(Text: any, IsString: any): any;
|
|
18
|
+
static setInvoiceDetailsInCell(MainData: any, DecimalsNumber: number): void;
|
|
19
|
+
static SetInvoiceDataInExcel(InvoiceInfo: 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
|
}
|
|
@@ -28,7 +28,7 @@ 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
30
|
class InsuranceExpireXlsxFileService {
|
|
31
|
-
static GetInsuranceExpireExcelData(MainData, searchValue, HeaderName) {
|
|
31
|
+
static GetInsuranceExpireExcelData(MainData, searchValue, HeaderName, EntitySettings) {
|
|
32
32
|
this.wb = {};
|
|
33
33
|
this.ws = {};
|
|
34
34
|
this.Row = 0;
|
|
@@ -66,7 +66,7 @@ class InsuranceExpireXlsxFileService {
|
|
|
66
66
|
// console.log(`${key}: ${searchValue[key]}`);
|
|
67
67
|
}
|
|
68
68
|
this.setHeadingInCell(HeaderName, showSearch);
|
|
69
|
-
this.setInvoiceDetailsInCell(MainData);
|
|
69
|
+
this.setInvoiceDetailsInCell(MainData, EntitySettings.DecimalsNumber);
|
|
70
70
|
this.ws['!ref'] = XLSX.utils.encode_range(this.range);
|
|
71
71
|
this.ws['!merges'] = this.MergeArray;
|
|
72
72
|
this.ws["!cols"] = [{ wch: 15 }, { wch: 15 }, { wch: 30 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 20 }];
|
|
@@ -217,12 +217,12 @@ class InsuranceExpireXlsxFileService {
|
|
|
217
217
|
});
|
|
218
218
|
this.Row += 2;
|
|
219
219
|
}
|
|
220
|
-
static setInvoiceDetailsInCell(MainData) {
|
|
220
|
+
static setInvoiceDetailsInCell(MainData, DecimalsNumber) {
|
|
221
221
|
MainData.forEach((InvoiceList) => {
|
|
222
|
-
this.SetInvoiceDataInExcel(InvoiceList);
|
|
222
|
+
this.SetInvoiceDataInExcel(InvoiceList, DecimalsNumber);
|
|
223
223
|
});
|
|
224
224
|
}
|
|
225
|
-
static SetInvoiceDataInExcel(InvoiceInfo) {
|
|
225
|
+
static SetInvoiceDataInExcel(InvoiceInfo, DecimalsNumber) {
|
|
226
226
|
var _a, _b, _c, _d, _e, _f;
|
|
227
227
|
// InvoiceInfo.Date = TrUtils.ConvertDateToReadableFormat(InvoiceInfo.CrDate);
|
|
228
228
|
let Vehicle = InvoiceInfo.Make + ' ' + InvoiceInfo.Model + ' ' + InvoiceInfo.Var + ' ' + InvoiceInfo.Year;
|
|
@@ -243,7 +243,7 @@ class InsuranceExpireXlsxFileService {
|
|
|
243
243
|
];
|
|
244
244
|
let ColStart = 0;
|
|
245
245
|
InvoiceData.forEach((InvData) => {
|
|
246
|
-
InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
|
|
246
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
247
247
|
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
248
248
|
this.MergeArray.push({
|
|
249
249
|
s: { r: this.Row, c: ColStart },
|
|
@@ -253,7 +253,7 @@ class InsuranceExpireXlsxFileService {
|
|
|
253
253
|
});
|
|
254
254
|
this.Row += 1;
|
|
255
255
|
}
|
|
256
|
-
static ConvertToString(Text, IsString) {
|
|
256
|
+
static ConvertToString(Text, IsString, DecimalsNumber) {
|
|
257
257
|
if (IsString) {
|
|
258
258
|
if (Text == null) {
|
|
259
259
|
Text = '';
|
|
@@ -265,7 +265,7 @@ class InsuranceExpireXlsxFileService {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
if (typeof Text === 'number') {
|
|
268
|
-
return Number(tr_utils_1.TrUtils.FixedTo(Text));
|
|
268
|
+
return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
|
|
269
269
|
}
|
|
270
270
|
else {
|
|
271
271
|
return Text;
|
|
@@ -13,13 +13,13 @@ export declare class NextServiceDateXlsxFileService {
|
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
static ws: any;
|
|
16
|
-
static GetNextServiceDateExcelData(MainData: any, searchValue: any, HeaderName: any, isDetails: boolean): any;
|
|
16
|
+
static GetNextServiceDateExcelData(MainData: any, searchValue: any, HeaderName: any, isDetails: boolean, EntitySettings: any): any;
|
|
17
17
|
static GetTotals(MainData: any): any;
|
|
18
18
|
static setHeadingInCell(HeaderName: any, showSearch: any, isDetails: boolean): void;
|
|
19
|
-
static setInvoiceDetailsInCell(MainData: any, isDetails: boolean): void;
|
|
20
|
-
static SetInvoiceDataInExcel(InvoiceInfo: any, isDetails: boolean): void;
|
|
19
|
+
static setInvoiceDetailsInCell(MainData: any, isDetails: boolean, DecimalsNumber: number): void;
|
|
20
|
+
static SetInvoiceDataInExcel(InvoiceInfo: any, isDetails: boolean, DecimalsNumber: number): void;
|
|
21
21
|
static ConvertDateToReadableFormat(DateObject: any): any;
|
|
22
|
-
static ConvertToString(Text: any, IsString: any): any;
|
|
22
|
+
static ConvertToString(Text: any, IsString: any, DecimalsNumber: number): any;
|
|
23
23
|
static SetDataInCell(Data: any, ColRange: number, RowNum: any): void;
|
|
24
24
|
static getcelltype(cell: any): any;
|
|
25
25
|
}
|
|
@@ -28,7 +28,7 @@ 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
30
|
class NextServiceDateXlsxFileService {
|
|
31
|
-
static GetNextServiceDateExcelData(MainData, searchValue, HeaderName, isDetails) {
|
|
31
|
+
static GetNextServiceDateExcelData(MainData, searchValue, HeaderName, isDetails, EntitySettings) {
|
|
32
32
|
this.wb = {};
|
|
33
33
|
this.ws = {};
|
|
34
34
|
this.Row = 0;
|
|
@@ -66,7 +66,7 @@ class NextServiceDateXlsxFileService {
|
|
|
66
66
|
}
|
|
67
67
|
MainData = this.GetTotals(MainData);
|
|
68
68
|
this.setHeadingInCell(HeaderName, showSearch, isDetails);
|
|
69
|
-
this.setInvoiceDetailsInCell(MainData, isDetails);
|
|
69
|
+
this.setInvoiceDetailsInCell(MainData, isDetails, EntitySettings.DecimalsNumber);
|
|
70
70
|
this.ws['!ref'] = XLSX.utils.encode_range(this.range);
|
|
71
71
|
this.ws['!merges'] = this.MergeArray;
|
|
72
72
|
this.ws["!cols"] = [{ wch: 50 }, { wch: 10 }, { wch: 10 }, { wch: 10 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 20 }];
|
|
@@ -189,12 +189,12 @@ class NextServiceDateXlsxFileService {
|
|
|
189
189
|
});
|
|
190
190
|
this.Row += 2;
|
|
191
191
|
}
|
|
192
|
-
static setInvoiceDetailsInCell(MainData, isDetails) {
|
|
192
|
+
static setInvoiceDetailsInCell(MainData, isDetails, DecimalsNumber) {
|
|
193
193
|
MainData.forEach((InvoiceList) => {
|
|
194
|
-
this.SetInvoiceDataInExcel(InvoiceList, isDetails);
|
|
194
|
+
this.SetInvoiceDataInExcel(InvoiceList, isDetails, DecimalsNumber);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
-
static SetInvoiceDataInExcel(InvoiceInfo, isDetails) {
|
|
197
|
+
static SetInvoiceDataInExcel(InvoiceInfo, isDetails, DecimalsNumber) {
|
|
198
198
|
var _a;
|
|
199
199
|
InvoiceInfo.LSDate = this.ConvertDateToReadableFormat(InvoiceInfo.LSDate);
|
|
200
200
|
InvoiceInfo.NSDate = this.ConvertDateToReadableFormat(InvoiceInfo.NSDate);
|
|
@@ -210,7 +210,7 @@ class NextServiceDateXlsxFileService {
|
|
|
210
210
|
];
|
|
211
211
|
let ColStart = 0;
|
|
212
212
|
InvoiceData.forEach((InvData) => {
|
|
213
|
-
InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
|
|
213
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
214
214
|
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
215
215
|
this.MergeArray.push({
|
|
216
216
|
s: { r: this.Row, c: ColStart },
|
|
@@ -252,7 +252,7 @@ class NextServiceDateXlsxFileService {
|
|
|
252
252
|
return null;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
static ConvertToString(Text, IsString) {
|
|
255
|
+
static ConvertToString(Text, IsString, DecimalsNumber) {
|
|
256
256
|
if (IsString) {
|
|
257
257
|
if (Text == null) {
|
|
258
258
|
Text = '';
|
|
@@ -264,7 +264,7 @@ class NextServiceDateXlsxFileService {
|
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
if (typeof Text === 'number') {
|
|
267
|
-
return Number(tr_utils_1.TrUtils.FixedTo(Text));
|
|
267
|
+
return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
|
|
268
268
|
}
|
|
269
269
|
else {
|
|
270
270
|
return Text;
|