shareneus 1.4.34 → 1.4.35
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/aggregation/aggregation.js +13 -13
- package/dist/excel-files/GSTR-RO-excel.service.js +3 -3
- package/dist/excel-files/GSTR1-excel.service.js +7 -7
- package/dist/excel-files/GSTR2-excel.service.js +6 -6
- package/dist/excel-files/analysis-excel.service.js +4 -4
- package/dist/excel-files/category-wise-item-excel.service.js +10 -10
- package/dist/excel-files/cust-balance-excel.service.js +5 -5
- package/dist/excel-files/cust-wise-sales-details.js +5 -5
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +5 -5
- package/dist/excel-files/expiring-drugs-excel.service.js +7 -7
- package/dist/excel-files/insurance-expire-excel.service.js +4 -4
- package/dist/excel-files/invoice-wise-excel.service.js +3 -3
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +7 -7
- package/dist/excel-files/item-wise-mout-details.js +4 -4
- package/dist/excel-files/item-wise-mout-summary.js +4 -4
- package/dist/excel-files/items-wise-sales-excel.service.js +10 -10
- package/dist/excel-files/manf-wise-sales-excel.service.js +4 -4
- package/dist/excel-files/next-service-date-excel.service.js +5 -5
- package/dist/excel-files/operator-wise-details.js +4 -4
- package/dist/excel-files/operator-wise-summary.js +4 -4
- package/dist/excel-files/payment-receive-excel.service.js +6 -6
- package/dist/excel-files/payments-made-excel.service.js +6 -6
- package/dist/excel-files/repair-orders-excel.service.js +10 -10
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +6 -6
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +6 -6
- package/dist/excel-files/sale-summary-excel.service.js +3 -3
- package/dist/excel-files/sales-by-service-summary-excel.service.js +14 -14
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +8 -8
- package/dist/excel-files/scheduled-drugs-excel.service.js +10 -10
- package/dist/excel-files/spares-issue-excel.service.js +14 -14
- package/dist/excel-files/stock-excel.service.js +3 -3
- package/dist/excel-files/tally-sales-import.service.js +3 -3
- package/dist/excel-files/ven-balance-excel.service.js +3 -3
- package/dist/index.js +9 -9
- package/dist/services/analysis-pdf.service.js +8 -8
- package/dist/services/appointment-total.service.js +37 -37
- package/dist/services/auto-sales-receipt-pdf.service.js +24 -24
- package/dist/services/category-wise-item-pdf.service.js +6 -6
- package/dist/services/checklist-pdf.js +3 -3
- package/dist/services/cn-print.service.js +33 -33
- package/dist/services/consultation-fee-receipt.service.js +16 -16
- package/dist/services/consultation-full-pdf.service.js +10 -10
- package/dist/services/consultation-letterhead-pdf.service.js +15 -15
- package/dist/services/consultation-pdf.service.js +15 -15
- package/dist/services/credit-note-pdf.service.js +16 -16
- package/dist/services/credit-note-totals.service.js +31 -31
- package/dist/services/cust-wise-sales-details-pdf.service.js +8 -8
- package/dist/services/cust-wise-sales-summary-pdf.service.js +7 -7
- package/dist/services/customer-balances-pdf.service.js +7 -7
- package/dist/services/dc-landscape-pdf.service.js +28 -28
- package/dist/services/dc-landscape-without-price-pdf.service.js +24 -24
- package/dist/services/dc-without-price-pdf.service.js +15 -15
- package/dist/services/debit-note-pdf.service.js +14 -14
- package/dist/services/debit-note-print.service.js +33 -33
- package/dist/services/debit-note-totals.service.js +28 -28
- package/dist/services/delivery-challan-pdf.service.js +16 -16
- package/dist/services/delivery-challan-print.service.js +26 -26
- package/dist/services/delivery-challan-totals.js +32 -32
- package/dist/services/equipment-design-pdf.service.js +10 -10
- package/dist/services/est.print-service.js +150 -150
- package/dist/services/expiring-drugs-pdf.service.js +6 -6
- package/dist/services/hc-inv-pdf.service.js +42 -42
- package/dist/services/insurance-expire-pdf.service.js +1 -1
- package/dist/services/inv-pdf.service.js +54 -54
- package/dist/services/inv-print.service.js +59 -59
- package/dist/services/invoice-landscape-pdf.service.js +29 -29
- package/dist/services/invoice-letterhead-pdf.service.js +54 -54
- package/dist/services/invoice-portrait-pdf.js +51 -51
- package/dist/services/invoice-total.service.js +78 -78
- package/dist/services/issue-parts-pdf.service.js +43 -43
- package/dist/services/item-bar-code-label-pdf.js +2 -2
- package/dist/services/item-price-for-pricelist.js +178 -0
- package/dist/services/item-wise-doctor-sale-pdf.service.js +3 -3
- package/dist/services/item-wise-mout-details-pdf.js +3 -3
- package/dist/services/item-wise-mout-summary-pdf.js +2 -2
- package/dist/services/item-wise-sales-pdf.service.js +6 -6
- package/dist/services/manf-wise-sales-pdf.service.js +5 -5
- package/dist/services/meeting-pdf.js +14 -14
- package/dist/services/mout-pdf.service.js +17 -17
- package/dist/services/next-service-date-pdf.service.js +1 -1
- package/dist/services/operator-wise-details-pdf.service.js +8 -8
- package/dist/services/operator-wise-summary-pdf.js +7 -7
- package/dist/services/pack-ship-pdf.service.js +3 -3
- package/dist/services/pack-ship-print.service.js +26 -26
- package/dist/services/payment-pdf.service.js +4 -4
- package/dist/services/payment-report-pdf.service.js +3 -3
- package/dist/services/po-totals.service.js +28 -28
- package/dist/services/pos-receipt-pdf.js +19 -19
- package/dist/services/purchase-order-pdf.service.js +40 -40
- package/dist/services/purchase-order-print.service.js +43 -43
- package/dist/services/purchase-order-totals.service.js +53 -53
- package/dist/services/receipt-print.service.js +5 -5
- package/dist/services/reorder-point-pdf.service.js +3 -3
- package/dist/services/repair-orders-pdf.service.js +3 -3
- package/dist/services/ro-pdf.service.js +80 -80
- package/dist/services/ro-print-service.js +87 -87
- package/dist/services/ro-totals.service.js +123 -123
- package/dist/services/sales-by-service-pdf.service.js +6 -6
- package/dist/services/sales-pdf.service.js +23 -23
- package/dist/services/sales-print.service.js +54 -54
- package/dist/services/sales-receipt-pdf.service.js +25 -25
- package/dist/services/sales-receipt-print.service.js +62 -62
- package/dist/services/sales-totals.service.js +33 -33
- package/dist/services/scheduled-drug-pdf.service.js +7 -7
- package/dist/services/scheduled-drug-summary-pdf.service.js +4 -4
- package/dist/services/separate-wo-print.service.js +9 -9
- package/dist/services/shared-inv-pdf.service.js +44 -44
- package/dist/services/shared-pdf.service.js +119 -119
- package/dist/services/shared-print.service.js +68 -68
- package/dist/services/task-pdf.service.js +10 -10
- package/dist/services/task-reports-pdf.service.js +9 -9
- package/dist/services/technician-pdf.service.js +10 -10
- package/dist/services/technician-print.service.js +9 -9
- package/dist/services/vendor-balances-pdf.service.js +6 -6
- package/dist/services/vendor-credit-note-pdf.service.js +27 -27
- package/dist/services/vendor-credit-note-print.service.js +29 -29
- package/dist/services/vendor-credit-note-totals.service.js +37 -37
- package/dist/services/vendor-debit-note-pdf.service.js +16 -16
- package/dist/services/vendor-debit-note-print.service.js +29 -29
- package/dist/services/vendor-debit-note-totals.service.js +30 -30
- package/dist/{utils → shared}/my-date.js +31 -31
- package/package.json +1 -1
- package/dist/services/pricelist-item-final-price.service.js +0 -177
- /package/dist/{utils/tr-utils.js → shared/utils.js} +0 -0
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ROTotalsService = void 0;
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
5
|
const enums_1 = require("../enums/enums");
|
|
6
|
-
const
|
|
6
|
+
const utils_1 = require("../shared/utils");
|
|
7
7
|
class ROTotalsService {
|
|
8
8
|
static GetTotalsValue(OriRecordData, TaxCodes, isWorkOrder, detailedInfo, withItems, isRoundable) {
|
|
9
|
-
let dupRecordData =
|
|
9
|
+
let dupRecordData = utils_1.TrUtils.Stringify(OriRecordData);
|
|
10
10
|
let argRecordData = {};
|
|
11
|
-
dupRecordData.Ops = this.CalculateLaborValues(dupRecordData.Ops, isWorkOrder,
|
|
12
|
-
dupRecordData.Parts = this.CalculatePartValues(dupRecordData.Parts, dupRecordData.Ops, isWorkOrder,
|
|
11
|
+
dupRecordData.Ops = this.CalculateLaborValues(dupRecordData.Ops, isWorkOrder, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
12
|
+
dupRecordData.Parts = this.CalculatePartValues(dupRecordData.Parts, dupRecordData.Ops, isWorkOrder, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
13
13
|
argRecordData = this.GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, isWorkOrder, isRoundable);
|
|
14
14
|
return argRecordData;
|
|
15
15
|
}
|
|
@@ -34,23 +34,23 @@ class ROTotalsService {
|
|
|
34
34
|
return opCodesList;
|
|
35
35
|
}
|
|
36
36
|
static ResetLaborValueIfInvalid(Operation, isWorkOrder) {
|
|
37
|
-
Operation.Perc =
|
|
38
|
-
Operation.Disc =
|
|
39
|
-
Operation.Pr =
|
|
40
|
-
Operation.AssPr =
|
|
41
|
-
Operation.ACGST =
|
|
42
|
-
Operation.ASGST =
|
|
43
|
-
Operation.AIGST =
|
|
44
|
-
Operation.CCGST =
|
|
45
|
-
Operation.CSGST =
|
|
46
|
-
Operation.CIGST =
|
|
47
|
-
Operation.NetAmt =
|
|
48
|
-
Operation.RecDisc =
|
|
37
|
+
Operation.Perc = utils_1.TrUtils.SetPercToStringIfNull(Operation.Perc);
|
|
38
|
+
Operation.Disc = utils_1.TrUtils.SetValueToZeroIfNull(Operation.Disc);
|
|
39
|
+
Operation.Pr = utils_1.TrUtils.SetValueToZeroIfNull(Operation.Pr);
|
|
40
|
+
Operation.AssPr = utils_1.TrUtils.SetValueToZeroIfNull(Operation.AssPr);
|
|
41
|
+
Operation.ACGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.ACGST);
|
|
42
|
+
Operation.ASGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.ASGST);
|
|
43
|
+
Operation.AIGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.AIGST);
|
|
44
|
+
Operation.CCGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.CCGST);
|
|
45
|
+
Operation.CSGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.CSGST);
|
|
46
|
+
Operation.CIGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.CIGST);
|
|
47
|
+
Operation.NetAmt = utils_1.TrUtils.SetValueToZeroIfNull(Operation.NetAmt);
|
|
48
|
+
Operation.RecDisc = utils_1.TrUtils.SetValueToZeroIfNull(Operation.RecDisc);
|
|
49
49
|
if (!isWorkOrder) {
|
|
50
|
-
Operation.EstPr =
|
|
51
|
-
Operation.ECGST =
|
|
52
|
-
Operation.ESGST =
|
|
53
|
-
Operation.EIGST =
|
|
50
|
+
Operation.EstPr = utils_1.TrUtils.SetValueToZeroIfNull(Operation.EstPr);
|
|
51
|
+
Operation.ECGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.ECGST);
|
|
52
|
+
Operation.ESGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.ESGST);
|
|
53
|
+
Operation.EIGST = utils_1.TrUtils.SetValueToZeroIfNull(Operation.EIGST);
|
|
54
54
|
}
|
|
55
55
|
return Operation;
|
|
56
56
|
}
|
|
@@ -159,7 +159,7 @@ class ROTotalsService {
|
|
|
159
159
|
}
|
|
160
160
|
static FilterValidPartItems(PartsList) {
|
|
161
161
|
PartsList = PartsList.filter((Part) => {
|
|
162
|
-
if (
|
|
162
|
+
if (utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
163
163
|
return Part;
|
|
164
164
|
}
|
|
165
165
|
else {
|
|
@@ -175,32 +175,32 @@ class ROTotalsService {
|
|
|
175
175
|
return PartsList;
|
|
176
176
|
}
|
|
177
177
|
static ResetPartValueIfInvalid(Part, isWorkOrder) {
|
|
178
|
-
Part.Perc =
|
|
179
|
-
Part.Disc =
|
|
180
|
-
Part.UnPr =
|
|
181
|
-
Part.AssPr =
|
|
182
|
-
Part.ACGST =
|
|
183
|
-
Part.ASGST =
|
|
184
|
-
Part.AIGST =
|
|
185
|
-
Part.CCGST =
|
|
186
|
-
Part.CSGST =
|
|
187
|
-
Part.CIGST =
|
|
188
|
-
Part.UnAmt =
|
|
189
|
-
Part.AssAmt =
|
|
190
|
-
Part.NetAmt =
|
|
191
|
-
Part.RecDisc =
|
|
178
|
+
Part.Perc = utils_1.TrUtils.SetPercToStringIfNull(Part.Perc);
|
|
179
|
+
Part.Disc = utils_1.TrUtils.SetValueToZeroIfNull(Part.Disc);
|
|
180
|
+
Part.UnPr = utils_1.TrUtils.SetValueToZeroIfNull(Part.UnPr);
|
|
181
|
+
Part.AssPr = utils_1.TrUtils.SetValueToZeroIfNull(Part.AssPr);
|
|
182
|
+
Part.ACGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.ACGST);
|
|
183
|
+
Part.ASGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.ASGST);
|
|
184
|
+
Part.AIGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.AIGST);
|
|
185
|
+
Part.CCGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.CCGST);
|
|
186
|
+
Part.CSGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.CSGST);
|
|
187
|
+
Part.CIGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.CIGST);
|
|
188
|
+
Part.UnAmt = utils_1.TrUtils.SetValueToZeroIfNull(Part.UnAmt);
|
|
189
|
+
Part.AssAmt = utils_1.TrUtils.SetValueToZeroIfNull(Part.AssAmt);
|
|
190
|
+
Part.NetAmt = utils_1.TrUtils.SetValueToZeroIfNull(Part.NetAmt);
|
|
191
|
+
Part.RecDisc = utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc);
|
|
192
192
|
if (!isWorkOrder) {
|
|
193
|
-
Part.EstPr =
|
|
194
|
-
Part.ECGST =
|
|
195
|
-
Part.ESGST =
|
|
196
|
-
Part.EIGST =
|
|
197
|
-
Part.EstAmt =
|
|
193
|
+
Part.EstPr = utils_1.TrUtils.SetValueToZeroIfNull(Part.EstPr);
|
|
194
|
+
Part.ECGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.ECGST);
|
|
195
|
+
Part.ESGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.ESGST);
|
|
196
|
+
Part.EIGST = utils_1.TrUtils.SetValueToZeroIfNull(Part.EIGST);
|
|
197
|
+
Part.EstAmt = utils_1.TrUtils.SetValueToZeroIfNull(Part.EstAmt);
|
|
198
198
|
}
|
|
199
199
|
return Part;
|
|
200
200
|
}
|
|
201
201
|
static GetPartsDiscountPrice(PartsList, LaborList, isWorkOrder) {
|
|
202
202
|
PartsList.forEach((Part) => {
|
|
203
|
-
if (
|
|
203
|
+
if (utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
204
204
|
if (isWorkOrder) {
|
|
205
205
|
Part.CustDiscountedPrice = (0, aggregation_1.addition)(Part.Disc, Part.RecDisc);
|
|
206
206
|
}
|
|
@@ -231,7 +231,7 @@ class ROTotalsService {
|
|
|
231
231
|
return PartsList;
|
|
232
232
|
}
|
|
233
233
|
static GetPartParentStatus(Part, LaborList) {
|
|
234
|
-
if (!
|
|
234
|
+
if (!utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
235
235
|
let index = LaborList.findIndex((Labor) => {
|
|
236
236
|
return Labor._id === Part.OpId;
|
|
237
237
|
});
|
|
@@ -243,12 +243,12 @@ class ROTotalsService {
|
|
|
243
243
|
}
|
|
244
244
|
static GetPartsAfterDiscount(PartsList, LaborList, isWorkOrder) {
|
|
245
245
|
PartsList.forEach((Part) => {
|
|
246
|
-
if (
|
|
246
|
+
if (utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
247
247
|
let CustAfterPartDisc = 0;
|
|
248
248
|
let InsAfterPartDisc = 0;
|
|
249
249
|
if (isWorkOrder) {
|
|
250
250
|
CustAfterPartDisc = Part.NetAmt;
|
|
251
|
-
if (
|
|
251
|
+
if (utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
252
252
|
InsAfterPartDisc = Part.AssAmt;
|
|
253
253
|
}
|
|
254
254
|
}
|
|
@@ -259,7 +259,7 @@ class ROTotalsService {
|
|
|
259
259
|
}
|
|
260
260
|
else {
|
|
261
261
|
CustAfterPartDisc = Part.NetAmt;
|
|
262
|
-
if (
|
|
262
|
+
if (utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
263
263
|
InsAfterPartDisc = Part.AssAmt;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
@@ -311,10 +311,10 @@ class ROTotalsService {
|
|
|
311
311
|
Part.InsAfterTax = Part.InsAfterPartDisc;
|
|
312
312
|
}
|
|
313
313
|
else {
|
|
314
|
-
if (
|
|
314
|
+
if (utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
315
315
|
if (isWorkOrder) {
|
|
316
316
|
Part.CustAfterTax = (0, aggregation_1.addition)(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST);
|
|
317
|
-
if (
|
|
317
|
+
if (utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
318
318
|
Part.InsAfterTax = (0, aggregation_1.addition)(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST);
|
|
319
319
|
}
|
|
320
320
|
}
|
|
@@ -325,7 +325,7 @@ class ROTotalsService {
|
|
|
325
325
|
}
|
|
326
326
|
else {
|
|
327
327
|
Part.CustAfterTax = (0, aggregation_1.addition)(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST);
|
|
328
|
-
if (
|
|
328
|
+
if (utils_1.TrUtils.IsNull(Part.OpId)) {
|
|
329
329
|
Part.InsAfterTax = (0, aggregation_1.addition)(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST);
|
|
330
330
|
}
|
|
331
331
|
}
|
|
@@ -391,12 +391,12 @@ class ROTotalsService {
|
|
|
391
391
|
return argRecordData;
|
|
392
392
|
}
|
|
393
393
|
static ResetDiscountValuesIfInvalid(dupRecordData) {
|
|
394
|
-
dupRecordData.LPerc =
|
|
395
|
-
dupRecordData.PPerc =
|
|
396
|
-
dupRecordData.Perc =
|
|
397
|
-
dupRecordData.LDisc =
|
|
398
|
-
dupRecordData.PDisc =
|
|
399
|
-
dupRecordData.Disc =
|
|
394
|
+
dupRecordData.LPerc = utils_1.TrUtils.SetPercToStringIfNull(dupRecordData.LPerc);
|
|
395
|
+
dupRecordData.PPerc = utils_1.TrUtils.SetPercToStringIfNull(dupRecordData.PPerc);
|
|
396
|
+
dupRecordData.Perc = utils_1.TrUtils.SetPercToStringIfNull(dupRecordData.Perc);
|
|
397
|
+
dupRecordData.LDisc = utils_1.TrUtils.SetValueToZeroIfNull(dupRecordData.LDisc);
|
|
398
|
+
dupRecordData.PDisc = utils_1.TrUtils.SetValueToZeroIfNull(dupRecordData.PDisc);
|
|
399
|
+
dupRecordData.Disc = utils_1.TrUtils.SetValueToZeroIfNull(dupRecordData.Disc);
|
|
400
400
|
return dupRecordData;
|
|
401
401
|
}
|
|
402
402
|
static SetMainDiscountValues(argRecordData, dupRecordData, detailedInfo) {
|
|
@@ -415,27 +415,27 @@ class ROTotalsService {
|
|
|
415
415
|
}
|
|
416
416
|
static GetFinalCustomerTotalsData(argRecordData, dupRecordData, isWorkOrder, detailedInfo, isRoundable) {
|
|
417
417
|
let CustomerAfterDiscTotals = this.GetCustSubTotal(dupRecordData.Ops, dupRecordData.Parts);
|
|
418
|
-
let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops,
|
|
419
|
-
let CustPartTaxTotal = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
420
|
-
let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops,
|
|
421
|
-
let CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts,
|
|
418
|
+
let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
419
|
+
let CustPartTaxTotal = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
420
|
+
let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
421
|
+
let CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
422
422
|
let CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
|
|
423
423
|
let CustPartsTotalAfterDisc = this.GetCustPartsTotalAfterDiscount(dupRecordData.Parts);
|
|
424
424
|
argRecordData.STotal = (0, aggregation_1.addition)(CustLaborDiscTotal, CustPartsDiscTotal, CustLaborTotalAfterDisc, CustPartsTotalAfterDisc);
|
|
425
425
|
argRecordData.CustLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal);
|
|
426
426
|
argRecordData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustPartsTotalAfterDisc, argRecordData.CustPartsDiscTotal);
|
|
427
|
-
argRecordData.SubTotal =
|
|
428
|
-
let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, CustPartTaxTotal, dupRecordData.Ops, dupRecordData.Parts,
|
|
427
|
+
argRecordData.SubTotal = utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
428
|
+
let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, CustPartTaxTotal, dupRecordData.Ops, dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
429
429
|
if (detailedInfo) {
|
|
430
|
-
argRecordData.FixedSubTotal =
|
|
431
|
-
argRecordData.FixedTotal =
|
|
430
|
+
argRecordData.FixedSubTotal = utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
431
|
+
argRecordData.FixedTotal = utils_1.TrUtils.FixedTo(CustTotal);
|
|
432
432
|
}
|
|
433
433
|
if (isRoundable) {
|
|
434
434
|
argRecordData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
435
435
|
argRecordData.Total = Math.round(CustTotal);
|
|
436
436
|
}
|
|
437
437
|
else {
|
|
438
|
-
argRecordData.Total =
|
|
438
|
+
argRecordData.Total = utils_1.TrUtils.FixedTo(CustTotal);
|
|
439
439
|
}
|
|
440
440
|
return argRecordData;
|
|
441
441
|
}
|
|
@@ -489,7 +489,7 @@ class ROTotalsService {
|
|
|
489
489
|
let TotalTaxAmt = 0;
|
|
490
490
|
if (IsTaxable) {
|
|
491
491
|
PartsList.forEach((Part) => {
|
|
492
|
-
if (!
|
|
492
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
493
493
|
if (isWorkOrder) {
|
|
494
494
|
if ((Part.PBy === enums_1.PayTypeEnum.Customer || Part.PBy === enums_1.PayTypeEnum.Shared)) {
|
|
495
495
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST);
|
|
@@ -551,12 +551,12 @@ class ROTotalsService {
|
|
|
551
551
|
}
|
|
552
552
|
static GetFinalInsuranceTotalsData(argRecordData, dupRecordData, detailedInfo, isWorkOrder) {
|
|
553
553
|
let InsuranceAfterDiscTotals = this.GetInsSubTotal(dupRecordData.Ops, dupRecordData.Parts);
|
|
554
|
-
let InsLaborTaxTotal = this.GetInsLaborTaxTotal(dupRecordData.Ops,
|
|
555
|
-
let InsPartTaxTotal = this.GetInsPartsTaxTotal(dupRecordData.Parts,
|
|
556
|
-
let InsTotal = this.GetInsuranceTotalBasedOnTaxType(InsuranceAfterDiscTotals, InsLaborTaxTotal, InsPartTaxTotal,
|
|
557
|
-
argRecordData.InsTotal =
|
|
554
|
+
let InsLaborTaxTotal = this.GetInsLaborTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
555
|
+
let InsPartTaxTotal = this.GetInsPartsTaxTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
556
|
+
let InsTotal = this.GetInsuranceTotalBasedOnTaxType(InsuranceAfterDiscTotals, InsLaborTaxTotal, InsPartTaxTotal, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
557
|
+
argRecordData.InsTotal = utils_1.TrUtils.FixedTo(InsTotal);
|
|
558
558
|
if (detailedInfo) {
|
|
559
|
-
argRecordData.FixedInsTotal =
|
|
559
|
+
argRecordData.FixedInsTotal = utils_1.TrUtils.FixedTo(InsTotal);
|
|
560
560
|
}
|
|
561
561
|
return argRecordData;
|
|
562
562
|
}
|
|
@@ -606,7 +606,7 @@ class ROTotalsService {
|
|
|
606
606
|
let TotalTaxAmt = 0;
|
|
607
607
|
if (IsTaxable) {
|
|
608
608
|
PartsList.forEach((Part) => {
|
|
609
|
-
if (!
|
|
609
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
610
610
|
if (isWorkOrder) {
|
|
611
611
|
if ((Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared)) {
|
|
612
612
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.ACGST, Part.ASGST, Part.AIGST);
|
|
@@ -644,30 +644,30 @@ class ROTotalsService {
|
|
|
644
644
|
argRecordData.InsPartsTotalAfterDisc = this.GetInsPartsTotalAfterDiscount(dupRecordData.Parts);
|
|
645
645
|
argRecordData.InsLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.InsLaborTotalAfterDisc, argRecordData.InsLaborDiscTotal);
|
|
646
646
|
argRecordData.InsPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.InsPartsTotalAfterDisc, argRecordData.InsPartsDiscTotal);
|
|
647
|
-
argRecordData.InsLaborITax = this.GetInsLaborTaxTotal(dupRecordData.Ops,
|
|
648
|
-
argRecordData.InsLaborCGST = this.GetInsLaborCGSTTaxTotal(dupRecordData.Ops,
|
|
649
|
-
argRecordData.InsLaborIGST = this.GetInsLaborIGSTTaxTotal(dupRecordData.Ops,
|
|
650
|
-
argRecordData.InsLaborSGST = this.GetInsLaborSGSTTaxTotal(dupRecordData.Ops,
|
|
651
|
-
argRecordData.InsPartITax = this.GetInsPartsTaxTotal(dupRecordData.Parts,
|
|
652
|
-
argRecordData.InsPartCGST = this.GetInsPartCGSTTaxTotal(dupRecordData.Parts,
|
|
653
|
-
argRecordData.InsPartIGST = this.GetInsPartIGSTTaxTotal(dupRecordData.Parts,
|
|
654
|
-
argRecordData.InsPartSGST = this.GetInsPartSGSTTaxTotal(dupRecordData.Parts,
|
|
647
|
+
argRecordData.InsLaborITax = this.GetInsLaborTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
648
|
+
argRecordData.InsLaborCGST = this.GetInsLaborCGSTTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
649
|
+
argRecordData.InsLaborIGST = this.GetInsLaborIGSTTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
650
|
+
argRecordData.InsLaborSGST = this.GetInsLaborSGSTTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
651
|
+
argRecordData.InsPartITax = this.GetInsPartsTaxTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
652
|
+
argRecordData.InsPartCGST = this.GetInsPartCGSTTaxTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
653
|
+
argRecordData.InsPartIGST = this.GetInsPartIGSTTaxTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
654
|
+
argRecordData.InsPartSGST = this.GetInsPartSGSTTaxTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
655
655
|
argRecordData.InsLaborTotalAfterTax = (0, aggregation_1.addition)(argRecordData.InsLaborTotalAfterDisc, argRecordData.InsLaborITax);
|
|
656
656
|
argRecordData.InsPartsTotalAfterTax = (0, aggregation_1.addition)(argRecordData.InsPartsTotalAfterDisc, argRecordData.InsPartITax);
|
|
657
|
-
argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops,
|
|
658
|
-
argRecordData.CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts,
|
|
657
|
+
argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
658
|
+
argRecordData.CustPartsDiscTotal = this.GetCustPartDiscountedTotal(dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
|
|
659
659
|
argRecordData.CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
|
|
660
660
|
argRecordData.CustPartsTotalAfterDisc = this.GetCustPartsTotalAfterDiscount(dupRecordData.Parts);
|
|
661
661
|
argRecordData.CustLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal);
|
|
662
662
|
argRecordData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustPartsTotalAfterDisc, argRecordData.CustPartsDiscTotal);
|
|
663
|
-
argRecordData.CustLaborITax = this.GetCustLaborTaxTotal(dupRecordData.Ops,
|
|
664
|
-
argRecordData.CustLaborSGST = this.GetCustLaborSGSTTaxTotal(dupRecordData.Ops,
|
|
665
|
-
argRecordData.CustLaborCGST = this.GetCustLaborCGSTTaxTotal(dupRecordData.Ops,
|
|
666
|
-
argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops,
|
|
667
|
-
argRecordData.CustPartITax = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
668
|
-
argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
669
|
-
argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
670
|
-
argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts,
|
|
663
|
+
argRecordData.CustLaborITax = this.GetCustLaborTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
664
|
+
argRecordData.CustLaborSGST = this.GetCustLaborSGSTTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
665
|
+
argRecordData.CustLaborCGST = this.GetCustLaborCGSTTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
666
|
+
argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
667
|
+
argRecordData.CustPartITax = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
668
|
+
argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
669
|
+
argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
670
|
+
argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
671
671
|
argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
|
|
672
672
|
argRecordData.CustPartsPDiscAmount = this.GetPartsPDiscAmount(argRecordData.CustPartsTotalAfterDisc, argRecordData.PDisc);
|
|
673
673
|
argRecordData.CustLaborAfterLDisc = argRecordData.CustLaborTotalAfterDisc;
|
|
@@ -677,7 +677,7 @@ class ROTotalsService {
|
|
|
677
677
|
argRecordData.CustTaxGroupData = this.GetCustPartsTaxGrouping(dupRecordData.Parts, TaxCodes, isWorkOrder);
|
|
678
678
|
argRecordData.InsTaxGroupData = this.GetInsPartsTaxGrouping(dupRecordData.Parts, TaxCodes);
|
|
679
679
|
argRecordData.CustTotalRoundedBy = argRecordData.Round;
|
|
680
|
-
argRecordData.InsTotalRoundedBy =
|
|
680
|
+
argRecordData.InsTotalRoundedBy = utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(argRecordData.InsTotal), argRecordData.InsTotal));
|
|
681
681
|
argRecordData.CustRoundedTotal = argRecordData.Total;
|
|
682
682
|
argRecordData.InsRoundedTotal = Math.round(argRecordData.InsTotal);
|
|
683
683
|
for (var key in argRecordData) {
|
|
@@ -685,7 +685,7 @@ class ROTotalsService {
|
|
|
685
685
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
686
686
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
687
687
|
&& typeof argRecordData[key] === 'number') {
|
|
688
|
-
argRecordData[key] =
|
|
688
|
+
argRecordData[key] = utils_1.TrUtils.FixPriceValue(argRecordData[key]);
|
|
689
689
|
}
|
|
690
690
|
}
|
|
691
691
|
return argRecordData;
|
|
@@ -694,7 +694,7 @@ class ROTotalsService {
|
|
|
694
694
|
let LaborDiscountedTotal = 0;
|
|
695
695
|
let overallLaborDisc = 0;
|
|
696
696
|
if (!isTaxable) {
|
|
697
|
-
overallLaborDisc =
|
|
697
|
+
overallLaborDisc = utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.LDisc);
|
|
698
698
|
}
|
|
699
699
|
LaborList.forEach((Labor) => {
|
|
700
700
|
LaborDiscountedTotal = (0, aggregation_1.addition)(LaborDiscountedTotal, Labor.CustDiscountedPrice);
|
|
@@ -705,7 +705,7 @@ class ROTotalsService {
|
|
|
705
705
|
let PartsDiscountedTotal = 0;
|
|
706
706
|
let overallPartDisc = 0;
|
|
707
707
|
if (!isTaxable) {
|
|
708
|
-
overallPartDisc =
|
|
708
|
+
overallPartDisc = utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
709
709
|
}
|
|
710
710
|
PartsList.forEach((Part) => {
|
|
711
711
|
PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.CustDiscountedPrice);
|
|
@@ -779,7 +779,7 @@ class ROTotalsService {
|
|
|
779
779
|
let TotalTaxAmt = 0;
|
|
780
780
|
if (IsTaxable) {
|
|
781
781
|
PartsList.forEach((Part) => {
|
|
782
|
-
if (!
|
|
782
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
783
783
|
if (isWorkOrder) {
|
|
784
784
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CCGST);
|
|
785
785
|
}
|
|
@@ -823,7 +823,7 @@ class ROTotalsService {
|
|
|
823
823
|
let TotalTaxAmt = 0;
|
|
824
824
|
if (IsTaxable) {
|
|
825
825
|
PartsList.forEach((Part) => {
|
|
826
|
-
if (!
|
|
826
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
827
827
|
if (isWorkOrder) {
|
|
828
828
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CIGST);
|
|
829
829
|
}
|
|
@@ -867,7 +867,7 @@ class ROTotalsService {
|
|
|
867
867
|
let TotalTaxAmt = 0;
|
|
868
868
|
if (IsTaxable) {
|
|
869
869
|
PartsList.forEach((Part) => {
|
|
870
|
-
if (!
|
|
870
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
871
871
|
if (isWorkOrder) {
|
|
872
872
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.CSGST);
|
|
873
873
|
}
|
|
@@ -974,7 +974,7 @@ class ROTotalsService {
|
|
|
974
974
|
let TotalTaxAmt = 0;
|
|
975
975
|
if (IsTaxable) {
|
|
976
976
|
PartsList.forEach((Part) => {
|
|
977
|
-
if (!
|
|
977
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
978
978
|
if (isWorkOrder) {
|
|
979
979
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.ACGST);
|
|
980
980
|
}
|
|
@@ -997,7 +997,7 @@ class ROTotalsService {
|
|
|
997
997
|
let TotalTaxAmt = 0;
|
|
998
998
|
if (IsTaxable) {
|
|
999
999
|
PartsList.forEach((Part) => {
|
|
1000
|
-
if (!
|
|
1000
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
1001
1001
|
if (isWorkOrder) {
|
|
1002
1002
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.AIGST);
|
|
1003
1003
|
}
|
|
@@ -1020,7 +1020,7 @@ class ROTotalsService {
|
|
|
1020
1020
|
let TotalTaxAmt = 0;
|
|
1021
1021
|
if (IsTaxable) {
|
|
1022
1022
|
PartsList.forEach((Part) => {
|
|
1023
|
-
if (!
|
|
1023
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
|
|
1024
1024
|
if (isWorkOrder) {
|
|
1025
1025
|
TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Part.ASGST);
|
|
1026
1026
|
}
|
|
@@ -1041,14 +1041,14 @@ class ROTotalsService {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
static GetLaborLDiscAmount(LaborTotalAfterDisc, LDisc) {
|
|
1043
1043
|
let LaborLDiscAmt = 0;
|
|
1044
|
-
if (!
|
|
1044
|
+
if (!utils_1.TrUtils.IsZero(LaborTotalAfterDisc)) {
|
|
1045
1045
|
LaborLDiscAmt = LDisc;
|
|
1046
1046
|
}
|
|
1047
1047
|
return LaborLDiscAmt;
|
|
1048
1048
|
}
|
|
1049
1049
|
static GetPartsPDiscAmount(PartsTotalAfterDisc, PDisc) {
|
|
1050
1050
|
let PartsPDiscAmt = 0;
|
|
1051
|
-
if (!
|
|
1051
|
+
if (!utils_1.TrUtils.IsZero(PartsTotalAfterDisc)) {
|
|
1052
1052
|
PartsPDiscAmt = PDisc;
|
|
1053
1053
|
}
|
|
1054
1054
|
return PartsPDiscAmt;
|
|
@@ -1078,30 +1078,30 @@ class ROTotalsService {
|
|
|
1078
1078
|
let HSN = MatchedPart[0].HSN;
|
|
1079
1079
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
1080
1080
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
1081
|
-
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount,
|
|
1081
|
+
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc));
|
|
1082
1082
|
if (isWorkOrder) {
|
|
1083
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1084
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1085
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1083
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST));
|
|
1084
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST));
|
|
1085
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST));
|
|
1086
1086
|
}
|
|
1087
1087
|
else {
|
|
1088
1088
|
if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
|
|
1089
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1090
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1091
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1089
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST));
|
|
1090
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST));
|
|
1091
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST));
|
|
1092
1092
|
}
|
|
1093
1093
|
else {
|
|
1094
1094
|
if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Customer) {
|
|
1095
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1096
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1097
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1095
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST));
|
|
1096
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST));
|
|
1097
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST));
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
1100
|
}
|
|
1101
1101
|
});
|
|
1102
1102
|
TaxInfo.HSN = HSN;
|
|
1103
|
-
TaxInfo.TotalTaxableAmount =
|
|
1104
|
-
TaxInfo.TotalTaxAmount =
|
|
1103
|
+
TaxInfo.TotalTaxableAmount = utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
1104
|
+
TaxInfo.TotalTaxAmount = utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
1105
1105
|
TaxInfo.PartsCount = MatchedPart.length;
|
|
1106
1106
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
1107
1107
|
TaxInfo.CGST = GSTValues[0];
|
|
@@ -1138,23 +1138,23 @@ class ROTotalsService {
|
|
|
1138
1138
|
let HSN = MatchedPart[0].HSN;
|
|
1139
1139
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
1140
1140
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
1141
|
-
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount,
|
|
1141
|
+
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc));
|
|
1142
1142
|
if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Insurance || argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Shared) {
|
|
1143
1143
|
if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
|
|
1144
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1145
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1146
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1144
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.ACGST));
|
|
1145
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.AIGST));
|
|
1146
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.ASGST));
|
|
1147
1147
|
}
|
|
1148
1148
|
else {
|
|
1149
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1150
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1151
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount,
|
|
1149
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST));
|
|
1150
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST));
|
|
1151
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST));
|
|
1152
1152
|
}
|
|
1153
1153
|
}
|
|
1154
1154
|
});
|
|
1155
1155
|
TaxInfo.HSN = HSN;
|
|
1156
|
-
TaxInfo.TotalTaxableAmount =
|
|
1157
|
-
TaxInfo.TotalTaxAmount =
|
|
1156
|
+
TaxInfo.TotalTaxableAmount = utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
1157
|
+
TaxInfo.TotalTaxAmount = utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
1158
1158
|
TaxInfo.PartsCount = MatchedPart.length;
|
|
1159
1159
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
1160
1160
|
TaxInfo.CGST = GSTValues[0];
|
|
@@ -1170,7 +1170,7 @@ class ROTotalsService {
|
|
|
1170
1170
|
let CGST = 0;
|
|
1171
1171
|
let SGST = 0;
|
|
1172
1172
|
let IGST = 0;
|
|
1173
|
-
if (
|
|
1173
|
+
if (utils_1.TrUtils.IsNull(TCode)) {
|
|
1174
1174
|
return [CGST, SGST, IGST];
|
|
1175
1175
|
}
|
|
1176
1176
|
let TCodeIndex = TaxCodes.findIndex((TaxCode) => {
|
|
@@ -1200,7 +1200,7 @@ class ROTotalsService {
|
|
|
1200
1200
|
}
|
|
1201
1201
|
static ResetPartsHSNIfInvalid(Parts) {
|
|
1202
1202
|
Parts.forEach((Part) => {
|
|
1203
|
-
if (
|
|
1203
|
+
if (utils_1.TrUtils.IsNull(Part.HSN)) {
|
|
1204
1204
|
Part.HSN = '';
|
|
1205
1205
|
}
|
|
1206
1206
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SalesByServiceSummaryPDF = void 0;
|
|
4
|
-
const
|
|
4
|
+
const utils_1 = require("../shared/utils");
|
|
5
5
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
6
|
class SalesByServiceSummaryPDF {
|
|
7
7
|
static GetSalesbyServiceSummaryPrint(InvoicesData, CName, HeaderName, searchValue, ForService) {
|
|
@@ -78,11 +78,11 @@ class SalesByServiceSummaryPDF {
|
|
|
78
78
|
dataRow.push({ text: invoice.Qty, alignment: 'right' });
|
|
79
79
|
// dataRow.push({ text: invoice.Qty, alignment: 'right' });
|
|
80
80
|
// dataRow.push({ text: invoice.OfQty, alignment: 'right' });
|
|
81
|
-
dataRow.push({ text: ForService ?
|
|
82
|
-
dataRow.push({ text:
|
|
83
|
-
dataRow.push({ text:
|
|
84
|
-
dataRow.push({ text:
|
|
85
|
-
dataRow.push({ text:
|
|
81
|
+
dataRow.push({ text: ForService ? utils_1.TrUtils.FixPriceValue(invoice.Amt) : utils_1.TrUtils.FixPriceValue(invoice.UnAmt), alignment: 'right' });
|
|
82
|
+
dataRow.push({ text: utils_1.TrUtils.FixPriceValue(invoice.Disc), alignment: 'right' });
|
|
83
|
+
dataRow.push({ text: utils_1.TrUtils.FixPriceValue(invoice.Tax), alignment: 'right' });
|
|
84
|
+
dataRow.push({ text: utils_1.TrUtils.FixPriceValue(invoice.NetAmt + invoice.Tax), alignment: 'right' });
|
|
85
|
+
dataRow.push({ text: utils_1.TrUtils.FixPriceValue(invoice.AvgPr), alignment: 'right' });
|
|
86
86
|
body.push(dataRow);
|
|
87
87
|
});
|
|
88
88
|
return body;
|