shareneus 1.6.28 → 1.6.30
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/.vscode/settings.json +2 -0
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.d.ts +1 -1
- package/dist/accounting/invoice/unified-invoice-pdf.service.js +5 -5
- package/dist/services/est.print-service.d.ts +1 -0
- package/dist/services/est.print-service.js +40 -30
- package/dist/services/ro-print-service.d.ts +1 -0
- package/dist/services/ro-print-service.js +22 -12
- package/dist/services/ro-totals.service.d.ts +1 -0
- package/dist/services/ro-totals.service.js +30 -18
- package/dist/shared/shared-pdf.service.d.ts +84 -10
- package/dist/shared/shared-pdf.service.js +228 -63
- package/package.json +1 -1
|
@@ -97,7 +97,7 @@ function GetFileName(invoicePdfData) {
|
|
|
97
97
|
function CommonHeaderDetails(invoicePdfData, text, isotherIndustry, orientation = 'portrait') {
|
|
98
98
|
const headerDetails = [
|
|
99
99
|
GetMainHeaderDetails(invoicePdfData.Entity, invoicePdfData.HeaderName, invoicePdfData.Image, invoicePdfData.HColor, invoicePdfData.AColor, text, orientation),
|
|
100
|
-
shared_pdf_service_1.SharedPDFService.
|
|
100
|
+
shared_pdf_service_1.SharedPDFService.GetNewCustomerAndVehicleDetails(invoicePdfData._id, invoicePdfData.CrDate, invoicePdfData.PrDate, invoicePdfData.MOut, invoicePdfData.MIn, invoicePdfData.Product, invoicePdfData.PrintType, invoicePdfData.For, invoicePdfData.SurName, invoicePdfData.SurPhone, invoicePdfData.Type, invoicePdfData.SurEmail, invoicePdfData.InsComp, invoicePdfData.PolNo, invoicePdfData.PolType, invoicePdfData.Customer, invoicePdfData.IsProforma, invoicePdfData.Settings, invoicePdfData.Location, isotherIndustry, invoicePdfData.BL, invoicePdfData.ROCode, invoicePdfData.TypeName, invoicePdfData.AdmNo, invoicePdfData.DoS, invoicePdfData.Entity.PrCustBar, orientation),
|
|
101
101
|
shared_pdf_service_1.SharedPDFService.GetOwnerDetails(invoicePdfData.Cust, invoicePdfData.Type, invoicePdfData.For),
|
|
102
102
|
CustomerAndVehicleDetailsAfterLine(orientation),
|
|
103
103
|
shared_pdf_service_1.SharedPDFService.GetDisplayTable(),
|
|
@@ -106,7 +106,7 @@ function CommonHeaderDetails(invoicePdfData, text, isotherIndustry, orientation
|
|
|
106
106
|
}
|
|
107
107
|
function GetMainHeaderDetails(Entity, HeaderName, Image, HColor, AColor, text, orientation = 'portrait') {
|
|
108
108
|
return [
|
|
109
|
-
shared_pdf_service_1.SharedPDFService.
|
|
109
|
+
shared_pdf_service_1.SharedPDFService.GetNewMainHeader(Entity, Image, AColor, HColor, text, orientation),
|
|
110
110
|
shared_pdf_service_1.SharedPDFService.GetPrintType(HeaderName),
|
|
111
111
|
HeaderAfterLine(orientation)
|
|
112
112
|
];
|
|
@@ -643,13 +643,13 @@ function CommonTotalDetails(invoicePdfData, index, numberofCopies, withPass, mor
|
|
|
643
643
|
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(invoicePdfData.Type, invoicePdfData.Paid, invoicePdfData.Due, invoicePdfData.Sts, invoicePdfData.isCountersale, invoicePdfData.Entity.DecimalsNumber),
|
|
644
644
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(invoicePdfData.Entity.Terms),
|
|
645
645
|
GetBanckdetailswithQRCode(invoicePdfData),
|
|
646
|
-
shared_pdf_service_1.SharedPDFService.
|
|
646
|
+
shared_pdf_service_1.SharedPDFService.GetNewUnderLine(orientation),
|
|
647
647
|
shared_pdf_service_1.SharedPDFService.GetInvSignatures(invoicePdfData.Entity.CName, invoicePdfData.isCountersale),
|
|
648
|
-
shared_pdf_service_1.SharedPDFService.
|
|
648
|
+
shared_pdf_service_1.SharedPDFService.GetNewUnderLine1(withPass, orientation),
|
|
649
649
|
GetGatePass(withPass, invoicePdfData)
|
|
650
650
|
];
|
|
651
651
|
if (invoicePdfData.Type !== 'Invoice') {
|
|
652
|
-
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.
|
|
652
|
+
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.GetNewUnderLine(orientation));
|
|
653
653
|
}
|
|
654
654
|
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
655
655
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare class EstPrintService {
|
|
2
|
+
static GetTaxAmountFromGroup(item: any, taxGroupKey: string, taxCode: string, fallbackKey: string): any;
|
|
2
3
|
static GetEstimatePrintInfo(OriginalROData: any, OriginalCustomerData: any, OriginalVehicleData: any, OriginalEntityData: any, image: any, Payee: any, InsCompanyName: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, TaxCodes: any, OverallEst: boolean, SuppEstIndex: any, AsEstimated: boolean, isInitial: boolean, isReverse: boolean, Consolidate: boolean): any;
|
|
3
4
|
static GetROBasicDetailsForPrint(ROPrintData: any, argROData: any, Product: any, OverallEst: any, isInitial: boolean): any;
|
|
4
5
|
static GetPrintConditionsBasedOnInput(ROPrintData: any, IncludeGST: boolean, Payee: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, SType: any, Consolidate: boolean): any;
|
|
@@ -9,6 +9,16 @@ const my_date_1 = require("../utils/my-date");
|
|
|
9
9
|
const tr_utils_1 = require("../utils/tr-utils");
|
|
10
10
|
const ro_totals_service_1 = require("./ro-totals.service");
|
|
11
11
|
class EstPrintService {
|
|
12
|
+
static GetTaxAmountFromGroup(item, taxGroupKey, taxCode, fallbackKey) {
|
|
13
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
14
|
+
if (Array.isArray(groupedTaxes)) {
|
|
15
|
+
const matchedTaxes = groupedTaxes.filter((tax) => (tax === null || tax === void 0 ? void 0 : tax.Code) === taxCode);
|
|
16
|
+
if (matchedTaxes.length !== 0) {
|
|
17
|
+
return matchedTaxes.reduce((total, tax) => (0, math_operations_1.Add)(total, tax === null || tax === void 0 ? void 0 : tax.Amt), 0);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return tr_utils_1.TrUtils.SetValueToZeroIfNull(item === null || item === void 0 ? void 0 : item[fallbackKey]);
|
|
21
|
+
}
|
|
12
22
|
static GetEstimatePrintInfo(OriginalROData, OriginalCustomerData, OriginalVehicleData, OriginalEntityData, image, Payee, InsCompanyName, AsCustomerOnly, AsInsuranceOnly, AsCustomerAndInsurance, AsInsuranceOrCustomer, TaxCodes, OverallEst, SuppEstIndex, AsEstimated, isInitial, isReverse, Consolidate) {
|
|
13
23
|
let ROPrintData = {};
|
|
14
24
|
let argROData = tr_utils_1.TrUtils.Stringify(OriginalROData);
|
|
@@ -414,14 +424,14 @@ class EstPrintService {
|
|
|
414
424
|
ROPrintData.Ops.forEach((Labor) => {
|
|
415
425
|
// console.log('Labor', Labor);
|
|
416
426
|
Labor.NetAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.NetAmt, DecimalsNumber);
|
|
417
|
-
Labor.CCGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
418
|
-
Labor.CSGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
419
|
-
Labor.CIGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
427
|
+
Labor.CCGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
428
|
+
Labor.CSGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
429
|
+
Labor.CIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
420
430
|
Labor.Disc = tr_utils_1.TrUtils.FixPriceValue(Labor.Disc, DecimalsNumber);
|
|
421
431
|
Labor.AssPr = tr_utils_1.TrUtils.FixPriceValue(Labor.AssPr, DecimalsNumber);
|
|
422
|
-
Labor.ACGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
423
|
-
Labor.ASGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
424
|
-
Labor.AIGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
432
|
+
Labor.ACGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
433
|
+
Labor.ASGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
434
|
+
Labor.AIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
425
435
|
if (Consolidate) {
|
|
426
436
|
if (Labor.PBy === enums_1.PayTypeEnum.Customer) {
|
|
427
437
|
Labor.EstPr = tr_utils_1.TrUtils.FixPriceValue(Labor.CustAfterTax, DecimalsNumber);
|
|
@@ -436,9 +446,9 @@ class EstPrintService {
|
|
|
436
446
|
Labor.EstPr = tr_utils_1.TrUtils.FixPriceValue(Labor.EstPr, DecimalsNumber);
|
|
437
447
|
Labor.Pr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr, DecimalsNumber);
|
|
438
448
|
}
|
|
439
|
-
Labor.ECGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
440
|
-
Labor.ESGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
441
|
-
Labor.EIGST = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
449
|
+
Labor.ECGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
450
|
+
Labor.ESGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
451
|
+
Labor.EIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
442
452
|
if (tr_utils_1.TrUtils.IsNull(Labor.CollId)) {
|
|
443
453
|
let LaborColli = {
|
|
444
454
|
_id: Labor._id,
|
|
@@ -457,15 +467,15 @@ class EstPrintService {
|
|
|
457
467
|
// console.log('Part', Part);
|
|
458
468
|
Part.NetAmt = tr_utils_1.TrUtils.FixPriceValue(Part.NetAmt, DecimalsNumber);
|
|
459
469
|
Part.UnAmt = tr_utils_1.TrUtils.FixPriceValue(Part.UnAmt, DecimalsNumber);
|
|
460
|
-
Part.CCGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
461
|
-
Part.CSGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
462
|
-
Part.CIGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
470
|
+
Part.CCGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
471
|
+
Part.CSGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
472
|
+
Part.CIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
463
473
|
Part.Disc = tr_utils_1.TrUtils.FixPriceValue(Part.Disc, DecimalsNumber);
|
|
464
474
|
Part.AssPr = tr_utils_1.TrUtils.FixPriceValue(Part.AssPr, DecimalsNumber);
|
|
465
475
|
Part.AssAmt = tr_utils_1.TrUtils.FixPriceValue(Part.AssAmt, DecimalsNumber);
|
|
466
|
-
Part.ACGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
467
|
-
Part.ASGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
468
|
-
Part.AIGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
476
|
+
Part.ACGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
477
|
+
Part.ASGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
478
|
+
Part.AIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
469
479
|
Part.EstPr = tr_utils_1.TrUtils.FixPriceValue(Part.EstPr, DecimalsNumber);
|
|
470
480
|
if (Consolidate) {
|
|
471
481
|
if (Part.PBy === enums_1.PayTypeEnum.Customer) {
|
|
@@ -482,9 +492,9 @@ class EstPrintService {
|
|
|
482
492
|
Part.UnPr = tr_utils_1.TrUtils.FixPriceValue(Part.UnPr, DecimalsNumber);
|
|
483
493
|
}
|
|
484
494
|
Part.EstAmt = tr_utils_1.TrUtils.FixPriceValue(Part.EstAmt, DecimalsNumber);
|
|
485
|
-
Part.ECGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
486
|
-
Part.ESGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
487
|
-
Part.EIGST = tr_utils_1.TrUtils.FixPriceValue(Part
|
|
495
|
+
Part.ECGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
496
|
+
Part.ESGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
497
|
+
Part.EIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
488
498
|
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
489
499
|
let LaborIndex = ROPrintData.Ops.findIndex((Labor) => {
|
|
490
500
|
return Labor._id === Part.OpId;
|
|
@@ -828,9 +838,9 @@ class EstPrintService {
|
|
|
828
838
|
LaborList.forEach((Labor) => {
|
|
829
839
|
if (Labor.Sts === enums_1.LaborStatusEnum.New || Labor.Sts === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
830
840
|
if (IncludeGST) {
|
|
831
|
-
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
832
|
-
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
833
|
-
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
841
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
842
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
843
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
834
844
|
}
|
|
835
845
|
else {
|
|
836
846
|
Labor.CGSTAmt = 0;
|
|
@@ -840,9 +850,9 @@ class EstPrintService {
|
|
|
840
850
|
}
|
|
841
851
|
else {
|
|
842
852
|
if (IncludeGST) {
|
|
843
|
-
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
844
|
-
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
845
|
-
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor
|
|
853
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
854
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
855
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
846
856
|
}
|
|
847
857
|
else {
|
|
848
858
|
Labor.CGSTAmt = 0;
|
|
@@ -861,9 +871,9 @@ class EstPrintService {
|
|
|
861
871
|
let LaborStatus = tr_utils_1.TrUtils.IsNull(Item.CollId) ? this.GetPartParentStatus(Item.OpId, LaborList) : Item.Sts;
|
|
862
872
|
if (LaborStatus === enums_1.LaborStatusEnum.New || LaborStatus === enums_1.LaborStatusEnum.WtngForAppr) {
|
|
863
873
|
if (IncludeGST) {
|
|
864
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item
|
|
865
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item
|
|
866
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item
|
|
874
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
875
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
876
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
867
877
|
}
|
|
868
878
|
else {
|
|
869
879
|
Item.CGSTAmt = 0;
|
|
@@ -873,9 +883,9 @@ class EstPrintService {
|
|
|
873
883
|
}
|
|
874
884
|
else {
|
|
875
885
|
if (IncludeGST) {
|
|
876
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item
|
|
877
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item
|
|
878
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item
|
|
886
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
887
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
888
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
879
889
|
}
|
|
880
890
|
else {
|
|
881
891
|
Item.CGSTAmt = 0;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare class ROPrintService {
|
|
2
|
+
static GetTaxAmountFromGroup(item: any, taxGroupKey: string, taxCode: string, fallbackKey: string): any;
|
|
2
3
|
static GetRepairOrderPrintInfo(OriginalROData: any, OriginalCustomerData: any, OriginalVehicleData: any, OriginalEntityData: any, image: any, IncludeGST: boolean, ConsolidateGST: boolean, Payee: any, InsCompanyName: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, TaxCodes: any, OrderType: any, isReverse: boolean): any;
|
|
3
4
|
static GetEmployeeData(empData: any): any;
|
|
4
5
|
static GetROBasicDetailsForPrint(ROPrintData: any, argROData: any, Product: any, OrderType: any): any;
|
|
@@ -9,6 +9,16 @@ const my_date_1 = require("../utils/my-date");
|
|
|
9
9
|
const tr_utils_1 = require("../utils/tr-utils");
|
|
10
10
|
const ro_totals_service_1 = require("./ro-totals.service");
|
|
11
11
|
class ROPrintService {
|
|
12
|
+
static GetTaxAmountFromGroup(item, taxGroupKey, taxCode, fallbackKey) {
|
|
13
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
14
|
+
if (Array.isArray(groupedTaxes)) {
|
|
15
|
+
const matchedTaxes = groupedTaxes.filter((tax) => (tax === null || tax === void 0 ? void 0 : tax.Code) === taxCode);
|
|
16
|
+
if (matchedTaxes.length !== 0) {
|
|
17
|
+
return matchedTaxes.reduce((total, tax) => (0, math_operations_1.Add)(total, tax === null || tax === void 0 ? void 0 : tax.Amt), 0);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return tr_utils_1.TrUtils.SetValueToZeroIfNull(item === null || item === void 0 ? void 0 : item[fallbackKey]);
|
|
21
|
+
}
|
|
12
22
|
static GetRepairOrderPrintInfo(OriginalROData, OriginalCustomerData, OriginalVehicleData, OriginalEntityData, image, IncludeGST, ConsolidateGST, Payee, InsCompanyName, AsCustomerOnly, AsInsuranceOnly, TaxCodes, OrderType, isReverse) {
|
|
13
23
|
let ROPrintData = {};
|
|
14
24
|
let argROData = tr_utils_1.TrUtils.Stringify(OriginalROData);
|
|
@@ -591,9 +601,9 @@ class ROPrintService {
|
|
|
591
601
|
else {
|
|
592
602
|
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.Pr, DecimalsNumber);
|
|
593
603
|
}
|
|
594
|
-
Labor.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Labor
|
|
595
|
-
Labor.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Labor
|
|
596
|
-
Labor.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Labor
|
|
604
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
605
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
606
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
597
607
|
}
|
|
598
608
|
else {
|
|
599
609
|
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.Pr, DecimalsNumber);
|
|
@@ -610,9 +620,9 @@ class ROPrintService {
|
|
|
610
620
|
else {
|
|
611
621
|
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.AssPr, DecimalsNumber);
|
|
612
622
|
}
|
|
613
|
-
Labor.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Labor
|
|
614
|
-
Labor.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Labor
|
|
615
|
-
Labor.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Labor
|
|
623
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
624
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
625
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
616
626
|
Labor.AssPr = tr_utils_1.TrUtils.FixedTo(Labor.AssPr, DecimalsNumber);
|
|
617
627
|
}
|
|
618
628
|
else {
|
|
@@ -639,9 +649,9 @@ class ROPrintService {
|
|
|
639
649
|
else {
|
|
640
650
|
Item.UnPr = tr_utils_1.TrUtils.FixedTo(Item.UnPr, DecimalsNumber);
|
|
641
651
|
}
|
|
642
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Item
|
|
643
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Item
|
|
644
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Item
|
|
652
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
653
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
654
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
645
655
|
}
|
|
646
656
|
else {
|
|
647
657
|
Item.UnPr = tr_utils_1.TrUtils.FixedTo(Item.UnPr, DecimalsNumber);
|
|
@@ -658,9 +668,9 @@ class ROPrintService {
|
|
|
658
668
|
else {
|
|
659
669
|
Item.UnPr = tr_utils_1.TrUtils.FixedTo(Item.AssPr, DecimalsNumber);
|
|
660
670
|
}
|
|
661
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Item
|
|
662
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Item
|
|
663
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Item
|
|
671
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
672
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
673
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
664
674
|
Item.AssPr = tr_utils_1.TrUtils.FixedTo(Item.AssPr, DecimalsNumber);
|
|
665
675
|
}
|
|
666
676
|
else {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare class ROTotalsService {
|
|
2
|
+
static GetTaxAmountFromGroup(item: any, taxGroupKey: string, taxCode: string, fallbackKey: string): any;
|
|
2
3
|
static GetTotalsValue(OriRecordData: any, TaxCodes: any[], isWorkOrder: boolean, detailedInfo: boolean, withItems: boolean, isRoundable: boolean, EntitySettings: any): any;
|
|
3
4
|
static CalculateLaborValues(opCodesList: any, isWorkOrder: boolean, isTaxable: boolean): any;
|
|
4
5
|
static FilterValidLaborItems(opCodesList: any[]): any[];
|
|
@@ -5,6 +5,16 @@ const enums_1 = require("../enums/enums");
|
|
|
5
5
|
const math_operations_1 = require("../shared/math-operations");
|
|
6
6
|
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
7
|
class ROTotalsService {
|
|
8
|
+
static GetTaxAmountFromGroup(item, taxGroupKey, taxCode, fallbackKey) {
|
|
9
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
10
|
+
if (Array.isArray(groupedTaxes)) {
|
|
11
|
+
const matchedTaxes = groupedTaxes.filter((tax) => (tax === null || tax === void 0 ? void 0 : tax.Code) === taxCode);
|
|
12
|
+
if (matchedTaxes.length !== 0) {
|
|
13
|
+
return matchedTaxes.reduce((total, tax) => (0, math_operations_1.Add)(total, tax === null || tax === void 0 ? void 0 : tax.Amt), 0);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return tr_utils_1.TrUtils.SetValueToZeroIfNull(item === null || item === void 0 ? void 0 : item[fallbackKey]);
|
|
17
|
+
}
|
|
8
18
|
static GetTotalsValue(OriRecordData, TaxCodes, isWorkOrder, detailedInfo, withItems, isRoundable, EntitySettings) {
|
|
9
19
|
let dupRecordData = tr_utils_1.TrUtils.Stringify(OriRecordData);
|
|
10
20
|
let argRecordData = {};
|
|
@@ -38,19 +48,19 @@ class ROTotalsService {
|
|
|
38
48
|
Operation.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.Disc);
|
|
39
49
|
Operation.Pr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.Pr);
|
|
40
50
|
Operation.AssPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.AssPr);
|
|
41
|
-
Operation.ACGST =
|
|
42
|
-
Operation.ASGST =
|
|
43
|
-
Operation.AIGST =
|
|
44
|
-
Operation.CCGST =
|
|
45
|
-
Operation.CSGST =
|
|
46
|
-
Operation.CIGST =
|
|
51
|
+
Operation.ACGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'CGST', 'ACGST');
|
|
52
|
+
Operation.ASGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'SGST', 'ASGST');
|
|
53
|
+
Operation.AIGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'IGST', 'AIGST');
|
|
54
|
+
Operation.CCGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'CGST', 'CCGST');
|
|
55
|
+
Operation.CSGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'SGST', 'CSGST');
|
|
56
|
+
Operation.CIGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'IGST', 'CIGST');
|
|
47
57
|
Operation.NetAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.NetAmt);
|
|
48
58
|
Operation.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.RecDisc);
|
|
49
59
|
if (!isWorkOrder) {
|
|
50
60
|
Operation.EstPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.EstPr);
|
|
51
|
-
Operation.ECGST =
|
|
52
|
-
Operation.ESGST =
|
|
53
|
-
Operation.EIGST =
|
|
61
|
+
Operation.ECGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'CGST', 'ECGST');
|
|
62
|
+
Operation.ESGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'SGST', 'ESGST');
|
|
63
|
+
Operation.EIGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'IGST', 'EIGST');
|
|
54
64
|
}
|
|
55
65
|
return Operation;
|
|
56
66
|
}
|
|
@@ -179,21 +189,21 @@ class ROTotalsService {
|
|
|
179
189
|
Part.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.Disc);
|
|
180
190
|
Part.UnPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnPr);
|
|
181
191
|
Part.AssPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.AssPr);
|
|
182
|
-
Part.ACGST =
|
|
183
|
-
Part.ASGST =
|
|
184
|
-
Part.AIGST =
|
|
185
|
-
Part.CCGST =
|
|
186
|
-
Part.CSGST =
|
|
187
|
-
Part.CIGST =
|
|
192
|
+
Part.ACGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CGST', 'ACGST');
|
|
193
|
+
Part.ASGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'SGST', 'ASGST');
|
|
194
|
+
Part.AIGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'IGST', 'AIGST');
|
|
195
|
+
Part.CCGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CGST', 'CCGST');
|
|
196
|
+
Part.CSGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'SGST', 'CSGST');
|
|
197
|
+
Part.CIGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'IGST', 'CIGST');
|
|
188
198
|
Part.UnAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnAmt);
|
|
189
199
|
Part.AssAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.AssAmt);
|
|
190
200
|
Part.NetAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.NetAmt);
|
|
191
201
|
Part.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc);
|
|
192
202
|
if (!isWorkOrder) {
|
|
193
203
|
Part.EstPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.EstPr);
|
|
194
|
-
Part.ECGST =
|
|
195
|
-
Part.ESGST =
|
|
196
|
-
Part.EIGST =
|
|
204
|
+
Part.ECGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CGST', 'ECGST');
|
|
205
|
+
Part.ESGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'SGST', 'ESGST');
|
|
206
|
+
Part.EIGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'IGST', 'EIGST');
|
|
197
207
|
Part.EstAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.EstAmt);
|
|
198
208
|
}
|
|
199
209
|
return Part;
|
|
@@ -426,6 +436,7 @@ class ROTotalsService {
|
|
|
426
436
|
argRecordData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(argRecordData.CustPartsTotalAfterDisc, argRecordData.CustPartsDiscTotal);
|
|
427
437
|
argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
428
438
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, CustPartTaxTotal, dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
439
|
+
argRecordData.TaxTotal = (0, math_operations_1.Add)(CustLaborTaxTotal, CustPartTaxTotal);
|
|
429
440
|
if (detailedInfo) {
|
|
430
441
|
argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
431
442
|
argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
@@ -554,6 +565,7 @@ class ROTotalsService {
|
|
|
554
565
|
let InsLaborTaxTotal = this.GetInsLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
555
566
|
let InsPartTaxTotal = this.GetInsPartsTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
|
|
556
567
|
let InsTotal = this.GetInsuranceTotalBasedOnTaxType(InsuranceAfterDiscTotals, InsLaborTaxTotal, InsPartTaxTotal, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
568
|
+
argRecordData.InsTaxTotal = (0, math_operations_1.Add)(InsLaborTaxTotal, InsPartTaxTotal);
|
|
557
569
|
argRecordData.InsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal, DecimalsNumber);
|
|
558
570
|
if (detailedInfo) {
|
|
559
571
|
argRecordData.FixedInsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal, DecimalsNumber);
|
|
@@ -6,7 +6,7 @@ export declare class SharedPDFService {
|
|
|
6
6
|
static MainHeading(CName: any, Entity: any, Image: any, HColor: any, CopyName: any): any;
|
|
7
7
|
static HeaderAlignmentBasedOnCondition(CName: any, Image: any, HColor: any, headerstyle: any, MainHeaderStyle: any, Entity: any, CopyName: any): any;
|
|
8
8
|
static GetLeftMArgin(WorkShopName: any): "center" | "left";
|
|
9
|
-
static GetMainHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any
|
|
9
|
+
static GetMainHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any): {
|
|
10
10
|
columns: any;
|
|
11
11
|
};
|
|
12
12
|
static GetConsultationMainHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any): {
|
|
@@ -17,8 +17,8 @@ export declare class SharedPDFService {
|
|
|
17
17
|
static ConsultHeaderAlignmentBasedOnCondition(CName: any, Image: any, HColor: any, headerstyle: any, MainHeaderStyle: any, Entity: any, CopyName: any): any;
|
|
18
18
|
static GetConsultationLeftAlignmentHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any): any;
|
|
19
19
|
static GetWatermarkImage(Image: any, pageSize: any, Wmark: boolean): any;
|
|
20
|
-
static GetLeftAlignmentHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any
|
|
21
|
-
static GetAddresDetailsAndLogo(Entity: any, Image: any, AColor: any, HColor: any, text: any
|
|
20
|
+
static GetLeftAlignmentHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any): any;
|
|
21
|
+
static GetAddresDetailsAndLogo(Entity: any, Image: any, AColor: any, HColor: any, text: any): any;
|
|
22
22
|
static GetHeader(Entity: any, HColor: string): any;
|
|
23
23
|
static GetMainHeaderStyleForLeftAlignHeader(WorkShopName: string): any;
|
|
24
24
|
static GetEntityDetails(Entity: any): {
|
|
@@ -55,11 +55,11 @@ export declare class SharedPDFService {
|
|
|
55
55
|
} | {
|
|
56
56
|
text: any;
|
|
57
57
|
alignment: string;
|
|
58
|
-
width
|
|
58
|
+
width?: undefined;
|
|
59
59
|
})[];
|
|
60
60
|
style: string;
|
|
61
61
|
};
|
|
62
|
-
static
|
|
62
|
+
static GetNewUnderLine(orientation?: 'portrait' | 'landscape'): {
|
|
63
63
|
marginTop: number;
|
|
64
64
|
canvas: {
|
|
65
65
|
type: string;
|
|
@@ -71,7 +71,25 @@ export declare class SharedPDFService {
|
|
|
71
71
|
lineWidth: number;
|
|
72
72
|
}[];
|
|
73
73
|
};
|
|
74
|
-
static
|
|
74
|
+
static GetNewUnderLine1(withPass: boolean, orientation?: 'portrait' | 'landscape'): any;
|
|
75
|
+
static GetNewMainHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any, orientation?: 'portrait' | 'landscape'): {
|
|
76
|
+
columns: any;
|
|
77
|
+
};
|
|
78
|
+
static GetNewLeftAlignmentHeader(Entity: any, Image: any, AColor: any, HColor: any, text: any, orientation?: 'portrait' | 'landscape'): any;
|
|
79
|
+
static GetNewAddresDetailsAndLogo(Entity: any, Image: any, AColor: any, HColor: any, text: any, orientation?: 'portrait' | 'landscape'): any;
|
|
80
|
+
static GetUnderLine(): {
|
|
81
|
+
marginTop: number;
|
|
82
|
+
canvas: {
|
|
83
|
+
type: string;
|
|
84
|
+
color: string;
|
|
85
|
+
x1: number;
|
|
86
|
+
y1: number;
|
|
87
|
+
x2: number;
|
|
88
|
+
y2: number;
|
|
89
|
+
lineWidth: number;
|
|
90
|
+
}[];
|
|
91
|
+
};
|
|
92
|
+
static GetUnderLine1(withPass: boolean): any;
|
|
75
93
|
static GetLightUnderLine(width: number, color: string): {
|
|
76
94
|
canvas: {
|
|
77
95
|
type: string;
|
|
@@ -163,7 +181,7 @@ export declare class SharedPDFService {
|
|
|
163
181
|
layout: string;
|
|
164
182
|
};
|
|
165
183
|
static GetDataTable(data: any, istotal: boolean): any;
|
|
166
|
-
static GetCustomerAndVehicleDetails(Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Customer: any, IsProforma: boolean, Settings: any, Location: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any, PrCustBar?: boolean
|
|
184
|
+
static GetCustomerAndVehicleDetails(Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Customer: any, IsProforma: boolean, Settings: any, Location: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any, PrCustBar?: boolean): {
|
|
167
185
|
style: string;
|
|
168
186
|
marginLeft: number;
|
|
169
187
|
columns: ({
|
|
@@ -192,6 +210,62 @@ export declare class SharedPDFService {
|
|
|
192
210
|
width: number;
|
|
193
211
|
})[];
|
|
194
212
|
};
|
|
213
|
+
static GetNewCustomerAndVehicleDetails(Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Customer: any, IsProforma: boolean, Settings: any, Location: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any, PrCustBar?: boolean, orientation?: 'portrait' | 'landscape'): {
|
|
214
|
+
style: string;
|
|
215
|
+
marginLeft: number;
|
|
216
|
+
columns: ({
|
|
217
|
+
stack: any[];
|
|
218
|
+
width: number;
|
|
219
|
+
marginLeft: number;
|
|
220
|
+
} | {
|
|
221
|
+
stack: any[];
|
|
222
|
+
width: number;
|
|
223
|
+
marginRight: number;
|
|
224
|
+
text?: undefined;
|
|
225
|
+
} | {
|
|
226
|
+
text: string;
|
|
227
|
+
width: number;
|
|
228
|
+
stack?: undefined;
|
|
229
|
+
marginRight?: undefined;
|
|
230
|
+
} | {
|
|
231
|
+
stack: {
|
|
232
|
+
lineHeight: number;
|
|
233
|
+
fontSize: number;
|
|
234
|
+
table: {
|
|
235
|
+
body: any;
|
|
236
|
+
};
|
|
237
|
+
layout: string;
|
|
238
|
+
}[];
|
|
239
|
+
width: number;
|
|
240
|
+
})[];
|
|
241
|
+
};
|
|
242
|
+
static GetNewCustomer(Customer: any, Type: any, For: any, Vehicle: any, Settings: any, Headding: any, isOtherIndustry: boolean, orientation?: 'portrait' | 'landscape'): {
|
|
243
|
+
stack: any[];
|
|
244
|
+
width: number;
|
|
245
|
+
marginLeft: number;
|
|
246
|
+
};
|
|
247
|
+
static GetNewInsurence(For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Location: any, isOtherIndustry: boolean, Code?: any, PrCustBar?: boolean, orientation?: 'portrait' | 'landscape'): {
|
|
248
|
+
stack: any[];
|
|
249
|
+
width: number;
|
|
250
|
+
marginRight: number;
|
|
251
|
+
text?: undefined;
|
|
252
|
+
} | {
|
|
253
|
+
text: string;
|
|
254
|
+
width: number;
|
|
255
|
+
stack?: undefined;
|
|
256
|
+
marginRight?: undefined;
|
|
257
|
+
};
|
|
258
|
+
static GetNewVehicle(Type: any, Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, IsProforma: boolean, Settings: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any, orientation?: 'portrait' | 'landscape'): {
|
|
259
|
+
stack: {
|
|
260
|
+
lineHeight: number;
|
|
261
|
+
fontSize: number;
|
|
262
|
+
table: {
|
|
263
|
+
body: any;
|
|
264
|
+
};
|
|
265
|
+
layout: string;
|
|
266
|
+
}[];
|
|
267
|
+
width: number;
|
|
268
|
+
};
|
|
195
269
|
static GetReceiptCustomerAndVehicleDetails(Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Customer: any, IsProforma: boolean, Settings: any, Location: any, isOtherIndustry: boolean): {
|
|
196
270
|
style: string;
|
|
197
271
|
marginLeft: number;
|
|
@@ -257,12 +331,12 @@ export declare class SharedPDFService {
|
|
|
257
331
|
marginLeft: number;
|
|
258
332
|
};
|
|
259
333
|
static GetReceiptCustomerDetails(Customer: any, Type: any, Vehicle: any, Settings: any, CustHeader: string): any;
|
|
260
|
-
static GetCustomer(Customer: any, Type: any, For: any, Vehicle: any, Settings: any, Headding: any, isOtherIndustry: boolean
|
|
334
|
+
static GetCustomer(Customer: any, Type: any, For: any, Vehicle: any, Settings: any, Headding: any, isOtherIndustry: boolean): {
|
|
261
335
|
stack: any[];
|
|
262
336
|
width: number;
|
|
263
337
|
marginLeft: number;
|
|
264
338
|
};
|
|
265
|
-
static GetInsurence(For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Location: any, isOtherIndustry: boolean, Code?: any, PrCustBar?: boolean
|
|
339
|
+
static GetInsurence(For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Location: any, isOtherIndustry: boolean, Code?: any, PrCustBar?: boolean): {
|
|
266
340
|
stack: any[];
|
|
267
341
|
width: number;
|
|
268
342
|
marginRight: number;
|
|
@@ -279,7 +353,7 @@ export declare class SharedPDFService {
|
|
|
279
353
|
svg?: undefined;
|
|
280
354
|
};
|
|
281
355
|
static textToSvgBarcode(text: string): any;
|
|
282
|
-
static GetVehicle(Type: any, Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, IsProforma: boolean, Settings: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any
|
|
356
|
+
static GetVehicle(Type: any, Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, IsProforma: boolean, Settings: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any): {
|
|
283
357
|
stack: {
|
|
284
358
|
lineHeight: number;
|
|
285
359
|
fontSize: number;
|
|
@@ -48,15 +48,15 @@ class SharedPDFService {
|
|
|
48
48
|
return 'left';
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
static GetMainHeader(Entity, Image, AColor, HColor, text
|
|
51
|
+
static GetMainHeader(Entity, Image, AColor, HColor, text) {
|
|
52
52
|
if (Entity.Header === 1) {
|
|
53
53
|
return {
|
|
54
|
-
columns: this.GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text
|
|
54
|
+
columns: this.GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text)
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
else {
|
|
58
58
|
return {
|
|
59
|
-
columns: this.GetLeftAlignmentHeader(Entity, Image, AColor, HColor, text
|
|
59
|
+
columns: this.GetLeftAlignmentHeader(Entity, Image, AColor, HColor, text)
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -150,9 +150,7 @@ class SharedPDFService {
|
|
|
150
150
|
return this.emptyObject();
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
|
-
static GetLeftAlignmentHeader(Entity, Image, AColor, HColor, text
|
|
154
|
-
const headerWidth = orientation === 'landscape' ? 420 : 290;
|
|
155
|
-
const noImageWidth = orientation === 'landscape' ? 550 : 420;
|
|
153
|
+
static GetLeftAlignmentHeader(Entity, Image, AColor, HColor, text) {
|
|
156
154
|
let Details = [
|
|
157
155
|
{
|
|
158
156
|
stack: [{ columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
|
|
@@ -166,7 +164,7 @@ class SharedPDFService {
|
|
|
166
164
|
];
|
|
167
165
|
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
168
166
|
Details[0].stack[1].columns.unshift({
|
|
169
|
-
width:
|
|
167
|
+
width: 290,
|
|
170
168
|
margin: [10, 0, 0, 5],
|
|
171
169
|
stack: this.GetHeader(Entity, HColor),
|
|
172
170
|
color: AColor,
|
|
@@ -179,7 +177,7 @@ class SharedPDFService {
|
|
|
179
177
|
}
|
|
180
178
|
else {
|
|
181
179
|
Details[0].stack[1].columns.unshift({
|
|
182
|
-
width:
|
|
180
|
+
width: 420,
|
|
183
181
|
margin: [0, 0, 0, 5],
|
|
184
182
|
stack: this.GetHeader(Entity, HColor),
|
|
185
183
|
color: AColor,
|
|
@@ -191,39 +189,40 @@ class SharedPDFService {
|
|
|
191
189
|
}
|
|
192
190
|
return Details;
|
|
193
191
|
}
|
|
194
|
-
static GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text
|
|
195
|
-
|
|
196
|
-
const logoHeight = 80;
|
|
197
|
-
const headerStyle = this.GetMainHeaderStyleForLeftAlignHeader(Entity.CName || '');
|
|
198
|
-
const extras = [];
|
|
199
|
-
if (!tr_utils_1.TrUtils.IsNull(Entity.PageCount)) {
|
|
200
|
-
extras.push({ text: 'Page: ' + Entity.PageCount, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
|
|
201
|
-
}
|
|
202
|
-
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Extra1)) {
|
|
203
|
-
extras.push({ text: Entity.Extra1, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
|
|
204
|
-
}
|
|
205
|
-
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Extra2)) {
|
|
206
|
-
extras.push({ text: Entity.Extra2, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
|
|
207
|
-
}
|
|
208
|
-
const centerStack = [
|
|
209
|
-
{ text: '' + (Entity.CName || '') + '', color: HColor, fontSize: headerStyle.fontSize, bold: true, alignment: 'center' },
|
|
192
|
+
static GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text) {
|
|
193
|
+
let Details = [
|
|
210
194
|
{
|
|
211
|
-
stack:
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
195
|
+
stack: [
|
|
196
|
+
{ columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
|
|
197
|
+
{
|
|
198
|
+
columns: [{
|
|
199
|
+
width: 300,
|
|
200
|
+
margin: [0, 0, 0, 5],
|
|
201
|
+
stack: this.GetHeader(Entity, HColor),
|
|
202
|
+
color: AColor,
|
|
203
|
+
style: 'header'
|
|
204
|
+
},
|
|
205
|
+
this.emptyObject()]
|
|
206
|
+
}
|
|
207
|
+
]
|
|
216
208
|
}
|
|
217
209
|
];
|
|
218
|
-
if (!tr_utils_1.TrUtils.IsNull(
|
|
219
|
-
|
|
210
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
211
|
+
// Details.unshift({ text: '', width: 120 });
|
|
212
|
+
if (Entity.CName.length < 28) {
|
|
213
|
+
Details[0].stack[0].columns.push({ text: '', width: 150 });
|
|
214
|
+
}
|
|
215
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
216
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 7 });
|
|
217
|
+
}
|
|
218
|
+
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
Details[0].stack[1].columns.unshift({ text: '', width: 130 });
|
|
222
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
223
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 7 });
|
|
224
|
+
}
|
|
220
225
|
}
|
|
221
|
-
extras.forEach((row) => centerStack.push(row));
|
|
222
|
-
let Details = [
|
|
223
|
-
!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo ? { image: Image, width: logoWidth, height: logoHeight } : { text: '', width: logoWidth },
|
|
224
|
-
{ width: '*', stack: centerStack },
|
|
225
|
-
{ text: '', width: logoWidth }
|
|
226
|
-
];
|
|
227
226
|
return Details;
|
|
228
227
|
}
|
|
229
228
|
static GetHeader(Entity, HColor) {
|
|
@@ -395,15 +394,14 @@ class SharedPDFService {
|
|
|
395
394
|
}
|
|
396
395
|
static GetPrintType(type) {
|
|
397
396
|
return {
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
{ text: type, alignment: 'center',
|
|
401
|
-
{ text: '', width: 120 }
|
|
397
|
+
// marginLeft: 10,
|
|
398
|
+
columns: [{ text: '', width: 120 },
|
|
399
|
+
{ text: type, alignment: 'center' }, { text: '', width: 140 }
|
|
402
400
|
],
|
|
403
401
|
style: 'Receiptheader1'
|
|
404
402
|
};
|
|
405
403
|
}
|
|
406
|
-
static
|
|
404
|
+
static GetNewUnderLine(orientation = 'portrait') {
|
|
407
405
|
const lineWidth = orientation === 'landscape' ? 820 : 575;
|
|
408
406
|
return {
|
|
409
407
|
marginTop: 10,
|
|
@@ -420,7 +418,7 @@ class SharedPDFService {
|
|
|
420
418
|
]
|
|
421
419
|
};
|
|
422
420
|
}
|
|
423
|
-
static
|
|
421
|
+
static GetNewUnderLine1(withPass, orientation = 'portrait') {
|
|
424
422
|
if (withPass) {
|
|
425
423
|
const lineWidth = orientation === 'landscape' ? 820 : 575;
|
|
426
424
|
return {
|
|
@@ -443,6 +441,132 @@ class SharedPDFService {
|
|
|
443
441
|
return this.emptyObject();
|
|
444
442
|
}
|
|
445
443
|
}
|
|
444
|
+
static GetNewMainHeader(Entity, Image, AColor, HColor, text, orientation = 'portrait') {
|
|
445
|
+
if (Entity.Header === 1) {
|
|
446
|
+
return {
|
|
447
|
+
columns: this.GetNewAddresDetailsAndLogo(Entity, Image, AColor, HColor, text, orientation)
|
|
448
|
+
};
|
|
449
|
+
}
|
|
450
|
+
else {
|
|
451
|
+
return {
|
|
452
|
+
columns: this.GetNewLeftAlignmentHeader(Entity, Image, AColor, HColor, text, orientation)
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
static GetNewLeftAlignmentHeader(Entity, Image, AColor, HColor, text, orientation = 'portrait') {
|
|
457
|
+
const headerWidth = orientation === 'landscape' ? 420 : 290;
|
|
458
|
+
const noImageWidth = orientation === 'landscape' ? 550 : 420;
|
|
459
|
+
let Details = [
|
|
460
|
+
{
|
|
461
|
+
stack: [{ columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
|
|
462
|
+
{
|
|
463
|
+
columns: [
|
|
464
|
+
this.emptyObject()
|
|
465
|
+
]
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
];
|
|
470
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
471
|
+
Details[0].stack[1].columns.unshift({
|
|
472
|
+
width: headerWidth,
|
|
473
|
+
margin: [10, 0, 0, 5],
|
|
474
|
+
stack: this.GetHeader(Entity, HColor),
|
|
475
|
+
color: AColor,
|
|
476
|
+
style: 'temp2header'
|
|
477
|
+
});
|
|
478
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
479
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
480
|
+
}
|
|
481
|
+
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
Details[0].stack[1].columns.unshift({
|
|
485
|
+
width: noImageWidth,
|
|
486
|
+
margin: [0, 0, 0, 5],
|
|
487
|
+
stack: this.GetHeader(Entity, HColor),
|
|
488
|
+
color: AColor,
|
|
489
|
+
style: 'temp2header'
|
|
490
|
+
});
|
|
491
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
492
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
return Details;
|
|
496
|
+
}
|
|
497
|
+
static GetNewAddresDetailsAndLogo(Entity, Image, AColor, HColor, text, orientation = 'portrait') {
|
|
498
|
+
const logoWidth = 120;
|
|
499
|
+
const logoHeight = 80;
|
|
500
|
+
const headerStyle = this.GetMainHeaderStyleForLeftAlignHeader(Entity.CName || '');
|
|
501
|
+
const extras = [];
|
|
502
|
+
if (!tr_utils_1.TrUtils.IsNull(Entity.PageCount)) {
|
|
503
|
+
extras.push({ text: 'Page: ' + Entity.PageCount, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
|
|
504
|
+
}
|
|
505
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Extra1)) {
|
|
506
|
+
extras.push({ text: Entity.Extra1, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
|
|
507
|
+
}
|
|
508
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Extra2)) {
|
|
509
|
+
extras.push({ text: Entity.Extra2, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
|
|
510
|
+
}
|
|
511
|
+
const centerStack = [
|
|
512
|
+
{ text: '' + (Entity.CName || '') + '', color: HColor, fontSize: headerStyle.fontSize, bold: true, alignment: 'center' },
|
|
513
|
+
{
|
|
514
|
+
stack: this.GetHeader(Entity, HColor),
|
|
515
|
+
color: AColor,
|
|
516
|
+
style: 'header',
|
|
517
|
+
alignment: 'center',
|
|
518
|
+
margin: [0, 0, 0, 2]
|
|
519
|
+
}
|
|
520
|
+
];
|
|
521
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
522
|
+
centerStack.push({ text: text, color: 'grey', alignment: 'center', fontSize: 7, margin: [0, 0, 0, 1] });
|
|
523
|
+
}
|
|
524
|
+
extras.forEach((row) => centerStack.push(row));
|
|
525
|
+
let Details = [
|
|
526
|
+
!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo ? { image: Image, width: logoWidth, height: logoHeight } : { text: '', width: logoWidth },
|
|
527
|
+
{ width: '*', stack: centerStack },
|
|
528
|
+
{ text: '', width: logoWidth }
|
|
529
|
+
];
|
|
530
|
+
return Details;
|
|
531
|
+
}
|
|
532
|
+
static GetUnderLine() {
|
|
533
|
+
return {
|
|
534
|
+
marginTop: 10,
|
|
535
|
+
canvas: [
|
|
536
|
+
{
|
|
537
|
+
type: 'line',
|
|
538
|
+
color: 'grey',
|
|
539
|
+
x1: 0,
|
|
540
|
+
y1: 0,
|
|
541
|
+
x2: 575,
|
|
542
|
+
y2: 0,
|
|
543
|
+
lineWidth: 0.9
|
|
544
|
+
}
|
|
545
|
+
]
|
|
546
|
+
};
|
|
547
|
+
}
|
|
548
|
+
static GetUnderLine1(withPass) {
|
|
549
|
+
if (withPass) {
|
|
550
|
+
return {
|
|
551
|
+
marginTop: 10,
|
|
552
|
+
canvas: [
|
|
553
|
+
{
|
|
554
|
+
type: 'line',
|
|
555
|
+
color: 'grey',
|
|
556
|
+
x1: 0,
|
|
557
|
+
y1: 0,
|
|
558
|
+
x2: 575,
|
|
559
|
+
y2: 0,
|
|
560
|
+
dash: { length: 5, space: 10 },
|
|
561
|
+
lineWidth: 0.9
|
|
562
|
+
}
|
|
563
|
+
]
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
else {
|
|
567
|
+
return this.emptyObject();
|
|
568
|
+
}
|
|
569
|
+
}
|
|
446
570
|
static GetLightUnderLine(width, color) {
|
|
447
571
|
return {
|
|
448
572
|
canvas: [
|
|
@@ -744,17 +868,61 @@ class SharedPDFService {
|
|
|
744
868
|
});
|
|
745
869
|
return body;
|
|
746
870
|
}
|
|
747
|
-
static GetCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS, PrCustBar = false
|
|
871
|
+
static GetCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS, PrCustBar = false) {
|
|
872
|
+
return {
|
|
873
|
+
style: 'textcust',
|
|
874
|
+
marginLeft: 5,
|
|
875
|
+
columns: [
|
|
876
|
+
this.GetCustomer(Customer, Type, For, Vehicle, Settings, 'Bill To', isOtherIndustry),
|
|
877
|
+
this.GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Customer.Code, PrCustBar),
|
|
878
|
+
this.GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)
|
|
879
|
+
],
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
static GetNewCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS, PrCustBar = false, orientation = 'portrait') {
|
|
748
883
|
return {
|
|
749
884
|
style: 'textcust',
|
|
750
885
|
marginLeft: 5,
|
|
751
886
|
columns: [
|
|
752
|
-
this.
|
|
753
|
-
this.
|
|
754
|
-
this.
|
|
887
|
+
this.GetNewCustomer(Customer, Type, For, Vehicle, Settings, 'Bill To', isOtherIndustry, orientation),
|
|
888
|
+
this.GetNewInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Customer.Code, PrCustBar, orientation),
|
|
889
|
+
this.GetNewVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS, orientation)
|
|
755
890
|
],
|
|
756
891
|
};
|
|
757
892
|
}
|
|
893
|
+
static GetNewCustomer(Customer, Type, For, Vehicle, Settings, Headding, isOtherIndustry, orientation = 'portrait') {
|
|
894
|
+
const insuranceWidth = orientation === 'landscape' ? 220 : 170;
|
|
895
|
+
const normalWidth = orientation === 'landscape' ? 280 : 230;
|
|
896
|
+
if (For === enums_1.PayTypeEnum.Insurance || isOtherIndustry) {
|
|
897
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: insuranceWidth, marginLeft: 2 };
|
|
898
|
+
}
|
|
899
|
+
else {
|
|
900
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: normalWidth, marginLeft: 4 };
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
static GetNewInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Code = null, PrCustBar = false, orientation = 'portrait') {
|
|
904
|
+
const insuranceWidth = orientation === 'landscape' ? 260 : 210;
|
|
905
|
+
const emptyWidth = orientation === 'landscape' ? 100 : 70;
|
|
906
|
+
if (isOtherIndustry || ((For === enums_1.PayTypeEnum.Insurance) && Type !== 'Invoice')) {
|
|
907
|
+
return { stack: [this.GetInsurenceDetails(For, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType, Type, Location, isOtherIndustry)], width: insuranceWidth, marginRight: 2 };
|
|
908
|
+
}
|
|
909
|
+
else if (!tr_utils_1.TrUtils.IsNull(Code)) {
|
|
910
|
+
return { stack: [this.GetBarCode(Code, PrCustBar)], width: insuranceWidth, marginRight: 2 };
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
return { text: '', width: emptyWidth };
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
static GetNewVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS, orientation = 'portrait') {
|
|
917
|
+
const insuranceWidth = orientation === 'landscape' ? 250 : 200;
|
|
918
|
+
const normalWidth = orientation === 'landscape' ? 300 : 250;
|
|
919
|
+
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
920
|
+
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: insuranceWidth };
|
|
921
|
+
}
|
|
922
|
+
else {
|
|
923
|
+
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: normalWidth };
|
|
924
|
+
}
|
|
925
|
+
}
|
|
758
926
|
static GetReceiptCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry) {
|
|
759
927
|
return {
|
|
760
928
|
style: 'textcust',
|
|
@@ -825,27 +993,23 @@ class SharedPDFService {
|
|
|
825
993
|
{ text: 'Doctor : ' + Customer.Doctor, marginTop: 2 },]
|
|
826
994
|
};
|
|
827
995
|
}
|
|
828
|
-
static GetCustomer(Customer, Type, For, Vehicle, Settings, Headding, isOtherIndustry
|
|
829
|
-
const insuranceWidth = orientation === 'landscape' ? 220 : 170;
|
|
830
|
-
const normalWidth = orientation === 'landscape' ? 280 : 230;
|
|
996
|
+
static GetCustomer(Customer, Type, For, Vehicle, Settings, Headding, isOtherIndustry) {
|
|
831
997
|
if (For === enums_1.PayTypeEnum.Insurance || isOtherIndustry) {
|
|
832
|
-
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width:
|
|
998
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 170, marginLeft: 2 };
|
|
833
999
|
}
|
|
834
1000
|
else {
|
|
835
|
-
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width:
|
|
1001
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 230, marginLeft: 4 };
|
|
836
1002
|
}
|
|
837
1003
|
}
|
|
838
|
-
static GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Code = null, PrCustBar = false
|
|
839
|
-
const insuranceWidth = orientation === 'landscape' ? 260 : 210;
|
|
840
|
-
const emptyWidth = orientation === 'landscape' ? 100 : 70;
|
|
1004
|
+
static GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Code = null, PrCustBar = false) {
|
|
841
1005
|
if (isOtherIndustry || ((For === enums_1.PayTypeEnum.Insurance) && Type !== 'Invoice')) {
|
|
842
|
-
return { stack: [this.GetInsurenceDetails(For, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType, Type, Location, isOtherIndustry)], width:
|
|
1006
|
+
return { stack: [this.GetInsurenceDetails(For, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType, Type, Location, isOtherIndustry)], width: 210, marginRight: 2 };
|
|
843
1007
|
}
|
|
844
1008
|
else if (!tr_utils_1.TrUtils.IsNull(Code)) {
|
|
845
|
-
return { stack: [this.GetBarCode(Code, PrCustBar)], width:
|
|
1009
|
+
return { stack: [this.GetBarCode(Code, PrCustBar)], width: 210, marginRight: 2 };
|
|
846
1010
|
}
|
|
847
1011
|
else {
|
|
848
|
-
return { text: '', width:
|
|
1012
|
+
return { text: '', width: 70 };
|
|
849
1013
|
}
|
|
850
1014
|
}
|
|
851
1015
|
static GetBarCode(code, PrCustBar) {
|
|
@@ -864,14 +1028,12 @@ class SharedPDFService {
|
|
|
864
1028
|
});
|
|
865
1029
|
return { svg: svgElement.outerHTML };
|
|
866
1030
|
}
|
|
867
|
-
static GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS
|
|
868
|
-
const insuranceWidth = orientation === 'landscape' ? 250 : 200;
|
|
869
|
-
const normalWidth = orientation === 'landscape' ? 300 : 250;
|
|
1031
|
+
static GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS) {
|
|
870
1032
|
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
871
|
-
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width:
|
|
1033
|
+
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: 200 };
|
|
872
1034
|
}
|
|
873
1035
|
else {
|
|
874
|
-
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width:
|
|
1036
|
+
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: 250 };
|
|
875
1037
|
}
|
|
876
1038
|
}
|
|
877
1039
|
static GetReceiptVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry) {
|
|
@@ -1665,6 +1827,7 @@ class SharedPDFService {
|
|
|
1665
1827
|
};
|
|
1666
1828
|
}
|
|
1667
1829
|
static GetNotes(RecordData) {
|
|
1830
|
+
console.log('RecordData.Notes shared', RecordData.Notes);
|
|
1668
1831
|
if (!tr_utils_1.TrUtils.IsNull(RecordData.Notes)) {
|
|
1669
1832
|
return {
|
|
1670
1833
|
stack: [
|
|
@@ -2001,6 +2164,7 @@ class SharedPDFService {
|
|
|
2001
2164
|
// { name: 'Labor Total', value: LaborAfterGST },
|
|
2002
2165
|
// { name: 'Part Total', value: PartsAfterGST },
|
|
2003
2166
|
];
|
|
2167
|
+
console.log('shared Consolidate', Consolidate);
|
|
2004
2168
|
if (moreDiscDetails) {
|
|
2005
2169
|
if (!tr_utils_1.TrUtils.IsZero(RecordData.PDisc)) {
|
|
2006
2170
|
AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc, DecimalsNumber) });
|
|
@@ -2023,6 +2187,7 @@ class SharedPDFService {
|
|
|
2023
2187
|
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))), DecimalsNumber) });
|
|
2024
2188
|
}
|
|
2025
2189
|
else {
|
|
2190
|
+
console.log('Test', tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(totalTax))), DecimalsNumber));
|
|
2026
2191
|
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(totalTax))), DecimalsNumber) });
|
|
2027
2192
|
}
|
|
2028
2193
|
}
|