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
|
@@ -4,23 +4,23 @@ exports.ROPrintService = 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("../shared/my-date");
|
|
8
|
+
const utils_1 = require("../shared/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 ROPrintService {
|
|
12
12
|
static GetRepairOrderPrintInfo(OriginalROData, OriginalCustomerData, OriginalVehicleData, OriginalEntityData, image, IncludeGST, ConsolidateGST, Payee, InsCompanyName, AsCustomerOnly, AsInsuranceOnly, TaxCodes, OrderType, isReverse) {
|
|
13
13
|
let ROPrintData = {};
|
|
14
|
-
let argROData =
|
|
15
|
-
argROData.Comps =
|
|
16
|
-
argROData.Ops =
|
|
17
|
-
argROData.Parts =
|
|
18
|
-
argROData.Colli =
|
|
14
|
+
let argROData = utils_1.TrUtils.Stringify(OriginalROData);
|
|
15
|
+
argROData.Comps = utils_1.TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps;
|
|
16
|
+
argROData.Ops = utils_1.TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops;
|
|
17
|
+
argROData.Parts = utils_1.TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts;
|
|
18
|
+
argROData.Colli = utils_1.TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli;
|
|
19
19
|
if (!IncludeGST) {
|
|
20
20
|
argROData.Settings.Tax = 'NO';
|
|
21
21
|
}
|
|
22
22
|
let SType;
|
|
23
|
-
if (!
|
|
23
|
+
if (!utils_1.TrUtils.IsNull(OriginalROData.SType)) {
|
|
24
24
|
SType = OriginalROData.SType;
|
|
25
25
|
}
|
|
26
26
|
ROPrintData = this.GetROBasicDetailsForPrint(ROPrintData, argROData, OriginalVehicleData, OrderType);
|
|
@@ -45,33 +45,33 @@ class ROPrintService {
|
|
|
45
45
|
}
|
|
46
46
|
argROData = this.ReverseItemsForROPrint(argROData, isReverse);
|
|
47
47
|
let finalTotalsData = ro_totals_service_1.ROTotalsService.GetTotalsValue(argROData, TaxCodes, true, true, true, ROPrintData.Entity.Round);
|
|
48
|
-
finalTotalsData.Settings =
|
|
48
|
+
finalTotalsData.Settings = utils_1.TrUtils.Stringify(argROData.Settings);
|
|
49
49
|
finalTotalsData = this.GetDetailedInfoForItems(finalTotalsData, IncludeGST, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly, TaxCodes);
|
|
50
50
|
if (ConsolidateGST) {
|
|
51
51
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
52
52
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
53
53
|
}
|
|
54
|
-
ROPrintData =
|
|
54
|
+
ROPrintData = utils_1.TrUtils.ConcatObjects(ROPrintData, finalTotalsData);
|
|
55
55
|
if (ROPrintData.ShowAccParts) {
|
|
56
56
|
ROPrintData = this.ConvertItemsAsAR(ROPrintData);
|
|
57
57
|
}
|
|
58
58
|
ROPrintData.Colli = this.EmptyInvalidCollisionRepairItems(ROPrintData.Colli);
|
|
59
|
-
ROPrintData.Comps =
|
|
60
|
-
ROPrintData.EstTotal =
|
|
59
|
+
ROPrintData.Comps = utils_1.TrUtils.Stringify(argROData.Comps);
|
|
60
|
+
ROPrintData.EstTotal = utils_1.TrUtils.Stringify(argROData.EstTotal);
|
|
61
61
|
ROPrintData.Advisor = this.GetEmployeeData(argROData.EmpData);
|
|
62
|
-
ROPrintData.VehMore =
|
|
63
|
-
ROPrintData.SANotes =
|
|
64
|
-
ROPrintData.OrdType =
|
|
62
|
+
ROPrintData.VehMore = utils_1.TrUtils.Stringify(argROData.VehMore);
|
|
63
|
+
ROPrintData.SANotes = utils_1.TrUtils.Stringify(argROData.SANotes);
|
|
64
|
+
ROPrintData.OrdType = utils_1.TrUtils.Stringify(argROData.OrdType);
|
|
65
65
|
ROPrintData = this.GetLineTotals(ROPrintData, IncludeGST, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly);
|
|
66
66
|
ROPrintData.PrintInfo = this.PrepareFormatForROPrint(ROPrintData, Payee, code_enums_1.ROTypeEnum.RepairOrder);
|
|
67
67
|
ROPrintData = this.CheckAndCombineDescMPNForAR(ROPrintData.Entity.MPN, ROPrintData);
|
|
68
68
|
ROPrintData.Vehicle = shared_print_service_1.PrintSharedService.GetVehicleFromServiceAndFormatData(OriginalVehicleData);
|
|
69
69
|
ROPrintData.Customer = shared_print_service_1.PrintSharedService.GetCustomerFromServiceAndFormatData(OriginalCustomerData);
|
|
70
|
-
if (!
|
|
70
|
+
if (!utils_1.TrUtils.IsNull(OriginalROData.SrvLoc)) {
|
|
71
71
|
let location = {};
|
|
72
72
|
location.Adrs = shared_print_service_1.PrintSharedService.GetAddress(OriginalROData.SrvLoc.Adrs);
|
|
73
73
|
location.Name = OriginalROData.SrvLoc.ConName;
|
|
74
|
-
if (!
|
|
74
|
+
if (!utils_1.TrUtils.IsNull(OriginalROData.SrvLoc.ConPh)) {
|
|
75
75
|
location.Cons = [
|
|
76
76
|
{
|
|
77
77
|
Type: 'M',
|
|
@@ -92,7 +92,7 @@ class ROPrintService {
|
|
|
92
92
|
}
|
|
93
93
|
static GetEmployeeData(empData) {
|
|
94
94
|
let SA = {};
|
|
95
|
-
if (!
|
|
95
|
+
if (!utils_1.TrUtils.IsNull(empData)) {
|
|
96
96
|
SA.Name = empData.DName;
|
|
97
97
|
SA.Ph = empData.Cons.Phones.Main;
|
|
98
98
|
}
|
|
@@ -113,13 +113,13 @@ class ROPrintService {
|
|
|
113
113
|
ROPrintData.AsInsuranceOnly = AsInsuranceOnly;
|
|
114
114
|
ROPrintData.IncludeGST = IncludeGST;
|
|
115
115
|
ROPrintData.ConsolidateGST = ConsolidateGST;
|
|
116
|
-
ROPrintData.ShowIGST = (
|
|
116
|
+
ROPrintData.ShowIGST = (utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
117
117
|
ROPrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
118
118
|
// ROPrintData.ShowDiscountColumn = ((Payee === PayTypeEnum.Customer || AsCustomerOnly) && !ConsolidateGST) ? true : false;
|
|
119
119
|
return ROPrintData;
|
|
120
120
|
}
|
|
121
121
|
static GetInsDetailsForPrint(ROPrintData, InsCompanyName, argROData) {
|
|
122
|
-
if (
|
|
122
|
+
if (utils_1.TrUtils.IsNull(argROData.Ins)) {
|
|
123
123
|
argROData.Ins = this.GetDefualtInsData();
|
|
124
124
|
}
|
|
125
125
|
ROPrintData.InsComp = InsCompanyName;
|
|
@@ -161,7 +161,7 @@ class ROPrintService {
|
|
|
161
161
|
}
|
|
162
162
|
static ChangeDeclinedPartStatusToNew(Parts) {
|
|
163
163
|
Parts.forEach((Part) => {
|
|
164
|
-
if (!
|
|
164
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId) && Part.Sts === enums_1.LaborStatusEnum.Declined) {
|
|
165
165
|
Part.Sts = enums_1.LaborStatusEnum.New;
|
|
166
166
|
}
|
|
167
167
|
});
|
|
@@ -211,7 +211,7 @@ class ROPrintService {
|
|
|
211
211
|
}
|
|
212
212
|
static GetValidROPartsListByStatus(Parts) {
|
|
213
213
|
let PartsList = Parts.filter((Part) => {
|
|
214
|
-
if (
|
|
214
|
+
if (utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
215
215
|
return Part;
|
|
216
216
|
}
|
|
217
217
|
else {
|
|
@@ -242,10 +242,10 @@ class ROPrintService {
|
|
|
242
242
|
let LaborList = [];
|
|
243
243
|
LaborList = Labors.filter((Labor) => {
|
|
244
244
|
if (PType === enums_1.PayTypeEnum.Customer) {
|
|
245
|
-
return !
|
|
245
|
+
return !utils_1.TrUtils.IsZero(Labor.Pr);
|
|
246
246
|
}
|
|
247
247
|
else {
|
|
248
|
-
return !
|
|
248
|
+
return !utils_1.TrUtils.IsZero(Labor.AssPr);
|
|
249
249
|
}
|
|
250
250
|
});
|
|
251
251
|
return LaborList;
|
|
@@ -254,10 +254,10 @@ class ROPrintService {
|
|
|
254
254
|
let PartsList = [];
|
|
255
255
|
PartsList = Parts.filter((Part) => {
|
|
256
256
|
if (PType === enums_1.PayTypeEnum.Customer) {
|
|
257
|
-
return !
|
|
257
|
+
return !utils_1.TrUtils.IsZero(Part.UnPr);
|
|
258
258
|
}
|
|
259
259
|
else {
|
|
260
|
-
return !
|
|
260
|
+
return !utils_1.TrUtils.IsZero(Part.AssPr);
|
|
261
261
|
}
|
|
262
262
|
});
|
|
263
263
|
return PartsList;
|
|
@@ -278,7 +278,7 @@ class ROPrintService {
|
|
|
278
278
|
}
|
|
279
279
|
static ResetQtyAndUoM(Parts) {
|
|
280
280
|
Parts.forEach((Item) => {
|
|
281
|
-
if (!
|
|
281
|
+
if (!utils_1.TrUtils.IsZero(Item.Qty) && !utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
282
282
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
283
283
|
}
|
|
284
284
|
});
|
|
@@ -286,10 +286,10 @@ class ROPrintService {
|
|
|
286
286
|
}
|
|
287
287
|
static CheckAndShowItemsAsAR(argROData) {
|
|
288
288
|
let AccPartsIndex = argROData.Parts.findIndex((Part) => {
|
|
289
|
-
return !
|
|
289
|
+
return !utils_1.TrUtils.IsNull((Part.CollId));
|
|
290
290
|
});
|
|
291
291
|
let InsLaborIndex = argROData.Ops.findIndex((Labor) => {
|
|
292
|
-
return !
|
|
292
|
+
return !utils_1.TrUtils.IsNull((Labor.CollId));
|
|
293
293
|
});
|
|
294
294
|
if (AccPartsIndex !== -1 || InsLaborIndex !== -1) {
|
|
295
295
|
return true;
|
|
@@ -303,7 +303,7 @@ class ROPrintService {
|
|
|
303
303
|
Collision = this.ResetItemsDataById(Collision, ROPrintData.Ops, ROPrintData.Parts);
|
|
304
304
|
});
|
|
305
305
|
ROPrintData.Ops.forEach((Labor) => {
|
|
306
|
-
if (
|
|
306
|
+
if (utils_1.TrUtils.IsNull(Labor.CollId)) {
|
|
307
307
|
let LaborColli = {
|
|
308
308
|
_id: Labor._id,
|
|
309
309
|
Desc: Labor.Desc,
|
|
@@ -317,7 +317,7 @@ class ROPrintService {
|
|
|
317
317
|
}
|
|
318
318
|
});
|
|
319
319
|
ROPrintData.Parts.forEach((Part) => {
|
|
320
|
-
if (
|
|
320
|
+
if (utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
321
321
|
let LaborIndex = ROPrintData.Ops.findIndex((Labor) => {
|
|
322
322
|
return Labor._id === Part.OpId;
|
|
323
323
|
});
|
|
@@ -337,13 +337,13 @@ class ROPrintService {
|
|
|
337
337
|
return ROPrintData;
|
|
338
338
|
}
|
|
339
339
|
static ResetItemsDataById(Collision, AddedOperations, AddedParts) {
|
|
340
|
-
Collision.PartData =
|
|
340
|
+
Collision.PartData = utils_1.TrUtils.IsNull(Collision.PartId)
|
|
341
341
|
? null : this.GetPartDataById(Collision.PartId, AddedParts);
|
|
342
|
-
Collision.RRFData =
|
|
342
|
+
Collision.RRFData = utils_1.TrUtils.IsNull(Collision.RRFId)
|
|
343
343
|
? null : this.GetLaborDataById(Collision.RRFId, AddedOperations);
|
|
344
|
-
Collision.PtngData =
|
|
344
|
+
Collision.PtngData = utils_1.TrUtils.IsNull(Collision.PainId)
|
|
345
345
|
? null : this.GetLaborDataById(Collision.PainId, AddedOperations);
|
|
346
|
-
Collision.DtngData =
|
|
346
|
+
Collision.DtngData = utils_1.TrUtils.IsNull(Collision.RepId)
|
|
347
347
|
? null : this.GetLaborDataById(Collision.RepId, AddedOperations);
|
|
348
348
|
}
|
|
349
349
|
static GetPartDataById(PartId, AddedParts) {
|
|
@@ -360,25 +360,25 @@ class ROPrintService {
|
|
|
360
360
|
}
|
|
361
361
|
static EmptyInvalidCollisionRepairItems(Colli) {
|
|
362
362
|
Colli.forEach((CollisionItem) => {
|
|
363
|
-
if (!
|
|
363
|
+
if (!utils_1.TrUtils.IsNull(CollisionItem.PartData) && !this.CheckOperationHasActiveStatus(CollisionItem.PartData.Sts)) {
|
|
364
364
|
CollisionItem.PartData.AssPr = null;
|
|
365
365
|
CollisionItem.PartData.UnPr = null;
|
|
366
366
|
CollisionItem.PartData.Disc = 0;
|
|
367
367
|
CollisionItem.PartData.RecDisc = 0;
|
|
368
368
|
}
|
|
369
|
-
if (!
|
|
369
|
+
if (!utils_1.TrUtils.IsNull(CollisionItem.RRFData) && !this.CheckOperationHasActiveStatus(CollisionItem.RRFData.Sts)) {
|
|
370
370
|
CollisionItem.RRFData.AssPr = null;
|
|
371
371
|
CollisionItem.RRFData.Pr = null;
|
|
372
372
|
CollisionItem.RRFData.Disc = 0;
|
|
373
373
|
CollisionItem.RRFData.RecDisc = 0;
|
|
374
374
|
}
|
|
375
|
-
if (!
|
|
375
|
+
if (!utils_1.TrUtils.IsNull(CollisionItem.DtngData) && !this.CheckOperationHasActiveStatus(CollisionItem.DtngData.Sts)) {
|
|
376
376
|
CollisionItem.DtngData.AssPr = null;
|
|
377
377
|
CollisionItem.DtngData.Pr = null;
|
|
378
378
|
CollisionItem.DtngData.Disc = 0;
|
|
379
379
|
CollisionItem.DtngData.RecDisc = 0;
|
|
380
380
|
}
|
|
381
|
-
if (!
|
|
381
|
+
if (!utils_1.TrUtils.IsNull(CollisionItem.PtngData) && !this.CheckOperationHasActiveStatus(CollisionItem.PtngData.Sts)) {
|
|
382
382
|
CollisionItem.PtngData.AssPr = null;
|
|
383
383
|
CollisionItem.PtngData.Pr = null;
|
|
384
384
|
CollisionItem.PtngData.Disc = 0;
|
|
@@ -396,19 +396,19 @@ class ROPrintService {
|
|
|
396
396
|
});
|
|
397
397
|
ROPrintData.Colli.forEach((Collision) => {
|
|
398
398
|
let LineTotal = 0;
|
|
399
|
-
if (!
|
|
399
|
+
if (!utils_1.TrUtils.IsNull(Collision.PartData)) {
|
|
400
400
|
LineTotal = (0, aggregation_1.addition)(LineTotal, this.GetCollisionPartLineTotal(Collision.PartData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
401
401
|
}
|
|
402
|
-
if (!
|
|
402
|
+
if (!utils_1.TrUtils.IsNull(Collision.RRFData)) {
|
|
403
403
|
LineTotal = (0, aggregation_1.addition)(LineTotal, this.GetCollisionLaborLineTotal(Collision.RRFData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
404
404
|
}
|
|
405
|
-
if (!
|
|
405
|
+
if (!utils_1.TrUtils.IsNull(Collision.PtngData)) {
|
|
406
406
|
LineTotal = (0, aggregation_1.addition)(LineTotal, this.GetCollisionLaborLineTotal(Collision.PtngData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
407
407
|
}
|
|
408
|
-
if (!
|
|
408
|
+
if (!utils_1.TrUtils.IsNull(Collision.DtngData)) {
|
|
409
409
|
LineTotal = (0, aggregation_1.addition)(LineTotal, this.GetCollisionLaborLineTotal(Collision.DtngData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
410
410
|
}
|
|
411
|
-
Collision.LineTotal =
|
|
411
|
+
Collision.LineTotal = utils_1.TrUtils.FixPriceValue(LineTotal);
|
|
412
412
|
});
|
|
413
413
|
return ROPrintData;
|
|
414
414
|
}
|
|
@@ -494,7 +494,7 @@ class ROPrintService {
|
|
|
494
494
|
LineTotal = (0, aggregation_1.addition)(LaborData.InsAfterLaborDisc, LaborData.CustAfterLaborDisc);
|
|
495
495
|
}
|
|
496
496
|
}
|
|
497
|
-
return
|
|
497
|
+
return utils_1.TrUtils.FixPriceValue(LineTotal);
|
|
498
498
|
}
|
|
499
499
|
static GetPartLineTotal(PartData, IncludeGST, AsCustomerOnly, AsInsuranceOnly) {
|
|
500
500
|
let LineTotal = 0;
|
|
@@ -522,20 +522,20 @@ class ROPrintService {
|
|
|
522
522
|
LineTotal = (0, aggregation_1.addition)(PartData.InsAfterPartDisc, PartData.CustAfterPartDisc);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
return
|
|
525
|
+
return utils_1.TrUtils.FixPriceValue(LineTotal);
|
|
526
526
|
}
|
|
527
527
|
static ReverseItemsForROPrint(argROData, isReverse) {
|
|
528
528
|
if (isReverse) {
|
|
529
|
-
argROData.Comps =
|
|
530
|
-
argROData.Ops =
|
|
531
|
-
argROData.Parts =
|
|
532
|
-
argROData.Colli =
|
|
529
|
+
argROData.Comps = utils_1.TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps.reverse();
|
|
530
|
+
argROData.Ops = utils_1.TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops.reverse();
|
|
531
|
+
argROData.Parts = utils_1.TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts.reverse();
|
|
532
|
+
argROData.Colli = utils_1.TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli.reverse();
|
|
533
533
|
}
|
|
534
534
|
else {
|
|
535
|
-
argROData.Comps =
|
|
536
|
-
argROData.Ops =
|
|
537
|
-
argROData.Parts =
|
|
538
|
-
argROData.Colli =
|
|
535
|
+
argROData.Comps = utils_1.TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps;
|
|
536
|
+
argROData.Ops = utils_1.TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops;
|
|
537
|
+
argROData.Parts = utils_1.TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts;
|
|
538
|
+
argROData.Colli = utils_1.TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli;
|
|
539
539
|
}
|
|
540
540
|
let ReversedLabors = [];
|
|
541
541
|
argROData.Comps.forEach((Complaint) => {
|
|
@@ -546,7 +546,7 @@ class ROPrintService {
|
|
|
546
546
|
});
|
|
547
547
|
});
|
|
548
548
|
argROData.Ops.forEach((Labor) => {
|
|
549
|
-
if (
|
|
549
|
+
if (utils_1.TrUtils.IsNull(Labor.CompId)) {
|
|
550
550
|
ReversedLabors.push(Labor);
|
|
551
551
|
}
|
|
552
552
|
});
|
|
@@ -554,13 +554,13 @@ class ROPrintService {
|
|
|
554
554
|
let ReversedParts = [];
|
|
555
555
|
argROData.Ops.forEach((Labor) => {
|
|
556
556
|
argROData.Parts.forEach((Part) => {
|
|
557
|
-
if (
|
|
557
|
+
if (utils_1.TrUtils.IsNull(Part.CollId) && (Part.OpId === Labor._id)) {
|
|
558
558
|
ReversedParts.push(Part);
|
|
559
559
|
}
|
|
560
560
|
});
|
|
561
561
|
});
|
|
562
562
|
argROData.Parts.forEach((Part) => {
|
|
563
|
-
if (!
|
|
563
|
+
if (!utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
564
564
|
ReversedParts.push(Part);
|
|
565
565
|
}
|
|
566
566
|
});
|
|
@@ -569,7 +569,7 @@ class ROPrintService {
|
|
|
569
569
|
}
|
|
570
570
|
static GetDetailedInfoForItems(ROTotalsData, IncludeGST, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly, TaxCodes) {
|
|
571
571
|
ROTotalsData.Ops = this.GetLaborPrintInfo(ROTotalsData.Ops, ConsolidateGST, IncludeGST, AsCustomerOnly, AsInsuranceOnly, TaxCodes);
|
|
572
|
-
ROTotalsData.Parts = this.GetItemsPrintInfo(
|
|
572
|
+
ROTotalsData.Parts = this.GetItemsPrintInfo(utils_1.TrUtils.Stringify(ROTotalsData.Parts), ConsolidateGST, IncludeGST, AsCustomerOnly, AsInsuranceOnly, TaxCodes);
|
|
573
573
|
if (IncludeGST && !ConsolidateGST) {
|
|
574
574
|
ROTotalsData.ShowDetailedLaborTaxInfo = this.CheckLaborTaxItemIndex(ROTotalsData.Ops) !== -1;
|
|
575
575
|
ROTotalsData.ShowDetailedPartTaxInfo = this.CheckPartTaxItemIndex(ROTotalsData.Parts) !== -1;
|
|
@@ -586,17 +586,17 @@ class ROPrintService {
|
|
|
586
586
|
if (AsCustomerOnly) {
|
|
587
587
|
if (IncludeGST) {
|
|
588
588
|
if (ConsolidateGST) {
|
|
589
|
-
Labor.UnPr =
|
|
589
|
+
Labor.UnPr = utils_1.TrUtils.FixedTo(Labor.CustAfterTax);
|
|
590
590
|
}
|
|
591
591
|
else {
|
|
592
|
-
Labor.UnPr =
|
|
592
|
+
Labor.UnPr = utils_1.TrUtils.FixedTo(Labor.Pr);
|
|
593
593
|
}
|
|
594
|
-
Labor.CGSTAmt =
|
|
595
|
-
Labor.SGSTAmt =
|
|
596
|
-
Labor.IGSTAmt =
|
|
594
|
+
Labor.CGSTAmt = utils_1.TrUtils.FixedTo(Labor.CCGST);
|
|
595
|
+
Labor.SGSTAmt = utils_1.TrUtils.FixedTo(Labor.CSGST);
|
|
596
|
+
Labor.IGSTAmt = utils_1.TrUtils.FixedTo(Labor.CIGST);
|
|
597
597
|
}
|
|
598
598
|
else {
|
|
599
|
-
Labor.UnPr =
|
|
599
|
+
Labor.UnPr = utils_1.TrUtils.FixedTo(Labor.Pr);
|
|
600
600
|
Labor.CGSTAmt = 0;
|
|
601
601
|
Labor.SGSTAmt = 0;
|
|
602
602
|
Labor.IGSTAmt = 0;
|
|
@@ -605,17 +605,17 @@ class ROPrintService {
|
|
|
605
605
|
else if (AsInsuranceOnly) {
|
|
606
606
|
if (IncludeGST) {
|
|
607
607
|
if (ConsolidateGST) {
|
|
608
|
-
Labor.UnPr =
|
|
608
|
+
Labor.UnPr = utils_1.TrUtils.FixedTo(Labor.InsAfterTax);
|
|
609
609
|
}
|
|
610
610
|
else {
|
|
611
|
-
Labor.UnPr =
|
|
611
|
+
Labor.UnPr = utils_1.TrUtils.FixedTo(Labor.AssPr);
|
|
612
612
|
}
|
|
613
|
-
Labor.CGSTAmt =
|
|
614
|
-
Labor.SGSTAmt =
|
|
615
|
-
Labor.IGSTAmt =
|
|
613
|
+
Labor.CGSTAmt = utils_1.TrUtils.FixedTo(Labor.ACGST);
|
|
614
|
+
Labor.SGSTAmt = utils_1.TrUtils.FixedTo(Labor.ASGST);
|
|
615
|
+
Labor.IGSTAmt = utils_1.TrUtils.FixedTo(Labor.AIGST);
|
|
616
616
|
}
|
|
617
617
|
else {
|
|
618
|
-
Labor.UnPr =
|
|
618
|
+
Labor.UnPr = utils_1.TrUtils.FixedTo(Labor.AssPr);
|
|
619
619
|
Labor.CGSTAmt = 0;
|
|
620
620
|
Labor.SGSTAmt = 0;
|
|
621
621
|
Labor.IGSTAmt = 0;
|
|
@@ -632,17 +632,17 @@ class ROPrintService {
|
|
|
632
632
|
if (AsCustomerOnly) {
|
|
633
633
|
if (IncludeGST) {
|
|
634
634
|
if (ConsolidateGST) {
|
|
635
|
-
Item.UnPr =
|
|
635
|
+
Item.UnPr = utils_1.TrUtils.FixedTo(Item.CustAfterTaxPerItem);
|
|
636
636
|
}
|
|
637
637
|
else {
|
|
638
|
-
Item.UnPr =
|
|
638
|
+
Item.UnPr = utils_1.TrUtils.FixedTo(Item.UnPr);
|
|
639
639
|
}
|
|
640
|
-
Item.CGSTAmt =
|
|
641
|
-
Item.SGSTAmt =
|
|
642
|
-
Item.IGSTAmt =
|
|
640
|
+
Item.CGSTAmt = utils_1.TrUtils.FixedTo(Item.CCGST);
|
|
641
|
+
Item.SGSTAmt = utils_1.TrUtils.FixedTo(Item.CSGST);
|
|
642
|
+
Item.IGSTAmt = utils_1.TrUtils.FixedTo(Item.CIGST);
|
|
643
643
|
}
|
|
644
644
|
else {
|
|
645
|
-
Item.UnPr =
|
|
645
|
+
Item.UnPr = utils_1.TrUtils.FixedTo(Item.UnPr);
|
|
646
646
|
Item.CGSTAmt = 0;
|
|
647
647
|
Item.SGSTAmt = 0;
|
|
648
648
|
Item.IGSTAmt = 0;
|
|
@@ -651,23 +651,23 @@ class ROPrintService {
|
|
|
651
651
|
else if (AsInsuranceOnly) {
|
|
652
652
|
if (IncludeGST) {
|
|
653
653
|
if (ConsolidateGST) {
|
|
654
|
-
Item.UnPr =
|
|
654
|
+
Item.UnPr = utils_1.TrUtils.FixedTo(Item.InsAfterTaxPerItem);
|
|
655
655
|
}
|
|
656
656
|
else {
|
|
657
|
-
Item.UnPr =
|
|
657
|
+
Item.UnPr = utils_1.TrUtils.FixedTo(Item.AssPr);
|
|
658
658
|
}
|
|
659
|
-
Item.CGSTAmt =
|
|
660
|
-
Item.SGSTAmt =
|
|
661
|
-
Item.IGSTAmt =
|
|
659
|
+
Item.CGSTAmt = utils_1.TrUtils.FixedTo(Item.ACGST);
|
|
660
|
+
Item.SGSTAmt = utils_1.TrUtils.FixedTo(Item.ASGST);
|
|
661
|
+
Item.IGSTAmt = utils_1.TrUtils.FixedTo(Item.AIGST);
|
|
662
662
|
}
|
|
663
663
|
else {
|
|
664
|
-
Item.UnPr =
|
|
664
|
+
Item.UnPr = utils_1.TrUtils.FixedTo(Item.AssPr);
|
|
665
665
|
Item.CGSTAmt = 0;
|
|
666
666
|
Item.SGSTAmt = 0;
|
|
667
667
|
Item.IGSTAmt = 0;
|
|
668
668
|
}
|
|
669
669
|
}
|
|
670
|
-
if (!
|
|
670
|
+
if (!utils_1.TrUtils.IsZero(Item.Qty) && !utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
671
671
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
672
672
|
}
|
|
673
673
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
@@ -678,7 +678,7 @@ class ROPrintService {
|
|
|
678
678
|
}
|
|
679
679
|
static CheckLaborTaxItemIndex(LaborList) {
|
|
680
680
|
let TaxIndex = LaborList.findIndex((Labor) => {
|
|
681
|
-
if (!
|
|
681
|
+
if (!utils_1.TrUtils.CheckInvalidSelect(Labor.TCode)) {
|
|
682
682
|
return Labor;
|
|
683
683
|
}
|
|
684
684
|
});
|
|
@@ -686,7 +686,7 @@ class ROPrintService {
|
|
|
686
686
|
}
|
|
687
687
|
static CheckPartTaxItemIndex(PartsList) {
|
|
688
688
|
let TaxIndex = PartsList.findIndex((Part) => {
|
|
689
|
-
if (!
|
|
689
|
+
if (!utils_1.TrUtils.CheckInvalidSelect(Part.TCode)) {
|
|
690
690
|
return Part;
|
|
691
691
|
}
|
|
692
692
|
});
|
|
@@ -707,7 +707,7 @@ class ROPrintService {
|
|
|
707
707
|
return Labor.Sts === enums_1.LaborStatusEnum.New || Labor.Sts === enums_1.LaborStatusEnum.WtngForAppr;
|
|
708
708
|
});
|
|
709
709
|
let NewPartFound = ROLaborParts.Parts.findIndex((Part) => {
|
|
710
|
-
return !
|
|
710
|
+
return !utils_1.TrUtils.IsNull(Part.CollId) && (Part.Sts === enums_1.LaborStatusEnum.New || Part.Sts === enums_1.LaborStatusEnum.WtngForAppr);
|
|
711
711
|
});
|
|
712
712
|
let NewIndPartFound = ROLaborParts.Colli.findIndex((IndPart) => {
|
|
713
713
|
return IndPart.Sts === enums_1.LaborStatusEnum.New || IndPart.Sts === enums_1.LaborStatusEnum.WtngForAppr;
|
|
@@ -725,7 +725,7 @@ class ROPrintService {
|
|
|
725
725
|
if (PrintPartNo) {
|
|
726
726
|
ROPrintData.PrintInfo.forEach((PrintData) => {
|
|
727
727
|
PrintData.Colli.forEach((Collision) => {
|
|
728
|
-
if (!
|
|
728
|
+
if (!utils_1.TrUtils.IsNull(Collision.PartData) && !utils_1.TrUtils.IsEmpty(Collision.PartData.MPN)) {
|
|
729
729
|
Collision.Desc = Collision.Desc + '/' + Collision.PartData.MPN;
|
|
730
730
|
}
|
|
731
731
|
});
|