shareneus 1.5.2 → 1.5.4
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/counter-sales/sales-receipt-print.service.js +9 -9
- package/dist/accounting/credit-note/cn-print.service.js +7 -7
- package/dist/accounting/credit-note/credit-note-totals.service.d.ts +2 -2
- package/dist/accounting/credit-note/credit-note-totals.service.js +33 -33
- package/dist/accounting/debit-note/debit-note-print.service.js +8 -8
- package/dist/accounting/debit-note/debit-note-totals.service.d.ts +2 -2
- package/dist/accounting/debit-note/debit-note-totals.service.js +27 -27
- package/dist/accounting/invoice/inv-pdf.service.js +12 -12
- package/dist/accounting/invoice/inv-print.service.js +11 -11
- package/dist/accounting/invoice/invoice-landscape-pdf.service.js +4 -4
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +12 -12
- package/dist/accounting/invoice/invoice-portrait-pdf.js +5 -5
- package/dist/accounting/invoice/invoice-total.service.d.ts +8 -8
- package/dist/accounting/invoice/invoice-total.service.js +79 -79
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +2 -2
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +4 -4
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +4 -4
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +3 -3
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +3 -3
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +2 -2
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +2 -2
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +2 -2
- package/dist/appointments/appointments/appointment-total.service.js +12 -12
- package/dist/appointments/consultations/consultation-fee-receipt.service.js +2 -2
- package/dist/purchases/purchase-order/po-totals.service.js +13 -13
- package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +1 -1
- package/dist/purchases/purchase-order/purchase-order-totals.service.js +58 -58
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +20 -20
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +7 -7
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +2 -2
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +26 -26
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +4 -4
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +7 -7
- package/dist/sales/delivery-challan/delivery-challan-totals.js +35 -35
- package/dist/sales/sales/sales-print.service.js +9 -9
- package/dist/sales/sales/sales-totals.service.js +32 -32
- package/dist/sales-receive/sales-receive-print.service.js +10 -10
- package/dist/sales-receive/sales-receive-totals.service.d.ts +2 -2
- package/dist/sales-receive/sales-receive-totals.service.js +32 -32
- package/dist/services/est.print-service.js +5 -5
- package/dist/services/ro-print-service.js +13 -13
- package/dist/services/ro-totals.service.d.ts +4 -4
- package/dist/services/ro-totals.service.js +140 -140
- package/dist/shared/math-operations.js +46 -41
- package/dist/shared/shared-pdf.service.js +8 -8
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvoiceLandscapePdfService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
5
5
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
6
6
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
7
7
|
const my_date_1 = require("../../utils/my-date");
|
|
@@ -880,12 +880,12 @@ class InvoiceLandscapePdfService {
|
|
|
880
880
|
let totalDisc;
|
|
881
881
|
let totalTax;
|
|
882
882
|
if (!ROPrintData.Consolidate) {
|
|
883
|
-
totalTax = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
883
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(ROPrintData.CustLaborITax), Number(ROPrintData.CustPartITax), DecimalsNumber));
|
|
884
884
|
if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
|
|
885
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
885
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal), DecimalsNumber));
|
|
886
886
|
}
|
|
887
887
|
else {
|
|
888
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
888
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal), DecimalsNumber));
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
return [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvoiceLetterheadPdfService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
5
5
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
6
6
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
7
7
|
const my_date_1 = require("../../utils/my-date");
|
|
@@ -194,12 +194,12 @@ class InvoiceLetterheadPdfService {
|
|
|
194
194
|
let FinalTotal = 0;
|
|
195
195
|
Parts.forEach((part) => {
|
|
196
196
|
// console.log('part', part);
|
|
197
|
-
Qty = (0,
|
|
198
|
-
CGSTAMT = (0,
|
|
199
|
-
SGSTAMT = (0,
|
|
200
|
-
IGSTAMT = (0,
|
|
201
|
-
Taxable = (0,
|
|
202
|
-
FinalTotal = (0,
|
|
197
|
+
Qty = (0, math_operations_1.Add)(Qty, tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber));
|
|
198
|
+
CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
|
|
199
|
+
SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
|
|
200
|
+
IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
|
|
201
|
+
Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
|
|
202
|
+
FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
|
|
203
203
|
});
|
|
204
204
|
let dpartadding1 = {};
|
|
205
205
|
dpartadding1.SNo = '';
|
|
@@ -313,11 +313,11 @@ class InvoiceLetterheadPdfService {
|
|
|
313
313
|
Labor.forEach((operation) => {
|
|
314
314
|
// console.log('operation', operation);
|
|
315
315
|
// Qty = Qty + operation.Qty;
|
|
316
|
-
CGSTAMT = (0,
|
|
317
|
-
SGSTAMT = (0,
|
|
318
|
-
IGSTAMT = (0,
|
|
319
|
-
Taxable = (0,
|
|
320
|
-
FinalTotal = (0,
|
|
316
|
+
CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
|
|
317
|
+
SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
|
|
318
|
+
IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
|
|
319
|
+
Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
|
|
320
|
+
FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
|
|
321
321
|
});
|
|
322
322
|
let dpartadding1 = {};
|
|
323
323
|
dpartadding1.SNo = '';
|
|
@@ -1,8 +1,8 @@
|
|
|
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");
|
|
5
4
|
const enums_1 = require("../../enums/enums");
|
|
5
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
6
6
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
7
7
|
const my_date_1 = require("../../utils/my-date");
|
|
8
8
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
@@ -605,12 +605,12 @@ class InvoicePortraitPrintService {
|
|
|
605
605
|
let totalDisc;
|
|
606
606
|
let totalTax;
|
|
607
607
|
if (!ROPrintData.Consolidate) {
|
|
608
|
-
totalTax = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
608
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(ROPrintData.CustLaborITax), Number(ROPrintData.CustPartITax)), DecimalsNumber);
|
|
609
609
|
if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
|
|
610
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
610
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal)), DecimalsNumber);
|
|
611
611
|
}
|
|
612
612
|
else {
|
|
613
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
613
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(ROPrintData.CustLaborDiscTotal), Number(ROPrintData.CustPartsDiscTotal)), DecimalsNumber);
|
|
614
614
|
}
|
|
615
615
|
}
|
|
616
616
|
return [
|
|
@@ -665,7 +665,7 @@ class InvoicePortraitPrintService {
|
|
|
665
665
|
}
|
|
666
666
|
else {
|
|
667
667
|
if (!Consolidate) {
|
|
668
|
-
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
668
|
+
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))), DecimalsNumber) });
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
671
|
if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
|
|
@@ -11,9 +11,9 @@ export declare class InvoiceTotalsService {
|
|
|
11
11
|
static GetPartsAfterDiscount1(PartsList: any): number;
|
|
12
12
|
static GetLaborTotalAfterDiscount1(OperationsList: any): number;
|
|
13
13
|
static GetFinalCustomerTotalsData(finalTotalsData: any, LaborList: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Adjust: number, isRoundable: boolean, DecimalsNumber: any): any;
|
|
14
|
-
static GetSubTotalFor(LaborList: any, PartsList: any):
|
|
14
|
+
static GetSubTotalFor(LaborList: any, PartsList: any): number;
|
|
15
15
|
static GetLaborTotalAfterDiscount(LaborList: any): any;
|
|
16
|
-
static GetPartsTotalAfterDiscount(PartsList: any):
|
|
16
|
+
static GetPartsTotalAfterDiscount(PartsList: any): number;
|
|
17
17
|
static GetRetPartsTotalAfterDiscount(PartsList: any): any;
|
|
18
18
|
static GetNonRetPartsTotalAfterDiscount(PartsList: any): any;
|
|
19
19
|
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any, DecimalsNumber: any): any;
|
|
@@ -23,15 +23,15 @@ export declare class InvoiceTotalsService {
|
|
|
23
23
|
static GetTaxGroupingInfoBySAC(FinalMatchedLabors: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
24
24
|
static CompareLaborByPerc(opCodesList: any, TaxCodes: any): any[];
|
|
25
25
|
static ComparePartsByPerc(Parts: any, TaxCodes: any): any[];
|
|
26
|
-
static GetLaborDiscountedTotal(LaborList: any, isTaxable: boolean, finalTotalsData: any):
|
|
27
|
-
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any):
|
|
26
|
+
static GetLaborDiscountedTotal(LaborList: any, isTaxable: boolean, finalTotalsData: any): number;
|
|
27
|
+
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): number;
|
|
28
28
|
static GetLaborTaxTotalFor(opCodesList: any, IsIndependentTax: boolean): any;
|
|
29
|
-
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean):
|
|
29
|
+
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): number;
|
|
30
30
|
static GetRetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
31
31
|
static GetNonRetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
32
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean, Adjust: any):
|
|
33
|
-
static GetRetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean, Adjust: any, DecimalsNumber: any):
|
|
34
|
-
static GetNonRetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean, Adjust: any, DecimalsNumber: any):
|
|
32
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean, Adjust: any): number;
|
|
33
|
+
static GetRetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean, Adjust: any, DecimalsNumber: any): number;
|
|
34
|
+
static GetNonRetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean, Adjust: any, DecimalsNumber: any): number;
|
|
35
35
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc: number, LaborTaxAmount: number, MainLDisc: number, LDiscInPerc: string): number;
|
|
36
36
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
37
37
|
static GetLaborGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): number[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvoiceTotalsService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class InvoiceTotalsService {
|
|
7
7
|
static GetTotalsValue(opCodesList, PartsList, IsIndependentTax, DetailedInfo, LDisc, LPerc, PDisc, PPerc, Disc, Perc, TaxCodes, WithItems, Settings, Adjust, isRoundable, EntitySettings) {
|
|
@@ -39,17 +39,17 @@ class InvoiceTotalsService {
|
|
|
39
39
|
static ResetLaborValues(opCodesList, IsIndependentTax) {
|
|
40
40
|
opCodesList.forEach((Operation) => {
|
|
41
41
|
Operation = this.ResetLaborValueIfInvalid(Operation);
|
|
42
|
-
Operation.DiscountedPrice = (0,
|
|
42
|
+
Operation.DiscountedPrice = (0, math_operations_1.Add)(Operation.Disc, Operation.RecDisc);
|
|
43
43
|
if (tr_utils_1.TrUtils.IsNull(Operation.Amt)) {
|
|
44
44
|
Operation.Amt = Operation.Pr;
|
|
45
45
|
}
|
|
46
46
|
if (IsIndependentTax) {
|
|
47
|
-
let NetAmt = (0,
|
|
47
|
+
let NetAmt = (0, math_operations_1.Subtract)(Operation.Amt, Operation.Disc, Operation.RecDisc);
|
|
48
48
|
Operation.AfterLaborDisc = NetAmt;
|
|
49
|
-
Operation.AfterLaborTax = (0,
|
|
49
|
+
Operation.AfterLaborTax = (0, math_operations_1.Add)(Operation.AfterLaborDisc, Operation.CGST, Operation.SGST, Operation.IGST);
|
|
50
50
|
}
|
|
51
51
|
else {
|
|
52
|
-
Operation.AfterLaborDisc = (0,
|
|
52
|
+
Operation.AfterLaborDisc = (0, math_operations_1.Subtract)(Operation.Amt, Operation.Disc, Operation.RecDisc);
|
|
53
53
|
Operation.AfterLaborTax = Operation.AfterLaborDisc;
|
|
54
54
|
}
|
|
55
55
|
});
|
|
@@ -74,14 +74,14 @@ class InvoiceTotalsService {
|
|
|
74
74
|
static ResetLaborPartValues(PartsList, IsIndependentTax) {
|
|
75
75
|
PartsList.forEach((Part) => {
|
|
76
76
|
Part = this.ResetLaborPartValueIfInvalid(Part);
|
|
77
|
-
Part.DiscountedPrice = (0,
|
|
77
|
+
Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, Part.RecDisc);
|
|
78
78
|
if (IsIndependentTax) {
|
|
79
|
-
let NetAmt = (0,
|
|
79
|
+
let NetAmt = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
80
80
|
Part.AfterPartDisc = NetAmt;
|
|
81
|
-
Part.AfterPartTax = (0,
|
|
81
|
+
Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
|
-
Part.AfterPartDisc = (0,
|
|
84
|
+
Part.AfterPartDisc = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
85
85
|
Part.AfterPartTax = Part.AfterPartDisc;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
@@ -121,7 +121,7 @@ class InvoiceTotalsService {
|
|
|
121
121
|
let AfterIndvidualDisc = 0;
|
|
122
122
|
PartsList.forEach((Part) => {
|
|
123
123
|
if (!Part.Ret) {
|
|
124
|
-
AfterIndvidualDisc = (0,
|
|
124
|
+
AfterIndvidualDisc = (0, math_operations_1.Add)(AfterIndvidualDisc, (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc));
|
|
125
125
|
}
|
|
126
126
|
});
|
|
127
127
|
return AfterIndvidualDisc;
|
|
@@ -132,7 +132,7 @@ class InvoiceTotalsService {
|
|
|
132
132
|
if (tr_utils_1.TrUtils.IsNull(Operation.Amt)) {
|
|
133
133
|
Operation.Amt = Operation.Pr;
|
|
134
134
|
}
|
|
135
|
-
AfterIndvidualDisc = (0,
|
|
135
|
+
AfterIndvidualDisc = (0, math_operations_1.Add)(AfterIndvidualDisc, (0, math_operations_1.Subtract)(Operation.Amt, Operation.Disc));
|
|
136
136
|
});
|
|
137
137
|
return AfterIndvidualDisc;
|
|
138
138
|
}
|
|
@@ -148,20 +148,20 @@ class InvoiceTotalsService {
|
|
|
148
148
|
let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
149
149
|
let CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
150
150
|
// if (IsIndependentTax) {
|
|
151
|
-
finalTotalsData.STotal = (0,
|
|
151
|
+
finalTotalsData.STotal = (0, math_operations_1.Add)(CustLaborDiscTotal, CustPartsDiscTotal, CustLaborTotalAfterDisc, CustPartsTotalAfterDisc);
|
|
152
152
|
// } else {
|
|
153
|
-
// finalTotalsData.STotal =
|
|
153
|
+
// finalTotalsData.STotal = Add(CustLaborTotalAfterDisc, CustPartsTotalAfterDisc);
|
|
154
154
|
// }
|
|
155
155
|
let CustLaborTotalAfterDisc1 = this.GetLaborTotalAfterDiscount1(LaborList);
|
|
156
156
|
let CustPartsTotalAfterDisc1 = this.GetPartsAfterDiscount1(PartsList);
|
|
157
|
-
let AmtAfterIndvidualItemDisc = (0,
|
|
157
|
+
let AmtAfterIndvidualItemDisc = (0, math_operations_1.Add)(CustLaborTotalAfterDisc1, CustPartsTotalAfterDisc1);
|
|
158
158
|
finalTotalsData.SIndTotal = AmtAfterIndvidualItemDisc;
|
|
159
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);
|
|
163
163
|
if (isRoundable) {
|
|
164
|
-
finalTotalsData.Round = (0,
|
|
164
|
+
finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
|
|
165
165
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
166
166
|
}
|
|
167
167
|
else {
|
|
@@ -179,12 +179,12 @@ class InvoiceTotalsService {
|
|
|
179
179
|
static GetSubTotalFor(LaborList, PartsList) {
|
|
180
180
|
let LaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
181
181
|
let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
182
|
-
return (0,
|
|
182
|
+
return (0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc);
|
|
183
183
|
}
|
|
184
184
|
static GetLaborTotalAfterDiscount(LaborList) {
|
|
185
185
|
let LaborTotalAfterDisc = 0;
|
|
186
186
|
LaborList.forEach((Labor) => {
|
|
187
|
-
LaborTotalAfterDisc = (0,
|
|
187
|
+
LaborTotalAfterDisc = (0, math_operations_1.Add)(LaborTotalAfterDisc, Labor.AfterLaborDisc);
|
|
188
188
|
});
|
|
189
189
|
return LaborTotalAfterDisc;
|
|
190
190
|
}
|
|
@@ -193,19 +193,19 @@ class InvoiceTotalsService {
|
|
|
193
193
|
let RetPartsTotalAfterDisc = 0;
|
|
194
194
|
PartsList.forEach((Part) => {
|
|
195
195
|
if (Part.Ret === true) {
|
|
196
|
-
RetPartsTotalAfterDisc = (0,
|
|
196
|
+
RetPartsTotalAfterDisc = (0, math_operations_1.Add)(RetPartsTotalAfterDisc, Part.AfterPartDisc);
|
|
197
197
|
}
|
|
198
198
|
else {
|
|
199
|
-
PartsTotalAfterDisc = (0,
|
|
199
|
+
PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
|
|
200
200
|
}
|
|
201
201
|
});
|
|
202
|
-
return (0,
|
|
202
|
+
return (0, math_operations_1.Subtract)(PartsTotalAfterDisc, RetPartsTotalAfterDisc);
|
|
203
203
|
}
|
|
204
204
|
static GetRetPartsTotalAfterDiscount(PartsList) {
|
|
205
205
|
let RetPartsTotalAfterDisc = 0;
|
|
206
206
|
PartsList.forEach((Part) => {
|
|
207
207
|
if (Part.Ret === true) {
|
|
208
|
-
RetPartsTotalAfterDisc = (0,
|
|
208
|
+
RetPartsTotalAfterDisc = (0, math_operations_1.Add)(RetPartsTotalAfterDisc, Part.AfterPartDisc);
|
|
209
209
|
}
|
|
210
210
|
});
|
|
211
211
|
return RetPartsTotalAfterDisc;
|
|
@@ -214,7 +214,7 @@ class InvoiceTotalsService {
|
|
|
214
214
|
let NonRetPartsTotalAfterDisc = 0;
|
|
215
215
|
PartsList.forEach((Part) => {
|
|
216
216
|
if (tr_utils_1.TrUtils.IsNull(Part.Ret) || Part.Ret === false) {
|
|
217
|
-
NonRetPartsTotalAfterDisc = (0,
|
|
217
|
+
NonRetPartsTotalAfterDisc = (0, math_operations_1.Add)(NonRetPartsTotalAfterDisc, Part.AfterPartDisc);
|
|
218
218
|
}
|
|
219
219
|
});
|
|
220
220
|
return NonRetPartsTotalAfterDisc;
|
|
@@ -224,9 +224,9 @@ class InvoiceTotalsService {
|
|
|
224
224
|
finalTotalsData.CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
|
|
225
225
|
finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
226
226
|
finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
227
|
-
finalTotalsData.CustLaborTotalBeforeDisc = (0,
|
|
227
|
+
finalTotalsData.CustLaborTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustLaborTotalAfterDisc, finalTotalsData.CustLaborDiscTotal);
|
|
228
228
|
if (IsIndependentTax) {
|
|
229
|
-
finalTotalsData.CustPartsTotalBeforeDisc = (0,
|
|
229
|
+
finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
|
|
230
230
|
}
|
|
231
231
|
else {
|
|
232
232
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartsTotalAfterDisc;
|
|
@@ -241,8 +241,8 @@ class InvoiceTotalsService {
|
|
|
241
241
|
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[0]);
|
|
242
242
|
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[2]);
|
|
243
243
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[1]);
|
|
244
|
-
finalTotalsData.CustLaborAfterTax = (0,
|
|
245
|
-
finalTotalsData.CustPartAfterTax = (0,
|
|
244
|
+
finalTotalsData.CustLaborAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
245
|
+
finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
246
246
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
247
247
|
finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
|
|
248
248
|
finalTotalsData.CustLaborTaxGroupDataByPerc = this.GetTaxGroupingForLaborByPerc(opCodesList, TaxCodes, DecimalsNumber);
|
|
@@ -273,14 +273,14 @@ class InvoiceTotalsService {
|
|
|
273
273
|
combined.forEach(item => {
|
|
274
274
|
if (groupedMap.has(item.CombinedTaxPercentage)) {
|
|
275
275
|
const existing = groupedMap.get(item.CombinedTaxPercentage);
|
|
276
|
-
existing.CGSTAmt = (0,
|
|
277
|
-
existing.SGSTAmt = (0,
|
|
276
|
+
existing.CGSTAmt = (0, math_operations_1.Add)(existing.CGSTAmt, item.CGSTAmt);
|
|
277
|
+
existing.SGSTAmt = (0, math_operations_1.Add)(existing.SGSTAmt, item.SGSTAmt);
|
|
278
278
|
// Sum IGST if present
|
|
279
279
|
if (item.IGSTAmt !== undefined) {
|
|
280
|
-
existing.IGSTAmt = (0,
|
|
280
|
+
existing.IGSTAmt = (0, math_operations_1.Add)(existing.IGSTAmt || 0, item.IGSTAmt);
|
|
281
281
|
}
|
|
282
|
-
existing.TotalTaxAmount = (0,
|
|
283
|
-
existing.TotalTaxableAmount = (0,
|
|
282
|
+
existing.TotalTaxAmount = (0, math_operations_1.Add)(existing.TotalTaxAmount || 0, item.TotalTaxAmount || 0);
|
|
283
|
+
existing.TotalTaxableAmount = (0, math_operations_1.Add)(existing.TotalTaxableAmount || 0, item.TotalTaxableAmount || 0);
|
|
284
284
|
}
|
|
285
285
|
else {
|
|
286
286
|
// Clone the object to avoid mutation
|
|
@@ -313,13 +313,13 @@ class InvoiceTotalsService {
|
|
|
313
313
|
let SAC = MatchedLabor[0].SAC;
|
|
314
314
|
TaxInfo.CombinedTaxPercentage = MatchedLabor[0].CombinedTaxPercentage;
|
|
315
315
|
MatchedLabor === null || MatchedLabor === void 0 ? void 0 : MatchedLabor.forEach((argMatchedGSTLabor) => {
|
|
316
|
-
TaxOnAmount = (0,
|
|
317
|
-
TaxAmount = (0,
|
|
318
|
-
TaxAmount = (0,
|
|
319
|
-
TaxAmount = (0,
|
|
320
|
-
CGSTAmt = (0,
|
|
321
|
-
SGSTAmt = (0,
|
|
322
|
-
IGSTAmt = (0,
|
|
316
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.AfterLaborDisc, DecimalsNumber));
|
|
317
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.CGST, DecimalsNumber));
|
|
318
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.IGST, DecimalsNumber));
|
|
319
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.SGST, DecimalsNumber));
|
|
320
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.CGST, DecimalsNumber));
|
|
321
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.SGST, DecimalsNumber));
|
|
322
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.IGST, DecimalsNumber));
|
|
323
323
|
});
|
|
324
324
|
TaxInfo.SAC = SAC;
|
|
325
325
|
TaxInfo.CGSTAmt = CGSTAmt;
|
|
@@ -407,10 +407,10 @@ class InvoiceTotalsService {
|
|
|
407
407
|
// overallLaborDisc = TrUtils.SetValueToZeroIfNull(finalTotalsData.LDisc)
|
|
408
408
|
// } else {
|
|
409
409
|
LaborList.forEach((Labor) => {
|
|
410
|
-
LaborDiscountedTotal = (0,
|
|
410
|
+
LaborDiscountedTotal = (0, math_operations_1.Add)(LaborDiscountedTotal, Labor.DiscountedPrice);
|
|
411
411
|
});
|
|
412
412
|
// }
|
|
413
|
-
return (0,
|
|
413
|
+
return (0, math_operations_1.Add)(LaborDiscountedTotal, overallLaborDisc);
|
|
414
414
|
}
|
|
415
415
|
static GetPartDiscountedTotal(PartsList, isTaxable, finalTotalsData) {
|
|
416
416
|
let PartsDiscountedTotal = 0;
|
|
@@ -421,20 +421,20 @@ class InvoiceTotalsService {
|
|
|
421
421
|
// } else {
|
|
422
422
|
PartsList.forEach((Part) => {
|
|
423
423
|
if (Part.Ret === true) {
|
|
424
|
-
RetPartsDiscountedTotal = (0,
|
|
424
|
+
RetPartsDiscountedTotal = (0, math_operations_1.Add)(RetPartsDiscountedTotal, Part.DiscountedPrice);
|
|
425
425
|
}
|
|
426
426
|
else {
|
|
427
|
-
PartsDiscountedTotal = (0,
|
|
427
|
+
PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
428
428
|
}
|
|
429
429
|
});
|
|
430
430
|
// }
|
|
431
|
-
return (0,
|
|
431
|
+
return (0, math_operations_1.Add)((0, math_operations_1.Subtract)(PartsDiscountedTotal, RetPartsDiscountedTotal), overallPartDisc);
|
|
432
432
|
}
|
|
433
433
|
static GetLaborTaxTotalFor(opCodesList, IsIndependentTax) {
|
|
434
434
|
let TotalTaxAmt = 0;
|
|
435
435
|
if (IsIndependentTax) {
|
|
436
436
|
opCodesList.forEach((Labor) => {
|
|
437
|
-
TotalTaxAmt = (0,
|
|
437
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST, Labor.SGST, Labor.IGST);
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
return TotalTaxAmt;
|
|
@@ -445,21 +445,21 @@ class InvoiceTotalsService {
|
|
|
445
445
|
if (IsIndependentTax) {
|
|
446
446
|
PartsList.forEach((Part) => {
|
|
447
447
|
if (Part.Ret === true) {
|
|
448
|
-
RetTotalTaxAmt = (0,
|
|
448
|
+
RetTotalTaxAmt = (0, math_operations_1.Add)(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
449
449
|
}
|
|
450
450
|
else {
|
|
451
|
-
TotalTaxAmt = (0,
|
|
451
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
452
452
|
}
|
|
453
453
|
});
|
|
454
454
|
}
|
|
455
|
-
return (0,
|
|
455
|
+
return (0, math_operations_1.Subtract)(TotalTaxAmt, RetTotalTaxAmt);
|
|
456
456
|
}
|
|
457
457
|
static GetRetPartsTaxTotalFor(PartsList, IsIndependentTax) {
|
|
458
458
|
let RetTotalTaxAmt = 0;
|
|
459
459
|
if (IsIndependentTax) {
|
|
460
460
|
PartsList.forEach((Part) => {
|
|
461
461
|
if (Part.Ret === true) {
|
|
462
|
-
RetTotalTaxAmt = (0,
|
|
462
|
+
RetTotalTaxAmt = (0, math_operations_1.Add)(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
463
463
|
}
|
|
464
464
|
});
|
|
465
465
|
}
|
|
@@ -470,7 +470,7 @@ class InvoiceTotalsService {
|
|
|
470
470
|
if (IsIndependentTax) {
|
|
471
471
|
PartsList.forEach((Part) => {
|
|
472
472
|
if (tr_utils_1.TrUtils.IsNull(Part.Ret) || Part.Ret === false) {
|
|
473
|
-
NonRetTotalTaxAmt = (0,
|
|
473
|
+
NonRetTotalTaxAmt = (0, math_operations_1.Add)(NonRetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
474
474
|
}
|
|
475
475
|
});
|
|
476
476
|
}
|
|
@@ -480,52 +480,52 @@ class InvoiceTotalsService {
|
|
|
480
480
|
let LaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
481
481
|
let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
482
482
|
if (IsIndependentTax) {
|
|
483
|
-
return (0,
|
|
483
|
+
return (0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount, Adjust);
|
|
484
484
|
}
|
|
485
485
|
else {
|
|
486
|
-
return (0,
|
|
486
|
+
return (0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc, Adjust);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
489
|
static GetRetCustomerTotalBasedOnTaxType(finalTotalsData, LaborTaxAmount, PartsTaxAmount, LaborList, PartsList, IsIndependentTax, Adjust, DecimalsNumber) {
|
|
490
490
|
let LaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
491
491
|
let PartsTotalAfterDisc = this.GetRetPartsTotalAfterDiscount(PartsList);
|
|
492
492
|
if (IsIndependentTax) {
|
|
493
|
-
return (0,
|
|
493
|
+
return (0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
|
|
494
494
|
}
|
|
495
495
|
else {
|
|
496
|
-
return tr_utils_1.TrUtils.FixedTo((0,
|
|
496
|
+
return tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc), DecimalsNumber);
|
|
497
497
|
}
|
|
498
498
|
}
|
|
499
499
|
static GetNonRetCustomerTotalBasedOnTaxType(finalTotalsData, LaborTaxAmount, PartsTaxAmount, LaborList, PartsList, IsIndependentTax, Adjust, DecimalsNumber) {
|
|
500
500
|
let LaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
501
501
|
let PartsTotalAfterDisc = this.GetNonRetPartsTotalAfterDiscount(PartsList);
|
|
502
502
|
if (IsIndependentTax) {
|
|
503
|
-
return (0,
|
|
503
|
+
return (0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
|
|
504
504
|
}
|
|
505
505
|
else {
|
|
506
|
-
return tr_utils_1.TrUtils.FixedTo((0,
|
|
506
|
+
return tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(LaborTotalAfterDisc, PartsTotalAfterDisc), DecimalsNumber);
|
|
507
507
|
}
|
|
508
508
|
}
|
|
509
509
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
|
|
510
|
-
let LaborTotal = (0,
|
|
510
|
+
let LaborTotal = (0, math_operations_1.Add)(LaborTotalAfterDisc, LaborTaxAmount);
|
|
511
511
|
if (!tr_utils_1.TrUtils.IsZero(MainLDisc)) {
|
|
512
512
|
if (!tr_utils_1.TrUtils.IsEmpty(LDiscInPerc)) {
|
|
513
|
-
LaborTotal = (0,
|
|
513
|
+
LaborTotal = (0, math_operations_1.Subtract)(LaborTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(LaborTotal, Number(LDiscInPerc)), 100));
|
|
514
514
|
}
|
|
515
515
|
else {
|
|
516
|
-
LaborTotal = (0,
|
|
516
|
+
LaborTotal = (0, math_operations_1.Subtract)(LaborTotal, MainLDisc);
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
return LaborTotal;
|
|
520
520
|
}
|
|
521
521
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
522
|
-
let ItemsTotal = (0,
|
|
522
|
+
let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
523
523
|
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
524
524
|
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
525
|
-
ItemsTotal = (0,
|
|
525
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
526
526
|
}
|
|
527
527
|
else {
|
|
528
|
-
ItemsTotal = (0,
|
|
528
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
return ItemsTotal;
|
|
@@ -537,10 +537,10 @@ class InvoiceTotalsService {
|
|
|
537
537
|
let TotalTaxAmt = 0;
|
|
538
538
|
if (IsIndependentTax) {
|
|
539
539
|
opCodesList.forEach((Labor) => {
|
|
540
|
-
TotalCGSTAmt = (0,
|
|
541
|
-
TotalSGSTAmt = (0,
|
|
542
|
-
TotalIGSTAmt = (0,
|
|
543
|
-
TotalTaxAmt = (0,
|
|
540
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Labor.CGST);
|
|
541
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Labor.SGST);
|
|
542
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Labor.IGST);
|
|
543
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST, Labor.SGST, Labor.IGST);
|
|
544
544
|
});
|
|
545
545
|
}
|
|
546
546
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
@@ -555,14 +555,14 @@ class InvoiceTotalsService {
|
|
|
555
555
|
if (IsIndependentTax) {
|
|
556
556
|
PartsList.forEach((Part) => {
|
|
557
557
|
if (Part.Ret === true) {
|
|
558
|
-
RetTotalCGSTAmt = (0,
|
|
559
|
-
RetTotalSGSTAmt = (0,
|
|
560
|
-
RetTotalIGSTAmt = (0,
|
|
558
|
+
RetTotalCGSTAmt = (0, math_operations_1.Add)(RetTotalCGSTAmt, Part.CGST);
|
|
559
|
+
RetTotalSGSTAmt = (0, math_operations_1.Add)(RetTotalSGSTAmt, Part.SGST);
|
|
560
|
+
RetTotalIGSTAmt = (0, math_operations_1.Add)(RetTotalIGSTAmt, Part.IGST);
|
|
561
561
|
}
|
|
562
562
|
else {
|
|
563
|
-
TotalCGSTAmt = (0,
|
|
564
|
-
TotalSGSTAmt = (0,
|
|
565
|
-
TotalIGSTAmt = (0,
|
|
563
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
|
|
564
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
|
|
565
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
|
|
566
566
|
}
|
|
567
567
|
});
|
|
568
568
|
}
|
|
@@ -586,7 +586,7 @@ class InvoiceTotalsService {
|
|
|
586
586
|
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
587
587
|
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
588
588
|
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
589
|
-
Part.CombinedTaxPercentage = (0,
|
|
589
|
+
Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
590
590
|
});
|
|
591
591
|
return Parts;
|
|
592
592
|
}
|
|
@@ -633,13 +633,13 @@ class InvoiceTotalsService {
|
|
|
633
633
|
let HSN = MatchedPart[0].HSN;
|
|
634
634
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
635
635
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
636
|
-
TaxOnAmount = (0,
|
|
637
|
-
TaxAmount = (0,
|
|
638
|
-
TaxAmount = (0,
|
|
639
|
-
TaxAmount = (0,
|
|
640
|
-
CGSTAmt = (0,
|
|
641
|
-
SGSTAmt = (0,
|
|
642
|
-
IGSTAmt = (0,
|
|
636
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
|
|
637
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
638
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
639
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
640
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
641
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
642
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
643
643
|
});
|
|
644
644
|
TaxInfo.HSN = HSN;
|
|
645
645
|
TaxInfo.CGSTAmt = CGSTAmt;
|
|
@@ -27,7 +27,7 @@ exports.ItemsWiseSalesXlsxFileService = 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
|
|
30
|
+
const math_operations_1 = require("../../../../shared/math-operations");
|
|
31
31
|
class ItemsWiseSalesXlsxFileService {
|
|
32
32
|
static GetItemsWiseSalesExcelData(MainData, isSale, searchValue, HeaderName, EntitySettings) {
|
|
33
33
|
this.wb = {};
|
|
@@ -213,7 +213,7 @@ class ItemsWiseSalesXlsxFileService {
|
|
|
213
213
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.UnAmt, DecimalsNumber), ColRange: 1, IsString: false },
|
|
214
214
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Disc, DecimalsNumber), ColRange: 1, IsString: false },
|
|
215
215
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Tax, DecimalsNumber), ColRange: 1, IsString: false },
|
|
216
|
-
{ text: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
216
|
+
{ text: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(InvoiceInfo.NetAmt, InvoiceInfo.Tax), DecimalsNumber), ColRange: 1, IsString: false },
|
|
217
217
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.AvgPr, DecimalsNumber), ColRange: 1, IsString: false },
|
|
218
218
|
// { text: InvoiceInfo.Items.UnPr, ColRange: 1, IsString: false },
|
|
219
219
|
// { text: InvoiceInfo.Items.UnAmt, ColRange: 1, IsString: false },
|
|
@@ -27,7 +27,7 @@ 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
|
|
30
|
+
const math_operations_1 = require("../../../../shared/math-operations");
|
|
31
31
|
class ServiceAdvisorWiseLaborXlsxFileService {
|
|
32
32
|
static GetServiceAdvisorLaborsExcelData(MainData, EntitySettings) {
|
|
33
33
|
this.wb = {};
|
|
@@ -148,9 +148,9 @@ class ServiceAdvisorWiseLaborXlsxFileService {
|
|
|
148
148
|
static SetWorkOrderDataInExcel(WorkOrder, index, DecimalsNumber) {
|
|
149
149
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
150
150
|
WorkOrder.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(WorkOrder.CrDate);
|
|
151
|
-
WorkOrder.Discount = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
152
|
-
WorkOrder.Tax = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
153
|
-
WorkOrder.Total = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
151
|
+
WorkOrder.Discount = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(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, math_operations_1.Add)((_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, math_operations_1.Add)((_f = WorkOrder.Ops) === null || _f === void 0 ? void 0 : _f.NetAmt, Number(WorkOrder.Tax)), DecimalsNumber);
|
|
154
154
|
// if(!TrUtils.IsNull(WorkOrder.Prod) && !TrUtils.IsNull(WorkOrder.Prod.DDate)){
|
|
155
155
|
// WorkOrder.Prod.DDate= TrUtils.ConvertDateToReadableFormat(WorkOrder.Prod.DDate);
|
|
156
156
|
// }else{
|