shareneus 1.6.32 → 1.6.34
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/services/ro-pdf.service.d.ts +3 -5
- package/dist/services/ro-pdf.service.js +70 -19
- package/dist/services/ro-print-service.d.ts +5 -2
- package/dist/services/ro-print-service.js +58 -10
- package/dist/shared/shared-pdf.service.d.ts +2 -1
- package/dist/shared/shared-pdf.service.js +2 -2
- package/package.json +1 -1
|
@@ -39,11 +39,6 @@ export declare class RoprintService {
|
|
|
39
39
|
}[];
|
|
40
40
|
width: number;
|
|
41
41
|
})[];
|
|
42
|
-
} | {
|
|
43
|
-
text: string;
|
|
44
|
-
fontSize: number;
|
|
45
|
-
bold: boolean;
|
|
46
|
-
margin: number[];
|
|
47
42
|
} | ({
|
|
48
43
|
columns: any;
|
|
49
44
|
} | {
|
|
@@ -1018,6 +1013,7 @@ export declare class RoprintService {
|
|
|
1018
1013
|
static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any): any;
|
|
1019
1014
|
static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any): {
|
|
1020
1015
|
style: string;
|
|
1016
|
+
marginTop: number;
|
|
1021
1017
|
table: {
|
|
1022
1018
|
widths: (string | number)[];
|
|
1023
1019
|
body: any;
|
|
@@ -1031,6 +1027,7 @@ export declare class RoprintService {
|
|
|
1031
1027
|
};
|
|
1032
1028
|
static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any): {
|
|
1033
1029
|
style: string;
|
|
1030
|
+
marginTop: number;
|
|
1034
1031
|
table: {
|
|
1035
1032
|
widths: number[];
|
|
1036
1033
|
body: any;
|
|
@@ -1044,6 +1041,7 @@ export declare class RoprintService {
|
|
|
1044
1041
|
};
|
|
1045
1042
|
static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any): {
|
|
1046
1043
|
style: string;
|
|
1044
|
+
marginTop: number;
|
|
1047
1045
|
table: {
|
|
1048
1046
|
widths: number[];
|
|
1049
1047
|
body: any;
|
|
@@ -15,7 +15,7 @@ class RoprintService {
|
|
|
15
15
|
// SharedPDFService.HeaderAfterLine()
|
|
16
16
|
shared_pdf_service_1.SharedPDFService.GetCustomerAndVehicleDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate, ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Vehicle, ROPrintData.Type, ROPrintData.Payee, ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.InsComp, ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, false, ROPrintData.Settings, ROPrintData.Location, isOtherIndustry, null, null, null, null, ROPrintData.DoS),
|
|
17
17
|
shared_pdf_service_1.SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
|
|
18
|
-
|
|
18
|
+
// SharedPDFService.GetDisplayTable()
|
|
19
19
|
];
|
|
20
20
|
}
|
|
21
21
|
static GetMainHeaderDetails(Entity, HeaderName, Image, HColor, AColor, text) {
|
|
@@ -29,13 +29,13 @@ class RoprintService {
|
|
|
29
29
|
static CommonTotalDetails(ROPrintData, index, numberofCopies) {
|
|
30
30
|
let CommonDetails = [
|
|
31
31
|
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.Payee, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowDetailedLaborTaxInfo, ROPrintData.ShowDetailedPartTaxInfo, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, null, null, false),
|
|
32
|
-
|
|
32
|
+
// SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
|
|
33
33
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
34
34
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
35
35
|
shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.Payee),
|
|
36
36
|
];
|
|
37
37
|
if (ROPrintData.Type !== 'Invoice') {
|
|
38
|
-
CommonDetails.splice(
|
|
38
|
+
CommonDetails.splice(1, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
39
39
|
}
|
|
40
40
|
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
41
41
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
@@ -45,13 +45,13 @@ class RoprintService {
|
|
|
45
45
|
static CommonInsTotalDetails(ROPrintData, index, numberofCopies) {
|
|
46
46
|
let CommonDetails = [
|
|
47
47
|
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.InsLaborTotalBeforeDisc, ROPrintData.InsLaborDiscTotal, ROPrintData.InsLaborCGST, ROPrintData.InsLaborSGST, ROPrintData.InsLaborIGST, ROPrintData.InsPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.InsPartsTotalBeforeDisc, ROPrintData.InsPartsDiscTotal, ROPrintData.InsPartCGST, ROPrintData.InsPartSGST, ROPrintData.InsTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.InsLaborTotalAfterTax, ROPrintData.InsPartsTotalAfterTax, ROPrintData.FixedDisc, ROPrintData.Payee, ROPrintData.FixedInsTotal, ROPrintData.InsTotalRoundedBy, ROPrintData.InsRoundedTotal, ROPrintData.ShowDetailedLaborTaxInfo, ROPrintData.ShowDetailedPartTaxInfo, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.InsLaborITax, ROPrintData.InsPartITax, ROPrintData.Consolidate, ROPrintData.From, null, null, false),
|
|
48
|
-
|
|
48
|
+
// SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
|
|
49
49
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
50
50
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
51
51
|
shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.Payee),
|
|
52
52
|
];
|
|
53
53
|
if (ROPrintData.Type !== 'Invoice') {
|
|
54
|
-
CommonDetails.splice(
|
|
54
|
+
CommonDetails.splice(1, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
55
55
|
}
|
|
56
56
|
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
57
57
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
@@ -60,6 +60,7 @@ class RoprintService {
|
|
|
60
60
|
}
|
|
61
61
|
// Customer Only Print Method
|
|
62
62
|
static GetCustomerPrint(ROPrintData, numberofCopies, isOtherIndustry) {
|
|
63
|
+
console.log(ROPrintData, numberofCopies, isOtherIndustry);
|
|
63
64
|
var contents = [];
|
|
64
65
|
if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
|
|
65
66
|
contents.push(this.CommonHeaderDetails(ROPrintData, null, isOtherIndustry), this.CustomersparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies));
|
|
@@ -145,11 +146,22 @@ class RoprintService {
|
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
148
|
else {
|
|
149
|
+
console.log('new', ROPrintData.PrintInfo);
|
|
148
150
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
const printInfo = ROPrintData.PrintInfo[i];
|
|
152
|
+
const hasText = !tr_utils_1.TrUtils.IsEmpty(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
|
|
153
|
+
const hasPartsOrOps = (!tr_utils_1.TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
|
|
154
|
+
|| (!tr_utils_1.TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
|
|
155
|
+
const hasColli = !tr_utils_1.TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
|
|
156
|
+
if (hasText) {
|
|
157
|
+
List.push(printInfo.Text);
|
|
158
|
+
}
|
|
159
|
+
if (hasPartsOrOps) {
|
|
160
|
+
List.push(this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(printInfo.Parts), tr_utils_1.TrUtils.Stringify(printInfo.Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
161
|
+
}
|
|
162
|
+
if (hasColli) {
|
|
163
|
+
List.push(this.GetCustomerIndPartsTable(printInfo.Colli, printInfo.Type, printInfo.Sts, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
151
164
|
}
|
|
152
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn), this.GetCustomerIndPartsTable(ROPrintData.PrintInfo[i].Colli, ROPrintData.PrintInfo[i].Type, ROPrintData.PrintInfo[i].Sts, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
153
165
|
}
|
|
154
166
|
}
|
|
155
167
|
}
|
|
@@ -232,10 +244,20 @@ class RoprintService {
|
|
|
232
244
|
}
|
|
233
245
|
else {
|
|
234
246
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
235
|
-
|
|
236
|
-
|
|
247
|
+
const printInfo = ROPrintData.PrintInfo[i];
|
|
248
|
+
const hasText = !tr_utils_1.TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
|
|
249
|
+
const hasPartsOrOps = (!tr_utils_1.TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
|
|
250
|
+
|| (!tr_utils_1.TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
|
|
251
|
+
const hasColli = !tr_utils_1.TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
|
|
252
|
+
if (hasText) {
|
|
253
|
+
List.push(printInfo.Text);
|
|
254
|
+
}
|
|
255
|
+
if (hasPartsOrOps) {
|
|
256
|
+
List.push(this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(printInfo.Parts), tr_utils_1.TrUtils.Stringify(printInfo.Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
257
|
+
}
|
|
258
|
+
if (hasColli) {
|
|
259
|
+
List.push(this.GetInsuranceIndPartsTable(printInfo, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
237
260
|
}
|
|
238
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn), this.GetInsuranceIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
239
261
|
}
|
|
240
262
|
}
|
|
241
263
|
}
|
|
@@ -318,10 +340,20 @@ class RoprintService {
|
|
|
318
340
|
}
|
|
319
341
|
else {
|
|
320
342
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
321
|
-
|
|
322
|
-
|
|
343
|
+
const printInfo = ROPrintData.PrintInfo[i];
|
|
344
|
+
const hasText = !tr_utils_1.TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
|
|
345
|
+
const hasPartsOrOps = (!tr_utils_1.TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
|
|
346
|
+
|| (!tr_utils_1.TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
|
|
347
|
+
const hasColli = !tr_utils_1.TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
|
|
348
|
+
if (hasText) {
|
|
349
|
+
List.push(printInfo.Text);
|
|
350
|
+
}
|
|
351
|
+
if (hasPartsOrOps) {
|
|
352
|
+
List.push(this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(printInfo.Parts), tr_utils_1.TrUtils.Stringify(printInfo.Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
353
|
+
}
|
|
354
|
+
if (hasColli) {
|
|
355
|
+
List.push(this.GetInsuranceAndCustomerIndPartsTable(printInfo, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
323
356
|
}
|
|
324
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Parts), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn), this.GetInsuranceAndCustomerIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
325
357
|
}
|
|
326
358
|
}
|
|
327
359
|
}
|
|
@@ -399,10 +431,20 @@ class RoprintService {
|
|
|
399
431
|
}
|
|
400
432
|
else {
|
|
401
433
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
402
|
-
|
|
403
|
-
|
|
434
|
+
const printInfo = ROPrintData.PrintInfo[i];
|
|
435
|
+
const hasText = !tr_utils_1.TrUtils.IsNull(printInfo.Text) && ('' + printInfo.Text).trim() !== '';
|
|
436
|
+
const hasPartsOrOps = (!tr_utils_1.TrUtils.IsNull(printInfo.Parts) && printInfo.Parts.length > 0)
|
|
437
|
+
|| (!tr_utils_1.TrUtils.IsNull(printInfo.Ops) && printInfo.Ops.length > 0);
|
|
438
|
+
const hasColli = !tr_utils_1.TrUtils.IsNull(printInfo.Colli) && printInfo.Colli.length > 0;
|
|
439
|
+
if (hasText) {
|
|
440
|
+
List.push(printInfo.Text);
|
|
441
|
+
}
|
|
442
|
+
if (hasPartsOrOps) {
|
|
443
|
+
List.push(this.GetWithOutDiscAndTaxFieldHeader(printInfo.Parts, printInfo.Ops, ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGS, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
444
|
+
}
|
|
445
|
+
if (hasColli) {
|
|
446
|
+
List.push(this.GetInsuranceOrCustomerIndPartsTable(printInfo, ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
404
447
|
}
|
|
405
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(ROPrintData.PrintInfo[i].Parts, ROPrintData.PrintInfo[i].Ops, ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGS, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn), this.GetInsuranceOrCustomerIndPartsTable(ROPrintData.PrintInfo[i], ROPrintData.Entity.MPN, ROPrintData.ShowTaxColumn));
|
|
406
448
|
}
|
|
407
449
|
}
|
|
408
450
|
}
|
|
@@ -1355,7 +1397,7 @@ class RoprintService {
|
|
|
1355
1397
|
}
|
|
1356
1398
|
else {
|
|
1357
1399
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
1358
|
-
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
1400
|
+
&& !tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
1359
1401
|
part[column.Field] = '';
|
|
1360
1402
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
1361
1403
|
}
|
|
@@ -1443,7 +1485,7 @@ class RoprintService {
|
|
|
1443
1485
|
}
|
|
1444
1486
|
else {
|
|
1445
1487
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
1446
|
-
&& tr_utils_1.TrUtils.CheckInvalidSelect(Ops.TCode))) {
|
|
1488
|
+
&& !tr_utils_1.TrUtils.CheckInvalidSelect(Ops.TCode))) {
|
|
1447
1489
|
Ops[column.Field] = '';
|
|
1448
1490
|
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
|
|
1449
1491
|
}
|
|
@@ -1498,6 +1540,7 @@ class RoprintService {
|
|
|
1498
1540
|
}
|
|
1499
1541
|
static GetWithOutDiscAndTaxFieldHeader(Parts, Ops, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
1500
1542
|
if (Parts.length !== 0 || Ops.length !== 0) {
|
|
1543
|
+
console.log('ShowTaxColumn', ShowTaxColumn);
|
|
1501
1544
|
if (ShowTaxColumn) {
|
|
1502
1545
|
return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
|
|
1503
1546
|
}
|
|
@@ -1520,6 +1563,7 @@ class RoprintService {
|
|
|
1520
1563
|
if (ShowIGST) {
|
|
1521
1564
|
return {
|
|
1522
1565
|
style: 'tableExample',
|
|
1566
|
+
marginTop: 7,
|
|
1523
1567
|
table: {
|
|
1524
1568
|
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
1525
1569
|
// headerRows: 2,
|
|
@@ -1531,6 +1575,7 @@ class RoprintService {
|
|
|
1531
1575
|
else {
|
|
1532
1576
|
return {
|
|
1533
1577
|
style: 'tableExample',
|
|
1578
|
+
marginTop: 7,
|
|
1534
1579
|
table: {
|
|
1535
1580
|
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
1536
1581
|
// headerRows: 2,
|
|
@@ -1544,6 +1589,7 @@ class RoprintService {
|
|
|
1544
1589
|
if (ShowIGST) {
|
|
1545
1590
|
return {
|
|
1546
1591
|
style: 'tableExample',
|
|
1592
|
+
marginTop: 7,
|
|
1547
1593
|
table: {
|
|
1548
1594
|
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
1549
1595
|
// headerRows: 2,
|
|
@@ -1555,6 +1601,7 @@ class RoprintService {
|
|
|
1555
1601
|
else {
|
|
1556
1602
|
return {
|
|
1557
1603
|
style: 'tableExample',
|
|
1604
|
+
marginTop: 7,
|
|
1558
1605
|
table: {
|
|
1559
1606
|
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
1560
1607
|
// headerRows: 2,
|
|
@@ -1569,6 +1616,7 @@ class RoprintService {
|
|
|
1569
1616
|
if (PrintPartNo) {
|
|
1570
1617
|
return {
|
|
1571
1618
|
style: 'tableExample',
|
|
1619
|
+
marginTop: 7,
|
|
1572
1620
|
table: {
|
|
1573
1621
|
widths: [25, 65, 273, 25, 60, 75, 10, 40],
|
|
1574
1622
|
// headerRows: 1,
|
|
@@ -1580,6 +1628,7 @@ class RoprintService {
|
|
|
1580
1628
|
else {
|
|
1581
1629
|
return {
|
|
1582
1630
|
style: 'tableExample',
|
|
1631
|
+
marginTop: 7,
|
|
1583
1632
|
table: {
|
|
1584
1633
|
widths: [25, 290, 50, 80, 80, 10, 40],
|
|
1585
1634
|
// headerRows: 1,
|
|
@@ -1593,6 +1642,7 @@ class RoprintService {
|
|
|
1593
1642
|
if (PrintPartNo) {
|
|
1594
1643
|
return {
|
|
1595
1644
|
style: 'tableExample',
|
|
1645
|
+
marginTop: 7,
|
|
1596
1646
|
table: {
|
|
1597
1647
|
widths: shared_print_service_1.PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
|
|
1598
1648
|
// headerRows: 1,
|
|
@@ -1604,6 +1654,7 @@ class RoprintService {
|
|
|
1604
1654
|
else {
|
|
1605
1655
|
return {
|
|
1606
1656
|
style: 'tableExample',
|
|
1657
|
+
marginTop: 7,
|
|
1607
1658
|
table: {
|
|
1608
1659
|
widths: shared_print_service_1.PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
|
|
1609
1660
|
// headerRows: 1,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare class ROPrintService {
|
|
2
2
|
static GetTaxAmountFromGroup(item: any, taxGroupKey: string, taxCode: string, fallbackKey: string): any;
|
|
3
|
+
static GetTCode(item: any): any;
|
|
4
|
+
static GetTaxRateFromGroup(item: any, taxGroupKey: string, taxCode: string): number;
|
|
5
|
+
static GetTaxRate(item: any, taxCode: string, preferredTaxGroupKey?: string): number;
|
|
3
6
|
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;
|
|
4
7
|
static GetEmployeeData(empData: any): any;
|
|
5
8
|
static GetROBasicDetailsForPrint(ROPrintData: any, argROData: any, Product: any, OrderType: any): any;
|
|
@@ -36,8 +39,8 @@ export declare class ROPrintService {
|
|
|
36
39
|
static GetPartLineTotal(PartData: any, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, DecimalsNumber: number): string;
|
|
37
40
|
static ReverseItemsForROPrint(argROData: any, isReverse: boolean): any;
|
|
38
41
|
static GetDetailedInfoForItems(ROTotalsData: any, IncludeGST: boolean, ConsolidateGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, TaxCodes: any[], DecimalsNumber: number): any;
|
|
39
|
-
static GetLaborPrintInfo(LaborList: any, ConsolidateGST: boolean, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean,
|
|
40
|
-
static GetItemsPrintInfo(Items: any, ConsolidateGST: boolean, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean,
|
|
42
|
+
static GetLaborPrintInfo(LaborList: any, ConsolidateGST: boolean, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, _TaxCodes: any[], DecimalsNumber: number): any;
|
|
43
|
+
static GetItemsPrintInfo(Items: any, ConsolidateGST: boolean, IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, _TaxCodes: any[], DecimalsNumber: number): any;
|
|
41
44
|
static CheckLaborTaxItemIndex(LaborList: any[]): any;
|
|
42
45
|
static CheckPartTaxItemIndex(PartsList: any[]): any;
|
|
43
46
|
static PrepareFormatForROPrint(ROPrintData: any, For: string, argROType: any): any[];
|
|
@@ -19,6 +19,48 @@ class ROPrintService {
|
|
|
19
19
|
}
|
|
20
20
|
return tr_utils_1.TrUtils.SetValueToZeroIfNull(item === null || item === void 0 ? void 0 : item[fallbackKey]);
|
|
21
21
|
}
|
|
22
|
+
static GetTCode(item) {
|
|
23
|
+
const taxGroupKeys = ['CTaxes', 'ATaxes', 'ETaxes'];
|
|
24
|
+
for (const taxGroupKey of taxGroupKeys) {
|
|
25
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
26
|
+
if (!Array.isArray(groupedTaxes)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const matchedTax = groupedTaxes.find((tax) => !tr_utils_1.TrUtils.IsNull(tax === null || tax === void 0 ? void 0 : tax.TaxCodeId));
|
|
30
|
+
if (!tr_utils_1.TrUtils.IsNull(matchedTax === null || matchedTax === void 0 ? void 0 : matchedTax.TaxCodeId)) {
|
|
31
|
+
return matchedTax.TaxCodeId;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return item === null || item === void 0 ? void 0 : item.TCode;
|
|
35
|
+
}
|
|
36
|
+
static GetTaxRateFromGroup(item, taxGroupKey, taxCode) {
|
|
37
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
38
|
+
if (Array.isArray(groupedTaxes)) {
|
|
39
|
+
const matchedTaxes = groupedTaxes.filter((tax) => (tax === null || tax === void 0 ? void 0 : tax.Code) === taxCode);
|
|
40
|
+
if (matchedTaxes.length !== 0) {
|
|
41
|
+
return tr_utils_1.TrUtils.FixedTo(matchedTaxes.reduce((total, tax) => (0, math_operations_1.Add)(total, tax === null || tax === void 0 ? void 0 : tax.Rate), 0));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
static GetTaxRate(item, taxCode, preferredTaxGroupKey) {
|
|
47
|
+
const taxGroupKeys = [];
|
|
48
|
+
if (typeof preferredTaxGroupKey === 'string' && preferredTaxGroupKey.length !== 0) {
|
|
49
|
+
taxGroupKeys.push(preferredTaxGroupKey);
|
|
50
|
+
}
|
|
51
|
+
['CTaxes', 'ATaxes', 'ETaxes'].forEach((groupKey) => {
|
|
52
|
+
if (taxGroupKeys.indexOf(groupKey) === -1) {
|
|
53
|
+
taxGroupKeys.push(groupKey);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
for (const taxGroupKey of taxGroupKeys) {
|
|
57
|
+
const rate = this.GetTaxRateFromGroup(item, taxGroupKey, taxCode);
|
|
58
|
+
if (!tr_utils_1.TrUtils.IsZero(rate)) {
|
|
59
|
+
return rate;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
22
64
|
static GetRepairOrderPrintInfo(OriginalROData, OriginalCustomerData, OriginalVehicleData, OriginalEntityData, image, IncludeGST, ConsolidateGST, Payee, InsCompanyName, AsCustomerOnly, AsInsuranceOnly, TaxCodes, OrderType, isReverse) {
|
|
23
65
|
let ROPrintData = {};
|
|
24
66
|
let argROData = tr_utils_1.TrUtils.Stringify(OriginalROData);
|
|
@@ -590,9 +632,10 @@ class ROPrintService {
|
|
|
590
632
|
}
|
|
591
633
|
return ROTotalsData;
|
|
592
634
|
}
|
|
593
|
-
static GetLaborPrintInfo(LaborList, ConsolidateGST, IncludeGST, AsCustomerOnly, AsInsuranceOnly,
|
|
635
|
+
static GetLaborPrintInfo(LaborList, ConsolidateGST, IncludeGST, AsCustomerOnly, AsInsuranceOnly, _TaxCodes, DecimalsNumber) {
|
|
594
636
|
LaborList.forEach((Labor) => {
|
|
595
637
|
Labor.HSN = Labor.SAC;
|
|
638
|
+
let taxGroupKey = 'CTaxes';
|
|
596
639
|
if (AsCustomerOnly) {
|
|
597
640
|
if (IncludeGST) {
|
|
598
641
|
if (ConsolidateGST) {
|
|
@@ -613,6 +656,7 @@ class ROPrintService {
|
|
|
613
656
|
}
|
|
614
657
|
}
|
|
615
658
|
else if (AsInsuranceOnly) {
|
|
659
|
+
taxGroupKey = 'ATaxes';
|
|
616
660
|
if (IncludeGST) {
|
|
617
661
|
if (ConsolidateGST) {
|
|
618
662
|
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.InsAfterTax, DecimalsNumber);
|
|
@@ -633,14 +677,16 @@ class ROPrintService {
|
|
|
633
677
|
Labor.IGSTAmt = 0;
|
|
634
678
|
}
|
|
635
679
|
}
|
|
636
|
-
Labor.
|
|
637
|
-
Labor.
|
|
638
|
-
Labor.
|
|
680
|
+
Labor.TCode = this.GetTCode(Labor);
|
|
681
|
+
Labor.CGSTPerc = this.GetTaxRate(Labor, 'CGST', taxGroupKey);
|
|
682
|
+
Labor.SGSTPerc = this.GetTaxRate(Labor, 'SGST', taxGroupKey);
|
|
683
|
+
Labor.IGSTPerc = this.GetTaxRate(Labor, 'IGST', taxGroupKey);
|
|
639
684
|
});
|
|
640
685
|
return LaborList;
|
|
641
686
|
}
|
|
642
|
-
static GetItemsPrintInfo(Items, ConsolidateGST, IncludeGST, AsCustomerOnly, AsInsuranceOnly,
|
|
687
|
+
static GetItemsPrintInfo(Items, ConsolidateGST, IncludeGST, AsCustomerOnly, AsInsuranceOnly, _TaxCodes, DecimalsNumber) {
|
|
643
688
|
Items.forEach((Item) => {
|
|
689
|
+
let taxGroupKey = 'CTaxes';
|
|
644
690
|
if (AsCustomerOnly) {
|
|
645
691
|
if (IncludeGST) {
|
|
646
692
|
if (ConsolidateGST) {
|
|
@@ -661,6 +707,7 @@ class ROPrintService {
|
|
|
661
707
|
}
|
|
662
708
|
}
|
|
663
709
|
else if (AsInsuranceOnly) {
|
|
710
|
+
taxGroupKey = 'ATaxes';
|
|
664
711
|
if (IncludeGST) {
|
|
665
712
|
if (ConsolidateGST) {
|
|
666
713
|
Item.UnPr = tr_utils_1.TrUtils.FixedTo(Item.InsAfterTaxPerItem, DecimalsNumber);
|
|
@@ -684,15 +731,16 @@ class ROPrintService {
|
|
|
684
731
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
685
732
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
686
733
|
}
|
|
687
|
-
Item.
|
|
688
|
-
Item.
|
|
689
|
-
Item.
|
|
734
|
+
Item.TCode = this.GetTCode(Item);
|
|
735
|
+
Item.CGSTPerc = this.GetTaxRate(Item, 'CGST', taxGroupKey);
|
|
736
|
+
Item.SGSTPerc = this.GetTaxRate(Item, 'SGST', taxGroupKey);
|
|
737
|
+
Item.IGSTPerc = this.GetTaxRate(Item, 'IGST', taxGroupKey);
|
|
690
738
|
});
|
|
691
739
|
return Items;
|
|
692
740
|
}
|
|
693
741
|
static CheckLaborTaxItemIndex(LaborList) {
|
|
694
742
|
let TaxIndex = LaborList.findIndex((Labor) => {
|
|
695
|
-
if (!
|
|
743
|
+
if (!this.GetTCode(Labor)) {
|
|
696
744
|
return Labor;
|
|
697
745
|
}
|
|
698
746
|
});
|
|
@@ -700,7 +748,7 @@ class ROPrintService {
|
|
|
700
748
|
}
|
|
701
749
|
static CheckPartTaxItemIndex(PartsList) {
|
|
702
750
|
let TaxIndex = PartsList.findIndex((Part) => {
|
|
703
|
-
if (!
|
|
751
|
+
if (!this.GetTCode(Part)) {
|
|
704
752
|
return Part;
|
|
705
753
|
}
|
|
706
754
|
});
|
|
@@ -769,6 +769,7 @@ export declare class SharedPDFService {
|
|
|
769
769
|
};
|
|
770
770
|
static GetSignatures(CName: any, For: any, Type: any): {
|
|
771
771
|
columns: {
|
|
772
|
+
marginTop: number;
|
|
772
773
|
stack: ({
|
|
773
774
|
text: {
|
|
774
775
|
text: ({
|
|
@@ -791,7 +792,6 @@ export declare class SharedPDFService {
|
|
|
791
792
|
}[];
|
|
792
793
|
};
|
|
793
794
|
static GetInvSignatures(CName: any, isCounterSale: boolean): {
|
|
794
|
-
marginTop: number;
|
|
795
795
|
columns: {
|
|
796
796
|
stack: ({
|
|
797
797
|
text: {
|
|
@@ -816,6 +816,7 @@ export declare class SharedPDFService {
|
|
|
816
816
|
};
|
|
817
817
|
static GetHCInvSignatures(CName: any, isCounterSale: boolean): {
|
|
818
818
|
columns: {
|
|
819
|
+
marginTop: number;
|
|
819
820
|
stack: ({
|
|
820
821
|
text: {
|
|
821
822
|
text: ({
|
|
@@ -2181,7 +2181,6 @@ class SharedPDFService {
|
|
|
2181
2181
|
// { name: 'Labor Total', value: LaborAfterGST },
|
|
2182
2182
|
// { name: 'Part Total', value: PartsAfterGST },
|
|
2183
2183
|
];
|
|
2184
|
-
console.log('shared Consolidate', Consolidate);
|
|
2185
2184
|
if (moreDiscDetails) {
|
|
2186
2185
|
if (!tr_utils_1.TrUtils.IsZero(RecordData.PDisc)) {
|
|
2187
2186
|
AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc, DecimalsNumber) });
|
|
@@ -2463,6 +2462,7 @@ class SharedPDFService {
|
|
|
2463
2462
|
static GetSignatures(CName, For, Type) {
|
|
2464
2463
|
return {
|
|
2465
2464
|
columns: [{
|
|
2465
|
+
marginTop: 3,
|
|
2466
2466
|
stack: [
|
|
2467
2467
|
{ text: this.CompanyName(CName), alignment: 'right' },
|
|
2468
2468
|
{ columns: [this.CustomerSignature(), this.SurveyorSignature(For, Type), this.Authorizedsignature()] }
|
|
@@ -2472,7 +2472,6 @@ class SharedPDFService {
|
|
|
2472
2472
|
}
|
|
2473
2473
|
static GetInvSignatures(CName, isCounterSale) {
|
|
2474
2474
|
return {
|
|
2475
|
-
marginTop: 3,
|
|
2476
2475
|
columns: [{
|
|
2477
2476
|
stack: [
|
|
2478
2477
|
{ text: this.CompanyName(CName), alignment: 'right' },
|
|
@@ -2484,6 +2483,7 @@ class SharedPDFService {
|
|
|
2484
2483
|
static GetHCInvSignatures(CName, isCounterSale) {
|
|
2485
2484
|
return {
|
|
2486
2485
|
columns: [{
|
|
2486
|
+
marginTop: 5,
|
|
2487
2487
|
stack: [
|
|
2488
2488
|
{ text: this.CompanyName(CName), alignment: 'right' },
|
|
2489
2489
|
{ columns: [this.PatientSignature(), this.SparesSignature(isCounterSale), this.Authorizedsignature()] }
|