shareneus 1.4.35 → 1.4.36
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 +6 -6
- 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 +29 -46
- 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/shared/math-operations.js +184 -0
- package/dist/shared/util.js +15 -0
- package/dist/{shared → utils}/my-date.js +31 -31
- package/dist/{shared/utils.js → utils/tr-utils.js} +0 -8
- package/package.json +2 -1
|
@@ -4,22 +4,22 @@ exports.EstPrintService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
5
|
const code_enums_1 = require("../enums/code-enums");
|
|
6
6
|
const enums_1 = require("../enums/enums");
|
|
7
|
-
const my_date_1 = require("../
|
|
8
|
-
const
|
|
7
|
+
const my_date_1 = require("../utils/my-date");
|
|
8
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
9
9
|
const ro_totals_service_1 = require("./ro-totals.service");
|
|
10
10
|
const shared_print_service_1 = require("./shared-print.service");
|
|
11
11
|
class EstPrintService {
|
|
12
12
|
static GetEstimatePrintInfo(OriginalROData, OriginalCustomerData, OriginalVehicleData, OriginalEntityData, image, Payee, InsCompanyName, AsCustomerOnly, AsInsuranceOnly, AsCustomerAndInsurance, AsInsuranceOrCustomer, TaxCodes, OverallEst, SuppEstIndex, AsEstimated, isInitial, isReverse, Consolidate) {
|
|
13
13
|
let ROPrintData = {};
|
|
14
|
-
let argROData =
|
|
15
|
-
argROData.Comps =
|
|
16
|
-
argROData.Ops =
|
|
17
|
-
argROData.Parts =
|
|
18
|
-
argROData.Colli =
|
|
19
|
-
let IncludeGST =
|
|
14
|
+
let argROData = tr_utils_1.TrUtils.Stringify(OriginalROData);
|
|
15
|
+
argROData.Comps = tr_utils_1.TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps;
|
|
16
|
+
argROData.Ops = tr_utils_1.TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops;
|
|
17
|
+
argROData.Parts = tr_utils_1.TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts;
|
|
18
|
+
argROData.Colli = tr_utils_1.TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli;
|
|
19
|
+
let IncludeGST = tr_utils_1.TrUtils.isTaxable(argROData.Settings.Tax);
|
|
20
20
|
ROPrintData = this.GetROBasicDetailsForPrint(ROPrintData, argROData, OriginalVehicleData, OverallEst, isInitial);
|
|
21
21
|
let SType;
|
|
22
|
-
if (!
|
|
22
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalROData.SType)) {
|
|
23
23
|
SType = OriginalROData.SType;
|
|
24
24
|
}
|
|
25
25
|
ROPrintData = this.GetPrintConditionsBasedOnInput(ROPrintData, IncludeGST, Payee, AsCustomerOnly, AsInsuranceOnly, AsCustomerAndInsurance, AsInsuranceOrCustomer, SType, Consolidate);
|
|
@@ -33,11 +33,11 @@ class EstPrintService {
|
|
|
33
33
|
argROData = this.GetValidItemsForTotals(argROData);
|
|
34
34
|
if (!OverallEst) {
|
|
35
35
|
argROData = this.GetItemsBySuppEstIndex(argROData, SuppEstIndex);
|
|
36
|
-
if (!
|
|
36
|
+
if (!tr_utils_1.TrUtils.IsNull(SuppEstIndex)) {
|
|
37
37
|
let Index = argROData.SuppEst.findIndex((supp) => {
|
|
38
38
|
return supp.Id === SuppEstIndex;
|
|
39
39
|
});
|
|
40
|
-
if (Index !== -1 && !
|
|
40
|
+
if (Index !== -1 && !tr_utils_1.TrUtils.IsNull(argROData.SuppEst[Index].Date)) {
|
|
41
41
|
ROPrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(argROData.SuppEst[Index].Date);
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -56,7 +56,7 @@ class EstPrintService {
|
|
|
56
56
|
argROData = this.ReverseItemsForROPrint(argROData, isReverse);
|
|
57
57
|
let finalTotalsData = ro_totals_service_1.ROTotalsService.GetTotalsValue(argROData, TaxCodes, false, true, true, ROPrintData.Entity.Round);
|
|
58
58
|
finalTotalsData = this.CheckAndGetCombinedTotals(AsCustomerAndInsurance, AsInsuranceOrCustomer, finalTotalsData);
|
|
59
|
-
finalTotalsData.Settings =
|
|
59
|
+
finalTotalsData.Settings = tr_utils_1.TrUtils.Stringify(argROData.Settings);
|
|
60
60
|
if (AsCustomerOnly) {
|
|
61
61
|
if (ROPrintData.ShowAccParts) {
|
|
62
62
|
finalTotalsData = this.GetLaborAndPartItemsAfterDisc(finalTotalsData);
|
|
@@ -80,7 +80,7 @@ class EstPrintService {
|
|
|
80
80
|
finalTotalsData.ShowDetailedLaborTaxInfo = false;
|
|
81
81
|
finalTotalsData.ShowDetailedPartTaxInfo = false;
|
|
82
82
|
}
|
|
83
|
-
ROPrintData =
|
|
83
|
+
ROPrintData = tr_utils_1.TrUtils.ConcatObjects(ROPrintData, finalTotalsData);
|
|
84
84
|
if (ROPrintData.ShowAccParts) {
|
|
85
85
|
ROPrintData = this.ConvertItemsAsAR(ROPrintData, Consolidate);
|
|
86
86
|
}
|
|
@@ -107,7 +107,7 @@ class EstPrintService {
|
|
|
107
107
|
}
|
|
108
108
|
ROPrintData.MIn = Product.MIn;
|
|
109
109
|
ROPrintData._id = argROData.Code;
|
|
110
|
-
if (isInitial ||
|
|
110
|
+
if (isInitial || tr_utils_1.TrUtils.IsNull(argROData.SuppEst) || argROData.SuppEst.length === 0 || OverallEst) {
|
|
111
111
|
ROPrintData.Type = 'Estimate';
|
|
112
112
|
ROPrintData.HeaderName = 'Estimate';
|
|
113
113
|
}
|
|
@@ -127,13 +127,13 @@ class EstPrintService {
|
|
|
127
127
|
ROPrintData.IncludeGST = IncludeGST;
|
|
128
128
|
ROPrintData.ConsolidateGST = Consolidate;
|
|
129
129
|
ROPrintData.Consolidate = Consolidate;
|
|
130
|
-
ROPrintData.ShowIGST = (
|
|
130
|
+
ROPrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
131
131
|
ROPrintData.ShowTaxColumn = (IncludeGST && !Consolidate) ? true : false;
|
|
132
132
|
// ROPrintData.ShowDiscountColumn = (Payee === PayTypeEnum.Customer || AsCustomerOnly) ? true : false;
|
|
133
133
|
return ROPrintData;
|
|
134
134
|
}
|
|
135
135
|
static GetInsDetailsForPrint(ROPrintData, InsCompanyName, argROData, AsEstimated) {
|
|
136
|
-
if (
|
|
136
|
+
if (tr_utils_1.TrUtils.IsNull(argROData.Ins)) {
|
|
137
137
|
argROData.Ins = this.GetDefualtInsData();
|
|
138
138
|
}
|
|
139
139
|
ROPrintData.InsComp = InsCompanyName;
|
|
@@ -172,7 +172,7 @@ class EstPrintService {
|
|
|
172
172
|
}
|
|
173
173
|
static ChangePartStatusToNew(Parts) {
|
|
174
174
|
Parts.forEach((Part) => {
|
|
175
|
-
if (!
|
|
175
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
176
176
|
Part.Sts = enums_1.LaborStatusEnum.New;
|
|
177
177
|
}
|
|
178
178
|
});
|
|
@@ -206,7 +206,7 @@ class EstPrintService {
|
|
|
206
206
|
}
|
|
207
207
|
static ChangeDeclinedPartStatusToNew(Parts) {
|
|
208
208
|
Parts.forEach((Part) => {
|
|
209
|
-
if (!
|
|
209
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId) && Part.Sts === enums_1.LaborStatusEnum.Declined) {
|
|
210
210
|
Part.Sts = enums_1.LaborStatusEnum.New;
|
|
211
211
|
}
|
|
212
212
|
});
|
|
@@ -256,7 +256,7 @@ class EstPrintService {
|
|
|
256
256
|
}
|
|
257
257
|
static GetValidROPartsListByStatus(Parts) {
|
|
258
258
|
let PartsList = Parts.filter((Part) => {
|
|
259
|
-
if (
|
|
259
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
260
260
|
return Part;
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
@@ -284,23 +284,23 @@ class EstPrintService {
|
|
|
284
284
|
return collList;
|
|
285
285
|
}
|
|
286
286
|
static GetItemsBySuppEstIndex(argROData, SuppEstIndex) {
|
|
287
|
-
if (
|
|
287
|
+
if (tr_utils_1.TrUtils.IsNull(SuppEstIndex)) {
|
|
288
288
|
SuppEstIndex = null;
|
|
289
289
|
}
|
|
290
290
|
argROData.Ops = argROData.Ops.filter((Labor) => {
|
|
291
|
-
if (
|
|
291
|
+
if (tr_utils_1.TrUtils.IsNull(Labor.SuppEst)) {
|
|
292
292
|
Labor.SuppEst = null;
|
|
293
293
|
}
|
|
294
294
|
return Labor.SuppEst === SuppEstIndex;
|
|
295
295
|
});
|
|
296
296
|
argROData.Parts = argROData.Parts.filter((Part) => {
|
|
297
|
-
if (
|
|
297
|
+
if (tr_utils_1.TrUtils.IsNull(Part.SuppEst)) {
|
|
298
298
|
Part.SuppEst = null;
|
|
299
299
|
}
|
|
300
300
|
return Part.SuppEst === SuppEstIndex;
|
|
301
301
|
});
|
|
302
302
|
argROData.Colli = argROData.Colli.filter((Collision) => {
|
|
303
|
-
if (
|
|
303
|
+
if (tr_utils_1.TrUtils.IsNull(Collision.SuppEst)) {
|
|
304
304
|
Collision.SuppEst = null;
|
|
305
305
|
}
|
|
306
306
|
return Collision.SuppEst === SuppEstIndex;
|
|
@@ -324,11 +324,11 @@ class EstPrintService {
|
|
|
324
324
|
}
|
|
325
325
|
else {
|
|
326
326
|
if (CustomerOnly) {
|
|
327
|
-
return (Labor.PBy === enums_1.PayTypeEnum.Shared) && !
|
|
327
|
+
return (Labor.PBy === enums_1.PayTypeEnum.Shared) && !tr_utils_1.TrUtils.IsZero(Labor.Pr);
|
|
328
328
|
}
|
|
329
329
|
else {
|
|
330
330
|
if (InsuranceOnly) {
|
|
331
|
-
return (Labor.PBy === enums_1.PayTypeEnum.Insurance || Labor.PBy === enums_1.PayTypeEnum.Shared) && !
|
|
331
|
+
return (Labor.PBy === enums_1.PayTypeEnum.Insurance || Labor.PBy === enums_1.PayTypeEnum.Shared) && !tr_utils_1.TrUtils.IsZero(Labor.AssPr);
|
|
332
332
|
}
|
|
333
333
|
else {
|
|
334
334
|
return (Labor.PBy === enums_1.PayTypeEnum.Insurance || Labor.PBy === enums_1.PayTypeEnum.Shared);
|
|
@@ -356,11 +356,11 @@ class EstPrintService {
|
|
|
356
356
|
}
|
|
357
357
|
else {
|
|
358
358
|
if (CustomerOnly) {
|
|
359
|
-
return (Part.PBy === enums_1.PayTypeEnum.Shared) && !
|
|
359
|
+
return (Part.PBy === enums_1.PayTypeEnum.Shared) && !tr_utils_1.TrUtils.IsZero(Part.UnPr);
|
|
360
360
|
}
|
|
361
361
|
else {
|
|
362
362
|
if (InsuranceOnly) {
|
|
363
|
-
return (Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) && !
|
|
363
|
+
return (Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) && !tr_utils_1.TrUtils.IsZero(Part.AssPr);
|
|
364
364
|
}
|
|
365
365
|
else {
|
|
366
366
|
return (Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared);
|
|
@@ -387,7 +387,7 @@ class EstPrintService {
|
|
|
387
387
|
}
|
|
388
388
|
static ResetQtyAndUoM(Parts) {
|
|
389
389
|
Parts.forEach((Item) => {
|
|
390
|
-
if (!
|
|
390
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
391
391
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
392
392
|
}
|
|
393
393
|
});
|
|
@@ -395,10 +395,10 @@ class EstPrintService {
|
|
|
395
395
|
}
|
|
396
396
|
static CheckAndShowItemsAsAR(argROData) {
|
|
397
397
|
let AccPartsIndex = argROData.Parts.findIndex((Part) => {
|
|
398
|
-
return !
|
|
398
|
+
return !tr_utils_1.TrUtils.IsNull((Part.CollId));
|
|
399
399
|
});
|
|
400
400
|
let InsLaborIndex = argROData.Ops.findIndex((Labor) => {
|
|
401
|
-
return !
|
|
401
|
+
return !tr_utils_1.TrUtils.IsNull((Labor.CollId));
|
|
402
402
|
});
|
|
403
403
|
if (AccPartsIndex !== -1 || InsLaborIndex !== -1) {
|
|
404
404
|
return true;
|
|
@@ -413,33 +413,33 @@ class EstPrintService {
|
|
|
413
413
|
});
|
|
414
414
|
ROPrintData.Ops.forEach((Labor) => {
|
|
415
415
|
// console.log('Labor', Labor);
|
|
416
|
-
Labor.NetAmt =
|
|
417
|
-
Labor.CCGST =
|
|
418
|
-
Labor.CSGST =
|
|
419
|
-
Labor.CIGST =
|
|
420
|
-
Labor.Disc =
|
|
421
|
-
Labor.AssPr =
|
|
422
|
-
Labor.ACGST =
|
|
423
|
-
Labor.ASGST =
|
|
424
|
-
Labor.AIGST =
|
|
416
|
+
Labor.NetAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.NetAmt);
|
|
417
|
+
Labor.CCGST = tr_utils_1.TrUtils.FixPriceValue(Labor.CCGST);
|
|
418
|
+
Labor.CSGST = tr_utils_1.TrUtils.FixPriceValue(Labor.CSGST);
|
|
419
|
+
Labor.CIGST = tr_utils_1.TrUtils.FixPriceValue(Labor.CIGST);
|
|
420
|
+
Labor.Disc = tr_utils_1.TrUtils.FixPriceValue(Labor.Disc);
|
|
421
|
+
Labor.AssPr = tr_utils_1.TrUtils.FixPriceValue(Labor.AssPr);
|
|
422
|
+
Labor.ACGST = tr_utils_1.TrUtils.FixPriceValue(Labor.ACGST);
|
|
423
|
+
Labor.ASGST = tr_utils_1.TrUtils.FixPriceValue(Labor.ASGST);
|
|
424
|
+
Labor.AIGST = tr_utils_1.TrUtils.FixPriceValue(Labor.AIGST);
|
|
425
425
|
if (Consolidate) {
|
|
426
426
|
if (Labor.PBy === enums_1.PayTypeEnum.Customer) {
|
|
427
|
-
Labor.EstPr =
|
|
428
|
-
Labor.Pr =
|
|
427
|
+
Labor.EstPr = tr_utils_1.TrUtils.FixPriceValue(Labor.CustAfterTax);
|
|
428
|
+
Labor.Pr = tr_utils_1.TrUtils.FixPriceValue(Labor.CustAfterTax);
|
|
429
429
|
}
|
|
430
430
|
else {
|
|
431
|
-
Labor.EstPr =
|
|
432
|
-
Labor.Pr =
|
|
431
|
+
Labor.EstPr = tr_utils_1.TrUtils.FixPriceValue(Labor.InsAfterTax);
|
|
432
|
+
Labor.Pr = tr_utils_1.TrUtils.FixPriceValue(Labor.InsAfterTax);
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
else {
|
|
436
|
-
Labor.EstPr =
|
|
437
|
-
Labor.Pr =
|
|
436
|
+
Labor.EstPr = tr_utils_1.TrUtils.FixPriceValue(Labor.EstPr);
|
|
437
|
+
Labor.Pr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
|
|
438
438
|
}
|
|
439
|
-
Labor.ECGST =
|
|
440
|
-
Labor.ESGST =
|
|
441
|
-
Labor.EIGST =
|
|
442
|
-
if (
|
|
439
|
+
Labor.ECGST = tr_utils_1.TrUtils.FixPriceValue(Labor.ECGST);
|
|
440
|
+
Labor.ESGST = tr_utils_1.TrUtils.FixPriceValue(Labor.ESGST);
|
|
441
|
+
Labor.EIGST = tr_utils_1.TrUtils.FixPriceValue(Labor.EIGST);
|
|
442
|
+
if (tr_utils_1.TrUtils.IsNull(Labor.CollId)) {
|
|
443
443
|
let LaborColli = {
|
|
444
444
|
_id: Labor._id,
|
|
445
445
|
Desc: Labor.Desc,
|
|
@@ -455,37 +455,37 @@ class EstPrintService {
|
|
|
455
455
|
});
|
|
456
456
|
ROPrintData.Parts.forEach((Part) => {
|
|
457
457
|
// console.log('Part', Part);
|
|
458
|
-
Part.NetAmt =
|
|
459
|
-
Part.UnAmt =
|
|
460
|
-
Part.CCGST =
|
|
461
|
-
Part.CSGST =
|
|
462
|
-
Part.CIGST =
|
|
463
|
-
Part.Disc =
|
|
464
|
-
Part.AssPr =
|
|
465
|
-
Part.AssAmt =
|
|
466
|
-
Part.ACGST =
|
|
467
|
-
Part.ASGST =
|
|
468
|
-
Part.AIGST =
|
|
469
|
-
Part.EstPr =
|
|
458
|
+
Part.NetAmt = tr_utils_1.TrUtils.FixPriceValue(Part.NetAmt);
|
|
459
|
+
Part.UnAmt = tr_utils_1.TrUtils.FixPriceValue(Part.UnAmt);
|
|
460
|
+
Part.CCGST = tr_utils_1.TrUtils.FixPriceValue(Part.CCGST);
|
|
461
|
+
Part.CSGST = tr_utils_1.TrUtils.FixPriceValue(Part.CSGST);
|
|
462
|
+
Part.CIGST = tr_utils_1.TrUtils.FixPriceValue(Part.CIGST);
|
|
463
|
+
Part.Disc = tr_utils_1.TrUtils.FixPriceValue(Part.Disc);
|
|
464
|
+
Part.AssPr = tr_utils_1.TrUtils.FixPriceValue(Part.AssPr);
|
|
465
|
+
Part.AssAmt = tr_utils_1.TrUtils.FixPriceValue(Part.AssAmt);
|
|
466
|
+
Part.ACGST = tr_utils_1.TrUtils.FixPriceValue(Part.ACGST);
|
|
467
|
+
Part.ASGST = tr_utils_1.TrUtils.FixPriceValue(Part.ASGST);
|
|
468
|
+
Part.AIGST = tr_utils_1.TrUtils.FixPriceValue(Part.AIGST);
|
|
469
|
+
Part.EstPr = tr_utils_1.TrUtils.FixPriceValue(Part.EstPr);
|
|
470
470
|
if (Consolidate) {
|
|
471
471
|
if (Part.PBy === enums_1.PayTypeEnum.Customer) {
|
|
472
|
-
Part.EstPr =
|
|
473
|
-
Part.UnPr =
|
|
472
|
+
Part.EstPr = tr_utils_1.TrUtils.FixPriceValue(Part.CustAfterTax / Part.Qty);
|
|
473
|
+
Part.UnPr = tr_utils_1.TrUtils.FixPriceValue(Part.CustAfterTax / Part.Qty);
|
|
474
474
|
}
|
|
475
475
|
else {
|
|
476
|
-
Part.EstPr =
|
|
477
|
-
Part.UnPr =
|
|
476
|
+
Part.EstPr = tr_utils_1.TrUtils.FixPriceValue(Part.InsAfterTax / Part.Qty);
|
|
477
|
+
Part.UnPr = tr_utils_1.TrUtils.FixPriceValue(Part.InsAfterTax / Part.Qty);
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
else {
|
|
481
|
-
Part.EstPr =
|
|
482
|
-
Part.UnPr =
|
|
483
|
-
}
|
|
484
|
-
Part.EstAmt =
|
|
485
|
-
Part.ECGST =
|
|
486
|
-
Part.ESGST =
|
|
487
|
-
Part.EIGST =
|
|
488
|
-
if (
|
|
481
|
+
Part.EstPr = tr_utils_1.TrUtils.FixPriceValue(Part.EstPr);
|
|
482
|
+
Part.UnPr = tr_utils_1.TrUtils.FixPriceValue(Part.UnPr);
|
|
483
|
+
}
|
|
484
|
+
Part.EstAmt = tr_utils_1.TrUtils.FixPriceValue(Part.EstAmt);
|
|
485
|
+
Part.ECGST = tr_utils_1.TrUtils.FixPriceValue(Part.ECGST);
|
|
486
|
+
Part.ESGST = tr_utils_1.TrUtils.FixPriceValue(Part.ESGST);
|
|
487
|
+
Part.EIGST = tr_utils_1.TrUtils.FixPriceValue(Part.EIGST);
|
|
488
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
489
489
|
let LaborIndex = ROPrintData.Ops.findIndex((Labor) => {
|
|
490
490
|
return Labor._id === Part.OpId;
|
|
491
491
|
});
|
|
@@ -506,13 +506,13 @@ class EstPrintService {
|
|
|
506
506
|
return ROPrintData;
|
|
507
507
|
}
|
|
508
508
|
static ResetItemsDataById(Collision, AddedOperations, AddedParts) {
|
|
509
|
-
Collision.PartData =
|
|
509
|
+
Collision.PartData = tr_utils_1.TrUtils.IsNull(Collision.PartId)
|
|
510
510
|
? null : this.GetPartDataById(Collision.PartId, AddedParts);
|
|
511
|
-
Collision.RRFData =
|
|
511
|
+
Collision.RRFData = tr_utils_1.TrUtils.IsNull(Collision.RRFId)
|
|
512
512
|
? null : this.GetLaborDataById(Collision.RRFId, AddedOperations);
|
|
513
|
-
Collision.PtngData =
|
|
513
|
+
Collision.PtngData = tr_utils_1.TrUtils.IsNull(Collision.PainId)
|
|
514
514
|
? null : this.GetLaborDataById(Collision.PainId, AddedOperations);
|
|
515
|
-
Collision.DtngData =
|
|
515
|
+
Collision.DtngData = tr_utils_1.TrUtils.IsNull(Collision.RepId)
|
|
516
516
|
? null : this.GetLaborDataById(Collision.RepId, AddedOperations);
|
|
517
517
|
return Collision;
|
|
518
518
|
}
|
|
@@ -530,28 +530,28 @@ class EstPrintService {
|
|
|
530
530
|
}
|
|
531
531
|
static EmptyInvalidCollisionRepairItems(Colli) {
|
|
532
532
|
Colli.forEach((CollisionItem) => {
|
|
533
|
-
if (!
|
|
533
|
+
if (!tr_utils_1.TrUtils.IsNull(CollisionItem.PartData) && !this.CheckOperationHasActiveStatus(CollisionItem.PartData.Sts)) {
|
|
534
534
|
CollisionItem.PartData.EstPr = null;
|
|
535
535
|
CollisionItem.PartData.AssPr = null;
|
|
536
536
|
CollisionItem.PartData.UnPr = null;
|
|
537
537
|
CollisionItem.PartData.Disc = 0;
|
|
538
538
|
CollisionItem.PartData.RecDisc = 0;
|
|
539
539
|
}
|
|
540
|
-
if (!
|
|
540
|
+
if (!tr_utils_1.TrUtils.IsNull(CollisionItem.RRFData) && !this.CheckOperationHasActiveStatus(CollisionItem.RRFData.Sts)) {
|
|
541
541
|
CollisionItem.RRFData.EstPr = null;
|
|
542
542
|
CollisionItem.RRFData.AssPr = null;
|
|
543
543
|
CollisionItem.RRFData.Pr = null;
|
|
544
544
|
CollisionItem.RRFData.Disc = 0;
|
|
545
545
|
CollisionItem.RRFData.RecDisc = 0;
|
|
546
546
|
}
|
|
547
|
-
if (!
|
|
547
|
+
if (!tr_utils_1.TrUtils.IsNull(CollisionItem.DtngData) && !this.CheckOperationHasActiveStatus(CollisionItem.DtngData.Sts)) {
|
|
548
548
|
CollisionItem.DtngData.EstPr = null;
|
|
549
549
|
CollisionItem.DtngData.AssPr = null;
|
|
550
550
|
CollisionItem.DtngData.Pr = null;
|
|
551
551
|
CollisionItem.DtngData.Disc = 0;
|
|
552
552
|
CollisionItem.DtngData.RecDisc = 0;
|
|
553
553
|
}
|
|
554
|
-
if (!
|
|
554
|
+
if (!tr_utils_1.TrUtils.IsNull(CollisionItem.PtngData) && !this.CheckOperationHasActiveStatus(CollisionItem.PtngData.Sts)) {
|
|
555
555
|
CollisionItem.PtngData.EstPr = null;
|
|
556
556
|
CollisionItem.PtngData.AssPr = null;
|
|
557
557
|
CollisionItem.PtngData.Pr = null;
|
|
@@ -570,19 +570,19 @@ class EstPrintService {
|
|
|
570
570
|
});
|
|
571
571
|
ROPrintData.Colli.forEach((Collision) => {
|
|
572
572
|
let LineTotal = 0;
|
|
573
|
-
if (!
|
|
573
|
+
if (!tr_utils_1.TrUtils.IsNull(Collision.PartData)) {
|
|
574
574
|
LineTotal += this.GetCollisionPartLineTotal(Collision.PartData, AsCustomerOnly, AsInsuranceOnly, Consolidate);
|
|
575
575
|
}
|
|
576
|
-
if (!
|
|
576
|
+
if (!tr_utils_1.TrUtils.IsNull(Collision.RRFData)) {
|
|
577
577
|
LineTotal += this.GetCollisionLaborLineTotal(Collision.RRFData, AsCustomerOnly, AsInsuranceOnly, Consolidate);
|
|
578
578
|
}
|
|
579
|
-
if (!
|
|
579
|
+
if (!tr_utils_1.TrUtils.IsNull(Collision.PtngData)) {
|
|
580
580
|
LineTotal += this.GetCollisionLaborLineTotal(Collision.PtngData, AsCustomerOnly, AsInsuranceOnly, Consolidate);
|
|
581
581
|
}
|
|
582
|
-
if (!
|
|
582
|
+
if (!tr_utils_1.TrUtils.IsNull(Collision.DtngData)) {
|
|
583
583
|
LineTotal += this.GetCollisionLaborLineTotal(Collision.DtngData, AsCustomerOnly, AsInsuranceOnly, Consolidate);
|
|
584
584
|
}
|
|
585
|
-
Collision.LineTotal =
|
|
585
|
+
Collision.LineTotal = tr_utils_1.TrUtils.FixPriceValue(LineTotal);
|
|
586
586
|
});
|
|
587
587
|
return ROPrintData;
|
|
588
588
|
}
|
|
@@ -668,7 +668,7 @@ class EstPrintService {
|
|
|
668
668
|
LineTotal = LaborData.InsAfterLaborDisc + LaborData.CustAfterLaborDisc;
|
|
669
669
|
}
|
|
670
670
|
}
|
|
671
|
-
return
|
|
671
|
+
return tr_utils_1.TrUtils.FixedTo(LineTotal);
|
|
672
672
|
}
|
|
673
673
|
static GetPartLineTotal(PartData, IncludeGST, AsCustomerOnly, AsInsuranceOnly, Consolidate) {
|
|
674
674
|
let LineTotal = 0;
|
|
@@ -696,20 +696,20 @@ class EstPrintService {
|
|
|
696
696
|
LineTotal = PartData.InsAfterPartDisc + PartData.CustAfterPartDisc;
|
|
697
697
|
}
|
|
698
698
|
}
|
|
699
|
-
return
|
|
699
|
+
return tr_utils_1.TrUtils.FixedTo(LineTotal);
|
|
700
700
|
}
|
|
701
701
|
static ReverseItemsForROPrint(argROData, isReverse) {
|
|
702
702
|
if (isReverse) {
|
|
703
|
-
argROData.Comps =
|
|
704
|
-
argROData.Ops =
|
|
705
|
-
argROData.Parts =
|
|
706
|
-
argROData.Colli =
|
|
703
|
+
argROData.Comps = tr_utils_1.TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps.reverse();
|
|
704
|
+
argROData.Ops = tr_utils_1.TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops.reverse();
|
|
705
|
+
argROData.Parts = tr_utils_1.TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts.reverse();
|
|
706
|
+
argROData.Colli = tr_utils_1.TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli.reverse();
|
|
707
707
|
}
|
|
708
708
|
else {
|
|
709
|
-
argROData.Comps =
|
|
710
|
-
argROData.Ops =
|
|
711
|
-
argROData.Parts =
|
|
712
|
-
argROData.Colli =
|
|
709
|
+
argROData.Comps = tr_utils_1.TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps;
|
|
710
|
+
argROData.Ops = tr_utils_1.TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops;
|
|
711
|
+
argROData.Parts = tr_utils_1.TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts;
|
|
712
|
+
argROData.Colli = tr_utils_1.TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli;
|
|
713
713
|
}
|
|
714
714
|
let ReversedLabors = [];
|
|
715
715
|
argROData.Comps.forEach((Complaint) => {
|
|
@@ -720,7 +720,7 @@ class EstPrintService {
|
|
|
720
720
|
});
|
|
721
721
|
});
|
|
722
722
|
argROData.Ops.forEach((Labor) => {
|
|
723
|
-
if (
|
|
723
|
+
if (tr_utils_1.TrUtils.IsNull(Labor.CompId)) {
|
|
724
724
|
ReversedLabors.push(Labor);
|
|
725
725
|
}
|
|
726
726
|
});
|
|
@@ -728,13 +728,13 @@ class EstPrintService {
|
|
|
728
728
|
let ReversedParts = [];
|
|
729
729
|
argROData.Ops.forEach((Labor) => {
|
|
730
730
|
argROData.Parts.forEach((Part) => {
|
|
731
|
-
if (
|
|
731
|
+
if (tr_utils_1.TrUtils.IsNull(Part.CollId) && (Part.OpId === Labor._id)) {
|
|
732
732
|
ReversedParts.push(Part);
|
|
733
733
|
}
|
|
734
734
|
});
|
|
735
735
|
});
|
|
736
736
|
argROData.Parts.forEach((Part) => {
|
|
737
|
-
if (!
|
|
737
|
+
if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
738
738
|
ReversedParts.push(Part);
|
|
739
739
|
}
|
|
740
740
|
});
|
|
@@ -743,42 +743,42 @@ class EstPrintService {
|
|
|
743
743
|
}
|
|
744
744
|
static CheckAndGetCombinedTotals(AsCustomerAndInsurance, AsInsuranceOrCustomer, finalTotalsData) {
|
|
745
745
|
if (AsCustomerAndInsurance || AsInsuranceOrCustomer) {
|
|
746
|
-
finalTotalsData.InsLaborTotalBeforeDisc =
|
|
746
|
+
finalTotalsData.InsLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustLaborTotalBeforeDisc) +
|
|
747
747
|
Number(finalTotalsData.InsLaborTotalBeforeDisc));
|
|
748
|
-
finalTotalsData.InsLaborDiscTotal =
|
|
748
|
+
finalTotalsData.InsLaborDiscTotal = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustLaborDiscTotal) +
|
|
749
749
|
Number(finalTotalsData.InsLaborDiscTotal));
|
|
750
|
-
finalTotalsData.InsLaborCGST =
|
|
750
|
+
finalTotalsData.InsLaborCGST = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustLaborCGST) +
|
|
751
751
|
Number(finalTotalsData.InsLaborCGST));
|
|
752
|
-
finalTotalsData.InsLaborSGST =
|
|
752
|
+
finalTotalsData.InsLaborSGST = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustLaborSGST) +
|
|
753
753
|
Number(finalTotalsData.InsLaborSGST));
|
|
754
|
-
finalTotalsData.InsLaborIGST =
|
|
754
|
+
finalTotalsData.InsLaborIGST = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustLaborIGST) +
|
|
755
755
|
Number(finalTotalsData.InsLaborIGST));
|
|
756
|
-
finalTotalsData.InsPartIGST =
|
|
756
|
+
finalTotalsData.InsPartIGST = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustPartIGST) +
|
|
757
757
|
Number(finalTotalsData.InsPartIGST));
|
|
758
|
-
finalTotalsData.InsPartsTotalBeforeDisc =
|
|
758
|
+
finalTotalsData.InsPartsTotalBeforeDisc = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustPartsTotalBeforeDisc) +
|
|
759
759
|
Number(finalTotalsData.InsPartsTotalBeforeDisc));
|
|
760
|
-
finalTotalsData.InsPartsDiscTotal =
|
|
760
|
+
finalTotalsData.InsPartsDiscTotal = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustPartsDiscTotal) +
|
|
761
761
|
Number(finalTotalsData.InsPartsDiscTotal));
|
|
762
|
-
finalTotalsData.InsPartCGST =
|
|
762
|
+
finalTotalsData.InsPartCGST = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustPartCGST) +
|
|
763
763
|
Number(finalTotalsData.InsPartCGST));
|
|
764
|
-
finalTotalsData.InsPartSGST =
|
|
764
|
+
finalTotalsData.InsPartSGST = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustPartSGST) +
|
|
765
765
|
Number(finalTotalsData.InsPartSGST));
|
|
766
|
-
finalTotalsData.InsLaborTotalAfterTax =
|
|
766
|
+
finalTotalsData.InsLaborTotalAfterTax = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustLaborAfterTax) +
|
|
767
767
|
Number(finalTotalsData.InsLaborTotalAfterTax));
|
|
768
|
-
finalTotalsData.InsPartsTotalAfterTax =
|
|
768
|
+
finalTotalsData.InsPartsTotalAfterTax = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.CustPartAfterTax) +
|
|
769
769
|
Number(finalTotalsData.InsPartsTotalAfterTax));
|
|
770
|
-
finalTotalsData.FixedInsTotal =
|
|
770
|
+
finalTotalsData.FixedInsTotal = tr_utils_1.TrUtils.FixPriceValue(Number(finalTotalsData.FixedTotal) +
|
|
771
771
|
Number(finalTotalsData.FixedInsTotal));
|
|
772
|
-
finalTotalsData.InsTotalRoundedBy =
|
|
773
|
-
finalTotalsData.InsRoundedTotal =
|
|
772
|
+
finalTotalsData.InsTotalRoundedBy = tr_utils_1.TrUtils.FixPriceValue(Math.round(Number(finalTotalsData.FixedInsTotal)) - Number(finalTotalsData.FixedInsTotal));
|
|
773
|
+
finalTotalsData.InsRoundedTotal = tr_utils_1.TrUtils.FixPriceValue(Math.round(Number(finalTotalsData.FixedInsTotal)));
|
|
774
774
|
let InsTaxGroupData = [];
|
|
775
775
|
finalTotalsData.InsTaxGroupData.forEach((InsTaxGroup) => {
|
|
776
776
|
let index = finalTotalsData.CustTaxGroupData.findIndex((CustTaxGroup) => {
|
|
777
777
|
return CustTaxGroup.HSN === InsTaxGroup.HSN;
|
|
778
778
|
});
|
|
779
779
|
if (index !== -1) {
|
|
780
|
-
InsTaxGroup.TotalTaxAmount =
|
|
781
|
-
InsTaxGroup.TotalTaxableAmount =
|
|
780
|
+
InsTaxGroup.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(Number(InsTaxGroup.TotalTaxAmount) + Number(finalTotalsData.CustTaxGroupData[index].TotalTaxAmount));
|
|
781
|
+
InsTaxGroup.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(Number(InsTaxGroup.TotalTaxableAmount) + Number(finalTotalsData.CustTaxGroupData[index].TotalTaxableAmount));
|
|
782
782
|
}
|
|
783
783
|
InsTaxGroupData.push(InsTaxGroup);
|
|
784
784
|
});
|
|
@@ -795,26 +795,26 @@ class EstPrintService {
|
|
|
795
795
|
LaborList.forEach((Labor) => {
|
|
796
796
|
Labor.HSN = Labor.SAC;
|
|
797
797
|
if (Labor.Sts === enums_1.LaborStatusEnum.New || Labor.Sts === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
798
|
-
Labor.UnPr =
|
|
798
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.EstPr);
|
|
799
799
|
Labor.Disc = 0;
|
|
800
800
|
Labor.Perc = '';
|
|
801
801
|
}
|
|
802
802
|
else {
|
|
803
|
-
Labor.UnPr =
|
|
803
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
|
|
804
804
|
}
|
|
805
805
|
});
|
|
806
806
|
return LaborList;
|
|
807
807
|
}
|
|
808
808
|
static GetCustItemsPrintInfo(Items, LaborList) {
|
|
809
809
|
Items.forEach((Item) => {
|
|
810
|
-
let LaborStatus =
|
|
810
|
+
let LaborStatus = tr_utils_1.TrUtils.IsNull(Item.CollId) ? this.GetPartParentStatus(Item.OpId, LaborList) : Item.Sts;
|
|
811
811
|
if (LaborStatus === enums_1.LaborStatusEnum.New || LaborStatus === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
812
|
-
Item.UnPr =
|
|
812
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.EstPr);
|
|
813
813
|
Item.Disc = 0;
|
|
814
814
|
Item.Perc = '';
|
|
815
815
|
}
|
|
816
816
|
else {
|
|
817
|
-
Item.UnPr =
|
|
817
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
820
|
return Items;
|
|
@@ -828,9 +828,9 @@ class EstPrintService {
|
|
|
828
828
|
LaborList.forEach((Labor) => {
|
|
829
829
|
if (Labor.Sts === enums_1.LaborStatusEnum.New || Labor.Sts === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
830
830
|
if (IncludeGST) {
|
|
831
|
-
Labor.CGSTAmt =
|
|
832
|
-
Labor.SGSTAmt =
|
|
833
|
-
Labor.IGSTAmt =
|
|
831
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.ECGST);
|
|
832
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.ESGST);
|
|
833
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.EIGST);
|
|
834
834
|
}
|
|
835
835
|
else {
|
|
836
836
|
Labor.CGSTAmt = 0;
|
|
@@ -840,9 +840,9 @@ class EstPrintService {
|
|
|
840
840
|
}
|
|
841
841
|
else {
|
|
842
842
|
if (IncludeGST) {
|
|
843
|
-
Labor.CGSTAmt =
|
|
844
|
-
Labor.SGSTAmt =
|
|
845
|
-
Labor.IGSTAmt =
|
|
843
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CCGST);
|
|
844
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CSGST);
|
|
845
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CIGST);
|
|
846
846
|
}
|
|
847
847
|
else {
|
|
848
848
|
Labor.CGSTAmt = 0;
|
|
@@ -858,12 +858,12 @@ class EstPrintService {
|
|
|
858
858
|
}
|
|
859
859
|
static GetCustPartTaxInfo(Items, LaborList, IncludeGST, TaxCodes) {
|
|
860
860
|
Items.forEach((Item) => {
|
|
861
|
-
let LaborStatus =
|
|
861
|
+
let LaborStatus = tr_utils_1.TrUtils.IsNull(Item.CollId) ? this.GetPartParentStatus(Item.OpId, LaborList) : Item.Sts;
|
|
862
862
|
if (LaborStatus === enums_1.LaborStatusEnum.New || LaborStatus === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
863
863
|
if (IncludeGST) {
|
|
864
|
-
Item.CGSTAmt =
|
|
865
|
-
Item.SGSTAmt =
|
|
866
|
-
Item.IGSTAmt =
|
|
864
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.ECGST);
|
|
865
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.ESGST);
|
|
866
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.EIGST);
|
|
867
867
|
}
|
|
868
868
|
else {
|
|
869
869
|
Item.CGSTAmt = 0;
|
|
@@ -873,9 +873,9 @@ class EstPrintService {
|
|
|
873
873
|
}
|
|
874
874
|
else {
|
|
875
875
|
if (IncludeGST) {
|
|
876
|
-
Item.CGSTAmt =
|
|
877
|
-
Item.SGSTAmt =
|
|
878
|
-
Item.IGSTAmt =
|
|
876
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CCGST);
|
|
877
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CSGST);
|
|
878
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CIGST);
|
|
879
879
|
}
|
|
880
880
|
else {
|
|
881
881
|
Item.CGSTAmt = 0;
|
|
@@ -898,22 +898,22 @@ class EstPrintService {
|
|
|
898
898
|
LaborList.forEach((Labor) => {
|
|
899
899
|
Labor.HSN = Labor.SAC;
|
|
900
900
|
if (Labor.Sts === enums_1.LaborStatusEnum.New || Labor.Sts === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
901
|
-
Labor.UnPr =
|
|
901
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.EstPr);
|
|
902
902
|
}
|
|
903
903
|
else {
|
|
904
|
-
Labor.UnPr =
|
|
904
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.NetAmt);
|
|
905
905
|
}
|
|
906
906
|
});
|
|
907
907
|
return LaborList;
|
|
908
908
|
}
|
|
909
909
|
static GetCustItemsAfterDiscPrintInfo(Items, LaborList) {
|
|
910
910
|
Items.forEach((Item) => {
|
|
911
|
-
let LaborStatus =
|
|
911
|
+
let LaborStatus = tr_utils_1.TrUtils.IsNull(Item.CollId) ? this.GetPartParentStatus(Item.OpId, LaborList) : Item.Sts;
|
|
912
912
|
if (LaborStatus === enums_1.LaborStatusEnum.New || LaborStatus === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
913
|
-
Item.UnPr =
|
|
913
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.EstPr);
|
|
914
914
|
}
|
|
915
915
|
else {
|
|
916
|
-
Item.UnPr =
|
|
916
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.division)(Item.NetAmt, Item.Qty));
|
|
917
917
|
}
|
|
918
918
|
});
|
|
919
919
|
return Items;
|
|
@@ -931,25 +931,25 @@ class EstPrintService {
|
|
|
931
931
|
}
|
|
932
932
|
static GetLaborCombinedPrintInfo(LaborList) {
|
|
933
933
|
LaborList.forEach((Labor) => {
|
|
934
|
-
Labor.AssPr =
|
|
934
|
+
Labor.AssPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(Labor.AssPr, Labor.NetAmt));
|
|
935
935
|
});
|
|
936
936
|
return LaborList;
|
|
937
937
|
}
|
|
938
938
|
static GetItemsCombinedPrintInfo(Items) {
|
|
939
939
|
Items.forEach((Item) => {
|
|
940
|
-
Item.AssPr =
|
|
940
|
+
Item.AssPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.division)((0, aggregation_1.addition)(Item.AssAmt, Item.NetAmt), Item.Qty));
|
|
941
941
|
});
|
|
942
942
|
return Items;
|
|
943
943
|
}
|
|
944
944
|
static GetSplitInfoForParts(Items) {
|
|
945
945
|
Items.forEach((Item) => {
|
|
946
|
-
Item.UnPr =
|
|
946
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.division)(Item.NetAmt, Item.Qty));
|
|
947
947
|
});
|
|
948
948
|
return Items;
|
|
949
949
|
}
|
|
950
950
|
static CheckLaborTaxItemIndex(LaborList) {
|
|
951
951
|
let TaxIndex = LaborList.findIndex((Labor) => {
|
|
952
|
-
if (!
|
|
952
|
+
if (!tr_utils_1.TrUtils.CheckInvalidSelect(Labor.TCode)) {
|
|
953
953
|
return Labor;
|
|
954
954
|
}
|
|
955
955
|
});
|
|
@@ -957,7 +957,7 @@ class EstPrintService {
|
|
|
957
957
|
}
|
|
958
958
|
static CheckPartTaxItemIndex(PartsList) {
|
|
959
959
|
let TaxIndex = PartsList.findIndex((Part) => {
|
|
960
|
-
if (!
|
|
960
|
+
if (!tr_utils_1.TrUtils.CheckInvalidSelect(Part.TCode)) {
|
|
961
961
|
return Part;
|
|
962
962
|
}
|
|
963
963
|
});
|
|
@@ -975,7 +975,7 @@ class EstPrintService {
|
|
|
975
975
|
}
|
|
976
976
|
else {
|
|
977
977
|
let SuppEstIndex;
|
|
978
|
-
if (!
|
|
978
|
+
if (!tr_utils_1.TrUtils.IsNull(SuppEstCodeValue)) {
|
|
979
979
|
SuppEstIndex = ROPrintData.SuppEst.findIndex((SuppEst) => {
|
|
980
980
|
return SuppEst.Id === SuppEstCodeValue;
|
|
981
981
|
});
|
|
@@ -990,7 +990,7 @@ class EstPrintService {
|
|
|
990
990
|
}
|
|
991
991
|
static GetFormatForEstPrint(SuppEstCodeValue, SuppEstIndex, ROPrintData, argROType, AsEstimated) {
|
|
992
992
|
let ROLaborParts = {};
|
|
993
|
-
if (!
|
|
993
|
+
if (!tr_utils_1.TrUtils.IsNull(SuppEstIndex)) {
|
|
994
994
|
ROLaborParts.Text = 'Supp.Est -' + (SuppEstIndex + 1);
|
|
995
995
|
}
|
|
996
996
|
ROLaborParts.Ops = this.SeparateLaborListByPTypeAndSuppIndex(ROPrintData.Ops, SuppEstCodeValue);
|
|
@@ -1008,7 +1008,7 @@ class EstPrintService {
|
|
|
1008
1008
|
static SeparateLaborListByPTypeAndSuppIndex(Operations, SuppEstCodeValue) {
|
|
1009
1009
|
let Ops = [];
|
|
1010
1010
|
Ops = Operations.filter((Operation) => {
|
|
1011
|
-
if (
|
|
1011
|
+
if (tr_utils_1.TrUtils.IsNull(Operation.SuppEst)) {
|
|
1012
1012
|
Operation.SuppEst = null;
|
|
1013
1013
|
}
|
|
1014
1014
|
return Operation.SuppEst === SuppEstCodeValue;
|
|
@@ -1018,7 +1018,7 @@ class EstPrintService {
|
|
|
1018
1018
|
static SeparateOnlyPartsByPTypeAndSuppIndex(Parts, SuppEstCodeValue) {
|
|
1019
1019
|
let SParts = [];
|
|
1020
1020
|
SParts = Parts.filter((Part) => {
|
|
1021
|
-
if (
|
|
1021
|
+
if (tr_utils_1.TrUtils.IsNull(Part.SuppEst)) {
|
|
1022
1022
|
Part.SuppEst = null;
|
|
1023
1023
|
}
|
|
1024
1024
|
return Part.SuppEst === SuppEstCodeValue;
|
|
@@ -1028,7 +1028,7 @@ class EstPrintService {
|
|
|
1028
1028
|
static SeparateCollisionBySuppIndex(Collisions, SuppEstCodeValue) {
|
|
1029
1029
|
let FilteredCollisions = [];
|
|
1030
1030
|
FilteredCollisions = Collisions.filter((Collision) => {
|
|
1031
|
-
if (
|
|
1031
|
+
if (tr_utils_1.TrUtils.IsNull(Collision.SuppEst)) {
|
|
1032
1032
|
Collision.SuppEst = null;
|
|
1033
1033
|
}
|
|
1034
1034
|
if (Collision.SuppEst === SuppEstCodeValue) {
|
|
@@ -1041,7 +1041,7 @@ class EstPrintService {
|
|
|
1041
1041
|
if (PrintPartNo) {
|
|
1042
1042
|
ROPrintData.PrintInfo.forEach((PrintData) => {
|
|
1043
1043
|
PrintData.Colli.forEach((Collision) => {
|
|
1044
|
-
if (!
|
|
1044
|
+
if (!tr_utils_1.TrUtils.IsNull(Collision.PartData) && !tr_utils_1.TrUtils.IsEmpty(Collision.PartData.MPN)) {
|
|
1045
1045
|
Collision.Desc = Collision.Desc + '/' + Collision.PartData.MPN;
|
|
1046
1046
|
}
|
|
1047
1047
|
});
|