shareneus 1.5.1 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +8 -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/sales-receive/sales-total-calculation.js +1 -1
- 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.VendorCreditNoteTotalsService = 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 VendorCreditNoteTotalsService {
|
|
7
7
|
static GetTotalsValue(opCodesList, ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
|
|
@@ -33,10 +33,10 @@ class VendorCreditNoteTotalsService {
|
|
|
33
33
|
static ResetLaborItemValues(ItemsList, IsIndependentTax) {
|
|
34
34
|
ItemsList.forEach((Item) => {
|
|
35
35
|
Item = this.ResetLaborItemValueIfInvalid(Item);
|
|
36
|
-
Item.DiscountedPrice = (0,
|
|
37
|
-
Item.AfterItemDisc = (0,
|
|
36
|
+
Item.DiscountedPrice = (0, math_operations_1.Add)(Item.Disc, Item.RecDisc);
|
|
37
|
+
Item.AfterItemDisc = (0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc, Item.RecDisc);
|
|
38
38
|
if (IsIndependentTax) {
|
|
39
|
-
Item.AfterItemTax = (0,
|
|
39
|
+
Item.AfterItemTax = (0, math_operations_1.Add)(Item.AfterItemDisc, Item.CGST, Item.SGST, Item.IGST);
|
|
40
40
|
}
|
|
41
41
|
else {
|
|
42
42
|
Item.AfterItemTax = Item.AfterItemDisc;
|
|
@@ -83,9 +83,9 @@ class VendorCreditNoteTotalsService {
|
|
|
83
83
|
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData, DecimalsNumber);
|
|
84
84
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
85
85
|
let CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
86
|
-
finalTotalsData.STotal = tr_utils_1.TrUtils.FixedTo((0,
|
|
86
|
+
finalTotalsData.STotal = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(CustItemsDiscTotal, CustItemsTotalAfterDisc), DecimalsNumber);
|
|
87
87
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, CustItemTaxTotal, [], ItemsList, IsIndependentTax, DecimalsNumber);
|
|
88
|
-
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0,
|
|
88
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
89
89
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
90
90
|
if (DetailedInfo) {
|
|
91
91
|
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
@@ -112,7 +112,7 @@ class VendorCreditNoteTotalsService {
|
|
|
112
112
|
finalTotalsData.CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
113
113
|
// finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
|
|
114
114
|
// + finalTotalsData.CustLaborDiscTotal);
|
|
115
|
-
finalTotalsData.CustItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0,
|
|
115
|
+
finalTotalsData.CustItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(finalTotalsData.CustItemsTotalAfterDisc, finalTotalsData.CustItemsDiscTotal), DecimalsNumber);
|
|
116
116
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
117
117
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
118
118
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -127,7 +127,7 @@ class VendorCreditNoteTotalsService {
|
|
|
127
127
|
// finalTotalsData.CustItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
128
128
|
// finalTotalsData.CustItemSGST = this.GetItemSGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
129
129
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
130
|
-
finalTotalsData.CustItemAfterTax = tr_utils_1.TrUtils.FixedTo((0,
|
|
130
|
+
finalTotalsData.CustItemAfterTax = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc), DecimalsNumber);
|
|
131
131
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
132
132
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
133
133
|
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
@@ -150,7 +150,7 @@ class VendorCreditNoteTotalsService {
|
|
|
150
150
|
ItemsList.forEach((Item) => {
|
|
151
151
|
ItemsDiscountedTotal += Item.DiscountedPrice;
|
|
152
152
|
});
|
|
153
|
-
return tr_utils_1.TrUtils.FixedTo(((0,
|
|
153
|
+
return tr_utils_1.TrUtils.FixedTo(((0, math_operations_1.Add)(ItemsDiscountedTotal, overallItemDisc)), DecimalsNumber);
|
|
154
154
|
}
|
|
155
155
|
static GetLaborTaxTotalFor(opCodesList, IsIndependentTax) {
|
|
156
156
|
let TotalTaxAmt = 0;
|
|
@@ -174,10 +174,10 @@ class VendorCreditNoteTotalsService {
|
|
|
174
174
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
175
175
|
let ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
176
176
|
if (IsIndependentTax) {
|
|
177
|
-
return (0,
|
|
177
|
+
return (0, math_operations_1.Add)(ItemsTotalAfterDisc, LaborTaxAmount, ItemsTaxAmount);
|
|
178
178
|
}
|
|
179
179
|
else {
|
|
180
|
-
return tr_utils_1.TrUtils.FixedTo((0,
|
|
180
|
+
return tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(ItemsTotalAfterDisc, finalTotalsData.Disc), DecimalsNumber);
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
|
|
@@ -211,10 +211,10 @@ class VendorCreditNoteTotalsService {
|
|
|
211
211
|
let TotalTaxAmt = 0;
|
|
212
212
|
if (IsIndependentTax) {
|
|
213
213
|
ItemsList.forEach((Item) => {
|
|
214
|
-
TotalCGSTAmt = (0,
|
|
215
|
-
TotalSGSTAmt = (0,
|
|
216
|
-
TotalIGSTAmt = (0,
|
|
217
|
-
TotalTaxAmt = (0,
|
|
214
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Item.CGST);
|
|
215
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Item.SGST);
|
|
216
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Item.IGST);
|
|
217
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
@@ -234,7 +234,7 @@ class VendorCreditNoteTotalsService {
|
|
|
234
234
|
Item.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
235
235
|
Item.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
236
236
|
Item.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
237
|
-
Item.CombinedTaxPercentage = (0,
|
|
237
|
+
Item.CombinedTaxPercentage = (0, math_operations_1.Add)(Item.CGSTAmt, Item.SGSTAmt, Item.IGSTAmt);
|
|
238
238
|
});
|
|
239
239
|
return Items;
|
|
240
240
|
}
|
|
@@ -278,10 +278,10 @@ class VendorCreditNoteTotalsService {
|
|
|
278
278
|
let HSN = MatchedItem[0].HSN;
|
|
279
279
|
TaxInfo.CombinedTaxPercentage = MatchedItem[0].CombinedTaxPercentage;
|
|
280
280
|
MatchedItem.forEach((argMatchedGSTItem) => {
|
|
281
|
-
TaxOnAmount = (0,
|
|
282
|
-
TaxAmount = (0,
|
|
283
|
-
TaxAmount = (0,
|
|
284
|
-
TaxAmount = (0,
|
|
281
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, argMatchedGSTItem.AfterItemDisc);
|
|
282
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.CGST);
|
|
283
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.IGST);
|
|
284
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.SGST);
|
|
285
285
|
});
|
|
286
286
|
TaxInfo.HSN = HSN;
|
|
287
287
|
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
@@ -5,9 +5,9 @@ const my_date_1 = require("../../utils/my-date");
|
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
const enums_1 = require("../../enums/enums");
|
|
7
7
|
const code_enums_1 = require("../../enums/code-enums");
|
|
8
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
9
8
|
const debit_note_totals_service_1 = require("../../accounting/debit-note/debit-note-totals.service");
|
|
10
9
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
10
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
11
11
|
class VendorDebitNotePrintService {
|
|
12
12
|
static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma) {
|
|
13
13
|
var _a, _b;
|
|
@@ -106,11 +106,11 @@ class VendorDebitNotePrintService {
|
|
|
106
106
|
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
107
107
|
Items.forEach((Item) => {
|
|
108
108
|
if (Consolidate) {
|
|
109
|
-
let AfterDiscForEach = (0,
|
|
110
|
-
let CTaxAmtPerItem = (0,
|
|
111
|
-
let STaxAmtPerItem = (0,
|
|
112
|
-
let ITaxAmtPerItem = (0,
|
|
113
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0,
|
|
109
|
+
let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
|
|
110
|
+
let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
|
|
111
|
+
let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
|
|
112
|
+
let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
|
|
113
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
116
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -125,7 +125,7 @@ class VendorDebitNotePrintService {
|
|
|
125
125
|
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
128
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
129
129
|
}
|
|
130
130
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
131
131
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -9,9 +9,9 @@ export declare class VendorDebitNoteTotalsService {
|
|
|
9
9
|
static GetSubTotalFor(ItemsList: any): any;
|
|
10
10
|
static GetItemsTotalAfterDiscount(ItemsList: any): any;
|
|
11
11
|
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
12
|
-
static GetItemDiscountedTotal(ItemsList: any, isTaxable: boolean, finalTotalsData: any):
|
|
12
|
+
static GetItemDiscountedTotal(ItemsList: any, isTaxable: boolean, finalTotalsData: any): number;
|
|
13
13
|
static GetItemsTaxTotalFor(ItemsList: any, IsIndependentTax: boolean): any;
|
|
14
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, ItemsTaxAmount: number, ItemsList: any, IsIndependentTax: boolean):
|
|
14
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, ItemsTaxAmount: number, ItemsList: any, IsIndependentTax: boolean): number;
|
|
15
15
|
static ItemsTotalAfterDiscount(ItemsTotalAfterDisc: number, ItemsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
16
16
|
static GetItemGSTTaxTotal(ItemsList: any, IsIndependentTax: boolean): number[];
|
|
17
17
|
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VendorDebitNoteTotalsService = 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 VendorDebitNoteTotalsService {
|
|
7
7
|
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
|
|
@@ -36,10 +36,10 @@ class VendorDebitNoteTotalsService {
|
|
|
36
36
|
if (tr_utils_1.TrUtils.IsZero(Item.Qty)) {
|
|
37
37
|
Item.Qty = 1;
|
|
38
38
|
}
|
|
39
|
-
Item.DiscountedPrice = (0,
|
|
39
|
+
Item.DiscountedPrice = (0, math_operations_1.Add)(Item.Disc, Item.RecDisc);
|
|
40
40
|
Item.AfterItemDisc = Item.NetAmt;
|
|
41
41
|
if (IsIndependentTax) {
|
|
42
|
-
Item.AfterItemTax = (0,
|
|
42
|
+
Item.AfterItemTax = (0, math_operations_1.Add)(Item.AfterItemDisc, Item.CGST, Item.SGST, Item.IGST);
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
Item.AfterItemTax = Item.AfterItemDisc;
|
|
@@ -86,9 +86,9 @@ class VendorDebitNoteTotalsService {
|
|
|
86
86
|
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
87
87
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
88
88
|
let CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
89
|
-
finalTotalsData.STotal = (0,
|
|
89
|
+
finalTotalsData.STotal = (0, math_operations_1.Add)(CustItemsDiscTotal, CustItemsTotalAfterDisc);
|
|
90
90
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustItemTaxTotal, ItemsList, IsIndependentTax);
|
|
91
|
-
finalTotalsData.Round = (0,
|
|
91
|
+
finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
|
|
92
92
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
93
93
|
if (DetailedInfo) {
|
|
94
94
|
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
@@ -104,7 +104,7 @@ class VendorDebitNoteTotalsService {
|
|
|
104
104
|
static GetItemsTotalAfterDiscount(ItemsList) {
|
|
105
105
|
let ItemsTotalAfterDisc = 0;
|
|
106
106
|
ItemsList.forEach((Item) => {
|
|
107
|
-
ItemsTotalAfterDisc = (0,
|
|
107
|
+
ItemsTotalAfterDisc = (0, math_operations_1.Add)(ItemsTotalAfterDisc, Item.AfterItemDisc);
|
|
108
108
|
});
|
|
109
109
|
return ItemsTotalAfterDisc;
|
|
110
110
|
}
|
|
@@ -115,7 +115,7 @@ class VendorDebitNoteTotalsService {
|
|
|
115
115
|
finalTotalsData.CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
116
116
|
// finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
|
|
117
117
|
// + finalTotalsData.CustLaborDiscTotal);
|
|
118
|
-
finalTotalsData.CustItemsTotalBeforeDisc = (0,
|
|
118
|
+
finalTotalsData.CustItemsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustItemsTotalAfterDisc, finalTotalsData.CustItemsDiscTotal);
|
|
119
119
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
120
120
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
121
121
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -129,8 +129,8 @@ class VendorDebitNoteTotalsService {
|
|
|
129
129
|
// finalTotalsData.CustItemCGST = this.GetItemCGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
130
130
|
// finalTotalsData.CustItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
131
131
|
// finalTotalsData.CustItemSGST = this.GetItemSGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
132
|
-
// finalTotalsData.CustLaborAfterTax =
|
|
133
|
-
finalTotalsData.CustItemAfterTax = (0,
|
|
132
|
+
// finalTotalsData.CustLaborAfterTax = Add(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
|
|
133
|
+
finalTotalsData.CustItemAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
|
|
134
134
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
135
135
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
136
136
|
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
@@ -151,15 +151,15 @@ class VendorDebitNoteTotalsService {
|
|
|
151
151
|
overallItemDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
152
152
|
}
|
|
153
153
|
ItemsList.forEach((Item) => {
|
|
154
|
-
ItemsDiscountedTotal = (0,
|
|
154
|
+
ItemsDiscountedTotal = (0, math_operations_1.Add)(ItemsDiscountedTotal, Item.DiscountedPrice);
|
|
155
155
|
});
|
|
156
|
-
return (0,
|
|
156
|
+
return (0, math_operations_1.Add)(ItemsDiscountedTotal, overallItemDisc);
|
|
157
157
|
}
|
|
158
158
|
static GetItemsTaxTotalFor(ItemsList, IsIndependentTax) {
|
|
159
159
|
let TotalTaxAmt = 0;
|
|
160
160
|
if (IsIndependentTax) {
|
|
161
161
|
ItemsList.forEach((Item) => {
|
|
162
|
-
TotalTaxAmt = (0,
|
|
162
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
return TotalTaxAmt;
|
|
@@ -168,20 +168,20 @@ class VendorDebitNoteTotalsService {
|
|
|
168
168
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
169
169
|
let ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
170
170
|
if (IsIndependentTax) {
|
|
171
|
-
return (0,
|
|
171
|
+
return (0, math_operations_1.Add)(ItemsTotalAfterDisc, ItemsTaxAmount);
|
|
172
172
|
}
|
|
173
173
|
else {
|
|
174
|
-
return (0,
|
|
174
|
+
return (0, math_operations_1.Subtract)(ItemsTotalAfterDisc, finalTotalsData.Disc);
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
177
|
static ItemsTotalAfterDiscount(ItemsTotalAfterDisc, ItemsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
178
|
-
let ItemsTotal = (0,
|
|
178
|
+
let ItemsTotal = (0, math_operations_1.Add)(ItemsTotalAfterDisc, ItemsTaxAmount);
|
|
179
179
|
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
180
180
|
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
181
|
-
ItemsTotal = (0,
|
|
181
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
|
-
ItemsTotal = (0,
|
|
184
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
return ItemsTotal;
|
|
@@ -193,10 +193,10 @@ class VendorDebitNoteTotalsService {
|
|
|
193
193
|
let TotalTaxAmt = 0;
|
|
194
194
|
if (IsIndependentTax) {
|
|
195
195
|
ItemsList.forEach((Item) => {
|
|
196
|
-
TotalCGSTAmt = (0,
|
|
197
|
-
TotalSGSTAmt = (0,
|
|
198
|
-
TotalIGSTAmt = (0,
|
|
199
|
-
TotalTaxAmt = (0,
|
|
196
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Item.CGST);
|
|
197
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Item.SGST);
|
|
198
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Item.IGST);
|
|
199
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Item.CGST, Item.SGST, Item.IGST);
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
@@ -216,7 +216,7 @@ class VendorDebitNoteTotalsService {
|
|
|
216
216
|
Item.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
217
217
|
Item.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
218
218
|
Item.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
219
|
-
Item.CombinedTaxPercentage = (0,
|
|
219
|
+
Item.CombinedTaxPercentage = (0, math_operations_1.Add)(Item.CGSTAmt, Item.SGSTAmt, Item.IGSTAmt);
|
|
220
220
|
});
|
|
221
221
|
return Items;
|
|
222
222
|
}
|
|
@@ -260,10 +260,10 @@ class VendorDebitNoteTotalsService {
|
|
|
260
260
|
let HSN = MatchedItem[0].HSN;
|
|
261
261
|
TaxInfo.CombinedTaxPercentage = MatchedItem[0].CombinedTaxPercentage;
|
|
262
262
|
MatchedItem.forEach((argMatchedGSTItem) => {
|
|
263
|
-
TaxOnAmount = (0,
|
|
264
|
-
TaxAmount = (0,
|
|
265
|
-
TaxAmount = (0,
|
|
266
|
-
TaxAmount = (0,
|
|
263
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, argMatchedGSTItem.AfterItemDisc);
|
|
264
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.CGST);
|
|
265
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.IGST);
|
|
266
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.SGST);
|
|
267
267
|
});
|
|
268
268
|
TaxInfo.HSN = HSN;
|
|
269
269
|
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DCLandscapePdfService = 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");
|
|
@@ -856,12 +856,12 @@ class DCLandscapePdfService {
|
|
|
856
856
|
let totalDisc;
|
|
857
857
|
let totalTax;
|
|
858
858
|
if (!ROPrintData.Consolidate) {
|
|
859
|
-
totalTax = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
859
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(0), Number(ROPrintData.CustPartITax)), DecimalsNumber);
|
|
860
860
|
if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
|
|
861
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
861
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(0), Number(ROPrintData.CustPartsDiscTotal)), DecimalsNumber);
|
|
862
862
|
}
|
|
863
863
|
else {
|
|
864
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
864
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(Number(0), Number(ROPrintData.CustPartsDiscTotal), Number(ROPrintData.FixedDisc)), DecimalsNumber);
|
|
865
865
|
}
|
|
866
866
|
}
|
|
867
867
|
return [
|
|
@@ -5,8 +5,8 @@ const delivery_challan_totals_1 = require("./delivery-challan-totals");
|
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
const code_enums_1 = require("../../enums/code-enums");
|
|
7
7
|
const my_date_1 = require("../../utils/my-date");
|
|
8
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
9
8
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
9
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
10
10
|
class DeliveryChallanPrintService {
|
|
11
11
|
static GetChallanDataPrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma) {
|
|
12
12
|
var _a, _b;
|
|
@@ -79,11 +79,11 @@ class DeliveryChallanPrintService {
|
|
|
79
79
|
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
80
80
|
Items.forEach((Item) => {
|
|
81
81
|
if (Consolidate) {
|
|
82
|
-
let AfterDiscForEach = Item.AfterPartDisc
|
|
83
|
-
let CTaxAmtPerItem = Item.CGST
|
|
84
|
-
let STaxAmtPerItem = Item.SGST
|
|
85
|
-
let ITaxAmtPerItem = Item.IGST
|
|
86
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
82
|
+
let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
|
|
83
|
+
let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
|
|
84
|
+
let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
|
|
85
|
+
let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
|
|
86
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -98,7 +98,7 @@ class DeliveryChallanPrintService {
|
|
|
98
98
|
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
101
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
102
102
|
}
|
|
103
103
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
104
104
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeliveryChallanTotalsService = 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 DeliveryChallanTotalsService {
|
|
7
7
|
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable, EntitySettings) {
|
|
@@ -29,11 +29,11 @@ class DeliveryChallanTotalsService {
|
|
|
29
29
|
static ResetLaborPartValues(PartsList, IsIndependentTax) {
|
|
30
30
|
PartsList.forEach((Part) => {
|
|
31
31
|
Part = this.ResetLaborPartValueIfInvalid(Part);
|
|
32
|
-
Part.DiscountedPrice = (0,
|
|
33
|
-
let NetAmt = (0,
|
|
32
|
+
Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc));
|
|
33
|
+
let NetAmt = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
34
34
|
Part.AfterPartDisc = NetAmt;
|
|
35
35
|
if (IsIndependentTax) {
|
|
36
|
-
Part.AfterPartTax = (0,
|
|
36
|
+
Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
39
|
Part.AfterPartTax = Part.AfterPartDisc;
|
|
@@ -71,11 +71,11 @@ class DeliveryChallanTotalsService {
|
|
|
71
71
|
let CustPartTaxTotal = this.GetPartsTaxTotalFor(PartsList, IsIndependentTax);
|
|
72
72
|
// console.log('CustPartTaxTotal', CustPartTaxTotal);
|
|
73
73
|
let CustItemsDiscTotal = this.GetPartDiscountedTotal(PartsList);
|
|
74
|
-
finalTotalsData.SubTotal = (0,
|
|
74
|
+
finalTotalsData.SubTotal = (0, math_operations_1.Add)(CustomerAfterDiscTotals, CustItemsDiscTotal);
|
|
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((0,
|
|
78
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
79
79
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
@@ -96,7 +96,7 @@ class DeliveryChallanTotalsService {
|
|
|
96
96
|
let PartsTotalAfterDisc = 0;
|
|
97
97
|
// console.log('PartsList', PartsList);
|
|
98
98
|
PartsList.forEach((Part) => {
|
|
99
|
-
PartsTotalAfterDisc = (0,
|
|
99
|
+
PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
|
|
100
100
|
});
|
|
101
101
|
return PartsTotalAfterDisc;
|
|
102
102
|
}
|
|
@@ -105,8 +105,8 @@ class DeliveryChallanTotalsService {
|
|
|
105
105
|
finalTotalsData.CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList);
|
|
106
106
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
107
107
|
finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
108
|
-
finalTotalsData.CustLaborTotalBeforeDisc = (0,
|
|
109
|
-
finalTotalsData.CustPartsTotalBeforeDisc = (0,
|
|
108
|
+
finalTotalsData.CustLaborTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustLaborTotalAfterDisc, finalTotalsData.CustLaborDiscTotal);
|
|
109
|
+
finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
|
|
110
110
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
111
111
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
112
112
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -121,7 +121,7 @@ class DeliveryChallanTotalsService {
|
|
|
121
121
|
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
122
122
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
123
123
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
124
|
-
finalTotalsData.CustPartAfterTax = (0,
|
|
124
|
+
finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
125
125
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
126
126
|
finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
|
|
127
127
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
@@ -176,14 +176,14 @@ class DeliveryChallanTotalsService {
|
|
|
176
176
|
static GetLaborDiscountedTotal(LaborList) {
|
|
177
177
|
let LaborDiscountedTotal = 0;
|
|
178
178
|
LaborList.forEach((Labor) => {
|
|
179
|
-
LaborDiscountedTotal = (0,
|
|
179
|
+
LaborDiscountedTotal = (0, math_operations_1.Add)(LaborDiscountedTotal, Labor.DiscountedPrice);
|
|
180
180
|
});
|
|
181
181
|
return LaborDiscountedTotal;
|
|
182
182
|
}
|
|
183
183
|
static GetPartDiscountedTotal(PartsList) {
|
|
184
184
|
let PartsDiscountedTotal = 0;
|
|
185
185
|
PartsList.forEach((Part) => {
|
|
186
|
-
PartsDiscountedTotal = (0,
|
|
186
|
+
PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
187
187
|
});
|
|
188
188
|
return PartsDiscountedTotal;
|
|
189
189
|
}
|
|
@@ -191,7 +191,7 @@ class DeliveryChallanTotalsService {
|
|
|
191
191
|
let TotalTaxAmt = 0;
|
|
192
192
|
if (IsIndependentTax) {
|
|
193
193
|
PartsList.forEach((Part) => {
|
|
194
|
-
TotalTaxAmt = (0,
|
|
194
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
return TotalTaxAmt;
|
|
@@ -200,32 +200,32 @@ class DeliveryChallanTotalsService {
|
|
|
200
200
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
201
201
|
let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
202
202
|
if (IsIndependentTax) {
|
|
203
|
-
return (0,
|
|
203
|
+
return (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
206
|
return PartsTotalAfterDisc;
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
|
|
210
|
-
let LaborTotal = (0,
|
|
210
|
+
let LaborTotal = (0, math_operations_1.Add)(LaborTotalAfterDisc, LaborTaxAmount);
|
|
211
211
|
if (!tr_utils_1.TrUtils.IsZero(MainLDisc)) {
|
|
212
212
|
if (!tr_utils_1.TrUtils.IsEmpty(LDiscInPerc)) {
|
|
213
|
-
LaborTotal = (0,
|
|
213
|
+
LaborTotal = (0, math_operations_1.Subtract)(LaborTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(LaborTotal, Number(LDiscInPerc)), 100));
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
|
-
LaborTotal = (0,
|
|
216
|
+
LaborTotal = (0, math_operations_1.Subtract)(LaborTotal, MainLDisc);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
return LaborTotal;
|
|
220
220
|
}
|
|
221
221
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
222
|
-
let ItemsTotal = (0,
|
|
222
|
+
let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
223
223
|
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
224
224
|
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
225
|
-
ItemsTotal = (0,
|
|
225
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
226
226
|
}
|
|
227
227
|
else {
|
|
228
|
-
ItemsTotal = (0,
|
|
228
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
return ItemsTotal;
|
|
@@ -234,7 +234,7 @@ class DeliveryChallanTotalsService {
|
|
|
234
234
|
let TotalTaxAmt = 0;
|
|
235
235
|
if (IsIndependentTax) {
|
|
236
236
|
opCodesList.forEach((Labor) => {
|
|
237
|
-
TotalTaxAmt = (0,
|
|
237
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST);
|
|
238
238
|
});
|
|
239
239
|
}
|
|
240
240
|
return TotalTaxAmt;
|
|
@@ -243,7 +243,7 @@ class DeliveryChallanTotalsService {
|
|
|
243
243
|
let TotalTaxAmt = 0;
|
|
244
244
|
if (IsIndependentTax) {
|
|
245
245
|
opCodesList.forEach((Labor) => {
|
|
246
|
-
TotalTaxAmt = (0,
|
|
246
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.IGST);
|
|
247
247
|
});
|
|
248
248
|
}
|
|
249
249
|
return TotalTaxAmt;
|
|
@@ -252,7 +252,7 @@ class DeliveryChallanTotalsService {
|
|
|
252
252
|
let TotalTaxAmt = 0;
|
|
253
253
|
if (IsIndependentTax) {
|
|
254
254
|
opCodesList.forEach((Labor) => {
|
|
255
|
-
TotalTaxAmt = (0,
|
|
255
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.SGST);
|
|
256
256
|
});
|
|
257
257
|
}
|
|
258
258
|
return TotalTaxAmt;
|
|
@@ -264,10 +264,10 @@ class DeliveryChallanTotalsService {
|
|
|
264
264
|
let TotalTaxAmt = 0;
|
|
265
265
|
if (IsIndependentTax) {
|
|
266
266
|
PartsList.forEach((Part) => {
|
|
267
|
-
TotalCGSTAmt = (0,
|
|
268
|
-
TotalSGSTAmt = (0,
|
|
269
|
-
TotalIGSTAmt = (0,
|
|
270
|
-
TotalTaxAmt = (0,
|
|
267
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
|
|
268
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
|
|
269
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
|
|
270
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
273
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
@@ -287,7 +287,7 @@ class DeliveryChallanTotalsService {
|
|
|
287
287
|
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
288
288
|
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
289
289
|
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
290
|
-
Part.CombinedTaxPercentage = (0,
|
|
290
|
+
Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
291
291
|
});
|
|
292
292
|
return Parts;
|
|
293
293
|
}
|
|
@@ -334,13 +334,13 @@ class DeliveryChallanTotalsService {
|
|
|
334
334
|
let HSN = MatchedPart[0].HSN;
|
|
335
335
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
336
336
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
337
|
-
TaxOnAmount = (0,
|
|
338
|
-
TaxAmount = (0,
|
|
339
|
-
TaxAmount = (0,
|
|
340
|
-
TaxAmount = (0,
|
|
341
|
-
CGSTAmt = (0,
|
|
342
|
-
SGSTAmt = (0,
|
|
343
|
-
IGSTAmt = (0,
|
|
337
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
|
|
338
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
339
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
340
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
341
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
342
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
343
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
344
344
|
});
|
|
345
345
|
TaxInfo.HSN = HSN;
|
|
346
346
|
TaxInfo.CGSTAmt = CGSTAmt;
|