shareneus 1.7.4 → 1.7.6
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/README.md +1 -0
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
- package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
- package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
- package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
- package/dist/gst/excel/GSTR1-excel.service.js +17 -7
- package/dist/gst/excel/GSTR2-excel.service.js +17 -7
- package/dist/gst/excel/hsn-summary.js +17 -7
- package/dist/gst/excel/tally-sales-import.service.js +17 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
- package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
- package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
- package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
- package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
- package/dist/shared/table-section/pdf-table.header.js +14 -2
- package/dist/shared/table-section/pdf-table.section.js +6 -13
- package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +15 -15
- package/package.json +1 -1
- package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
- package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
- package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
- package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
- package/src/accounting/credit-note/cn-print.service.ts +264 -0
- package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
- package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
- package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
- package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
- package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
- package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
- package/src/accounting/invoice/inv-pdf.service.ts +812 -0
- package/src/accounting/invoice/inv-print.service.ts +532 -0
- package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
- package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
- package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
- package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
- package/src/accounting/invoice/invoice-print.service.ts +2906 -0
- package/src/accounting/invoice/invoice-total.service.ts +834 -0
- package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
- package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
- package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
- package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
- package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
- package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
- package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
- package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
- package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
- package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
- package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
- package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
- package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
- package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
- package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
- package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
- package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
- package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
- package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
- package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
- package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
- package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
- package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
- package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
- package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
- package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
- package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
- package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
- package/src/aggregation/aggregation.ts +58 -0
- package/src/appointments/appointments/appointment-total.service.ts +298 -0
- package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
- package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
- package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
- package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
- package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
- package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
- package/src/enums/cache-enums.ts +33 -0
- package/src/enums/code-enums.ts +291 -0
- package/src/enums/country-enums.ts +9 -0
- package/src/enums/enums.ts +364 -0
- package/src/enums/industry-enums.ts +26 -0
- package/src/enums/treatment-enums.ts +9 -0
- package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
- package/src/gst/excel/GSTR1-excel.service.ts +313 -0
- package/src/gst/excel/GSTR2-excel.service.ts +314 -0
- package/src/gst/excel/hsn-summary.ts +314 -0
- package/src/gst/excel/tally-sales-import.service.ts +767 -0
- package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
- package/src/index.ts +194 -0
- package/src/inventory/items/adjustment-pdf.service.ts +177 -0
- package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
- package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
- package/src/inventory/items/item-detais-pdf.ts +141 -0
- package/src/inventory/items/item-price-for-pricelist.ts +368 -0
- package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
- package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
- package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
- package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
- package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
- package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
- package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
- package/src/inventory/material-out/mout-pdf.service.ts +545 -0
- package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
- package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
- package/src/purchases/bills/bill-pdf.service.ts +21 -0
- package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
- package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
- package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
- package/src/purchases/purchase-order/po-totals.service.ts +343 -0
- package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
- package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
- package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
- package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
- package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
- package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
- package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
- package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
- package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
- package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
- package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
- package/src/sales/sales/pack-ship-print.service.ts +198 -0
- package/src/sales/sales/sales-pdf.service.ts +658 -0
- package/src/sales/sales/sales-print.service.ts +376 -0
- package/src/sales/sales/sales-totals.service.ts +500 -0
- package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
- package/src/sales-receive/sales-receive-print.service.ts +242 -0
- package/src/sales-receive/sales-receive-totals.service.ts +651 -0
- package/src/services/checklist-pdf.ts +151 -0
- package/src/services/checklists-pdf.ts +133 -0
- package/src/services/est.print-service.ts +1155 -0
- package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
- package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
- package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
- package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
- package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
- package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
- package/src/services/ro-pdf.service.ts +1917 -0
- package/src/services/ro-print-service.ts +881 -0
- package/src/services/ro-totals.service.ts +1314 -0
- package/src/services/separate-wo-print.service.ts +396 -0
- package/src/services/service-history-pdf.service.ts +145 -0
- package/src/services/service-price-for-pricelist.ts +649 -0
- package/src/services/technician-pdf.service.ts +234 -0
- package/src/services/technician-print.service.ts +95 -0
- package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
- package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
- package/src/shared/math-operations.ts +208 -0
- package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
- package/src/shared/shared-pdf.service.ts +3042 -0
- package/src/shared/shared-print.service.ts +879 -0
- package/src/shared/table-section/pdf-table.config.ts +8 -0
- package/src/shared/table-section/pdf-table.header.ts +396 -0
- package/src/shared/table-section/pdf-table.row.ts +248 -0
- package/src/shared/table-section/pdf-table.section.ts +447 -0
- package/src/shared/totals-section/pdf-totals.section.ts +921 -0
- package/src/shared/transactions-pdf.service.ts +191 -0
- package/src/shared/util.ts +101 -0
- package/src/tasks/meetings/meeting-pdf.ts +410 -0
- package/src/tasks/tasks/task-pdf.service.ts +238 -0
- package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
- package/src/tax/index.ts +86 -0
- package/src/tax/tax-calculator.ts +1025 -0
- package/src/tax/tax.types.ts +535 -0
- package/src/transaction-calculations/discounts-distribution.ts +343 -0
- package/src/transaction-calculations/index.ts +3 -0
- package/src/transaction-calculations/total-calculation.ts +443 -0
- package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
- package/src/utils/my-date.ts +111 -0
- package/src/utils/tr-utils.ts +104 -0
- package/tsconfig.json +2 -2
- /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
import { SharedPDFService } from "../../shared/shared-pdf.service";
|
|
2
|
+
import { PrintSharedService } from "../../shared/shared-print.service";
|
|
3
|
+
import { TrUtils } from "../../utils/tr-utils";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
export class MaterialOutprintService {
|
|
7
|
+
static SmallFont: number = 6;
|
|
8
|
+
static MediumFont: number = 8;
|
|
9
|
+
static LargeFont: number = 9;
|
|
10
|
+
dd: any;
|
|
11
|
+
static MaterialOutPDF(MOutPrintData: any) {
|
|
12
|
+
let dd = {
|
|
13
|
+
info: {
|
|
14
|
+
title: this.GetFileName(MOutPrintData),
|
|
15
|
+
},
|
|
16
|
+
background: function (currentPage: any, pageSize: any) {
|
|
17
|
+
return SharedPDFService.GetWatermarkImage(MOutPrintData.Image, pageSize, MOutPrintData.Entity.Wmark);
|
|
18
|
+
},
|
|
19
|
+
header: function (currentPage: any, pageCount: any) {
|
|
20
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
21
|
+
},
|
|
22
|
+
pageMargins: [10, 15, 10, 15],
|
|
23
|
+
content: [
|
|
24
|
+
// SharedPDFService.MainHeading(MOutPrintData.Entity.CName, MOutPrintData.Entity.Header, MOutPrintData.Image, MOutPrintData.HColor, null),
|
|
25
|
+
SharedPDFService.GetMainHeader(MOutPrintData.Entity, MOutPrintData.Image, MOutPrintData.AColor, MOutPrintData.HColor, null),
|
|
26
|
+
SharedPDFService.GetPrintType(MOutPrintData.HeaderName),
|
|
27
|
+
SharedPDFService.HeaderAfterLine(),
|
|
28
|
+
this.GetVendorDetails(MOutPrintData),
|
|
29
|
+
this.VendorDetailsAfterLine(),
|
|
30
|
+
this.GetDisplayTable(),
|
|
31
|
+
this.getPartsData(MOutPrintData),
|
|
32
|
+
// SharedPDFService.GetUnderLine(),
|
|
33
|
+
// SharedPDFService.GetTemsAndConditions(MOutPrintData.Entity.Terms),
|
|
34
|
+
SharedPDFService.GetUnderLine(),
|
|
35
|
+
this.GetSignatures(MOutPrintData.Entity.CName),
|
|
36
|
+
],
|
|
37
|
+
styles: this.GetStyles()
|
|
38
|
+
};
|
|
39
|
+
return dd;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static GetFileName(MOutPrintData: any) {
|
|
44
|
+
let fileName: string = MOutPrintData.HeaderName;
|
|
45
|
+
return fileName;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static GetDisplayTable() {
|
|
49
|
+
return { text: '', fontSize: 10, bold: true, margin: [0, 0, 0, 5] };
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static GetStyles() {
|
|
53
|
+
return {
|
|
54
|
+
temp2header: {
|
|
55
|
+
fontSize: 23,
|
|
56
|
+
bold: true,
|
|
57
|
+
alignment: 'left',
|
|
58
|
+
// margin: [0, 10, 0, 0],
|
|
59
|
+
},
|
|
60
|
+
header: {
|
|
61
|
+
fontSize: 26,
|
|
62
|
+
bold: true,
|
|
63
|
+
alignment: 'center',
|
|
64
|
+
// margin: [0, 10, 0, 0],
|
|
65
|
+
},
|
|
66
|
+
Cust_Adrs: {
|
|
67
|
+
fontSize: this.MediumFont,
|
|
68
|
+
lineHeight: 1.2,
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
WSHeader_Left: {
|
|
72
|
+
fontSize: 23,
|
|
73
|
+
bold: true,
|
|
74
|
+
alignment: 'left',
|
|
75
|
+
// margin: [0, 10, 0, 0],
|
|
76
|
+
},
|
|
77
|
+
WSHeader_Center: {
|
|
78
|
+
fontSize: 26,
|
|
79
|
+
bold: true,
|
|
80
|
+
alignment: 'center',
|
|
81
|
+
// margin: [0, 10, 0, 0],
|
|
82
|
+
},
|
|
83
|
+
ws_adrs_center: {
|
|
84
|
+
fontSize: this.MediumFont,
|
|
85
|
+
alignment: 'center',
|
|
86
|
+
},
|
|
87
|
+
ws_adrs_left: {
|
|
88
|
+
fontSize: this.MediumFont,
|
|
89
|
+
alignment: 'left',
|
|
90
|
+
},
|
|
91
|
+
table_data: {
|
|
92
|
+
margin: [0, 0.5, 0, 5],
|
|
93
|
+
fontSize: this.MediumFont
|
|
94
|
+
},
|
|
95
|
+
table_header: {
|
|
96
|
+
bold: true,
|
|
97
|
+
fontSize: this.LargeFont,
|
|
98
|
+
margin: [0, 1, 0, 5],
|
|
99
|
+
alignment: 'center'
|
|
100
|
+
},
|
|
101
|
+
vendor_font: {
|
|
102
|
+
fontSize: this.MediumFont,
|
|
103
|
+
margin: [0, 5, 0, 5],
|
|
104
|
+
},
|
|
105
|
+
PO_Status: {
|
|
106
|
+
fontSize: this.MediumFont,
|
|
107
|
+
lineHeight: 1.4,
|
|
108
|
+
margin: [10, 0, 0, 0],
|
|
109
|
+
},
|
|
110
|
+
po_status_font: {
|
|
111
|
+
fontSize: this.LargeFont,
|
|
112
|
+
// bold: true
|
|
113
|
+
},
|
|
114
|
+
totals_Styles: {
|
|
115
|
+
marginTop: 15,
|
|
116
|
+
lineHeight: 1.4,
|
|
117
|
+
fontSize: this.MediumFont,
|
|
118
|
+
margin: [15, 0, 0, 0],
|
|
119
|
+
},
|
|
120
|
+
total_margin: {
|
|
121
|
+
margin: [0, 5, 0, 0],
|
|
122
|
+
},
|
|
123
|
+
hed: {
|
|
124
|
+
fontSize: this.LargeFont,
|
|
125
|
+
bold: true
|
|
126
|
+
},
|
|
127
|
+
Receiptheader1: {
|
|
128
|
+
fontSize: 12,
|
|
129
|
+
bold: true,
|
|
130
|
+
alignment: 'center',
|
|
131
|
+
margin: [0, 0, 0, 3]
|
|
132
|
+
},
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
static MainHeading(CName: any, Header: any, Image: any, HColor: any, AColor: any) {
|
|
137
|
+
let headerstyle: string;
|
|
138
|
+
let MainHeaderStyle: any = this.GetMainHeaderStyleForLeftAlignHeader(CName);
|
|
139
|
+
if (Header === 1) {
|
|
140
|
+
headerstyle = 'WSHeader_Center';
|
|
141
|
+
} else {
|
|
142
|
+
headerstyle = 'WSHeader_Left';
|
|
143
|
+
}
|
|
144
|
+
return [{ text: '' + CName + '', style: [headerstyle, MainHeaderStyle] }];
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static GetMainHeaderStyleForLeftAlignHeader(WorkShopName: string) {
|
|
148
|
+
var wsname_fontSize: any;
|
|
149
|
+
|
|
150
|
+
if (TrUtils.IsNull(WorkShopName)) {
|
|
151
|
+
WorkShopName = '';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
switch (true) {
|
|
155
|
+
case (WorkShopName.length < 30):
|
|
156
|
+
wsname_fontSize = 23;
|
|
157
|
+
break;
|
|
158
|
+
case (WorkShopName.length < 35):
|
|
159
|
+
wsname_fontSize = 20;
|
|
160
|
+
break;
|
|
161
|
+
case (WorkShopName.length < 50):
|
|
162
|
+
wsname_fontSize = 17;
|
|
163
|
+
break;
|
|
164
|
+
default:
|
|
165
|
+
wsname_fontSize = 14;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
var WSHeaderFontSize: any = {
|
|
169
|
+
fontSize: wsname_fontSize,
|
|
170
|
+
bold: true,
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
return WSHeaderFontSize;
|
|
174
|
+
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
static GetHeader(Entity: any) {
|
|
178
|
+
let headerstyle: string;
|
|
179
|
+
if (Entity.Header === 1) {
|
|
180
|
+
headerstyle = 'ws_adrs_center';
|
|
181
|
+
} else {
|
|
182
|
+
headerstyle = 'ws_adrs_left';
|
|
183
|
+
}
|
|
184
|
+
let SubHeader: any = [
|
|
185
|
+
{ text: '' + Entity.Adrs1 + '', style: [headerstyle] },
|
|
186
|
+
{ text: '' + Entity.City + this.GetPinCode(Entity.PIN) + ', ' + 'Ph: ' + Entity.Phone, style: headerstyle },
|
|
187
|
+
{ text: '' + this.GetEmailName(Entity.Email) + '', style: headerstyle }
|
|
188
|
+
];
|
|
189
|
+
if (!TrUtils.IsEmpty(Entity.Adrs2)) {
|
|
190
|
+
SubHeader.splice(1, 0, { text: '' + Entity.Adrs2 + '', style: [headerstyle] });
|
|
191
|
+
}
|
|
192
|
+
if (!TrUtils.IsEmpty(Entity.TLine)) {
|
|
193
|
+
SubHeader.unshift({ text: this.GetTagLine(Entity.TLine), fontSize: 10, bold: true, margin: [0, 0, 0, 2] });
|
|
194
|
+
}
|
|
195
|
+
return SubHeader;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
static GetEntityDetails(Entity: any) {
|
|
199
|
+
return {
|
|
200
|
+
lineHeight: 0.7,
|
|
201
|
+
columns: [this.GetEntityTaxDetails(Entity)
|
|
202
|
+
]
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
static GetTagLine(TLine: any) {
|
|
208
|
+
if (TrUtils.IsEmpty(TLine)) {
|
|
209
|
+
TLine = '';
|
|
210
|
+
}
|
|
211
|
+
return TLine;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
static GetEmailName(email: any) {
|
|
215
|
+
let Email: any = '';
|
|
216
|
+
if (!TrUtils.IsNull(email)) {
|
|
217
|
+
Email = 'Email: ' + email;
|
|
218
|
+
}
|
|
219
|
+
return Email;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
static GetPinCode(pin: any) {
|
|
223
|
+
let code: any = '';
|
|
224
|
+
if (!TrUtils.IsNull(pin)) {
|
|
225
|
+
code = ' - ' + pin;
|
|
226
|
+
}
|
|
227
|
+
return code;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
static GetEntityTaxDetails(Entity: any) {
|
|
231
|
+
let EntityData: any = [];
|
|
232
|
+
if (!TrUtils.IsEmpty(Entity.GSTIN)) {
|
|
233
|
+
EntityData.push({ name: 'GSTIN', value: Entity.GSTIN })
|
|
234
|
+
}
|
|
235
|
+
if (!TrUtils.IsEmpty(Entity.PAN)) {
|
|
236
|
+
EntityData.push({ name: 'PAN No', value: Entity.PAN })
|
|
237
|
+
}
|
|
238
|
+
if (EntityData.length !== 0) {
|
|
239
|
+
return this.GetEntityeDataTable(EntityData);
|
|
240
|
+
} else {
|
|
241
|
+
return SharedPDFService.emptyObject();
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
static GetEntityeDataTable(EntityFields: any) {
|
|
246
|
+
return {
|
|
247
|
+
lineHeight: 0.7,
|
|
248
|
+
marginLeft: 25,
|
|
249
|
+
fontSize: this.SmallFont,
|
|
250
|
+
table: {
|
|
251
|
+
body: [
|
|
252
|
+
[{
|
|
253
|
+
table: {
|
|
254
|
+
fontSize: this.SmallFont,
|
|
255
|
+
widths: [37, 'auto', '*'],
|
|
256
|
+
|
|
257
|
+
body: this.DataCreateForTable(EntityFields)
|
|
258
|
+
},
|
|
259
|
+
layout: 'noBorders',
|
|
260
|
+
}]
|
|
261
|
+
]
|
|
262
|
+
},
|
|
263
|
+
layout: 'noBorders',
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
static DataCreateForTable(EntityFields: any) {
|
|
268
|
+
var body: any = [];
|
|
269
|
+
EntityFields.forEach((row: any) => {
|
|
270
|
+
if (!TrUtils.IsFixedZero(row.value) && !TrUtils.IsEmpty(row.value)) {
|
|
271
|
+
var dataRow: any = [];
|
|
272
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true });
|
|
273
|
+
dataRow.push(':');
|
|
274
|
+
dataRow.push({ text: (row.value).toString(), noWrap: true });
|
|
275
|
+
body.push(dataRow);
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
return body;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
static GetVendorDetails(PurchaseOrder: any) {
|
|
282
|
+
return {
|
|
283
|
+
style: 'vendor_font',
|
|
284
|
+
columns: [
|
|
285
|
+
{ stack: [this.GetVendorData(PurchaseOrder.ShipTo, PurchaseOrder.Type)], width: 120 }, { text: '', width: 250 },
|
|
286
|
+
this.GetVehicle(PurchaseOrder)
|
|
287
|
+
],
|
|
288
|
+
// columnGap: 150
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
static GetVehicle(PurchaseOrder: any) {
|
|
293
|
+
if(TrUtils.IsNull(PurchaseOrder.BL.VNo)){
|
|
294
|
+
PurchaseOrder.BL.VNo='';
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
style: 'PO_Status',
|
|
298
|
+
lineHeight: 0.7,
|
|
299
|
+
columns: [
|
|
300
|
+
{
|
|
301
|
+
table: {
|
|
302
|
+
fontSize: 6,
|
|
303
|
+
widths: [37, 'auto', '*'],
|
|
304
|
+
body: [[{ text: 'ID', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder._id],
|
|
305
|
+
[{ text: 'Date', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder.CrDate],
|
|
306
|
+
[{ text: 'Reason', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder.ResName],
|
|
307
|
+
[{ text: 'Vehicle', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder?.BL?.VNo],
|
|
308
|
+
|
|
309
|
+
// [{ text: 'Status', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder.Status]
|
|
310
|
+
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
layout: 'noBorders',
|
|
314
|
+
},
|
|
315
|
+
|
|
316
|
+
]
|
|
317
|
+
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
static GetVendorData(Vendor: any, Type: any) {
|
|
322
|
+
if (TrUtils.IsNull(Vendor)) {
|
|
323
|
+
return SharedPDFService.emptyObject();
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
style: 'Cust_Adrs',
|
|
327
|
+
stack: [{ text: 'User Name :', style: 'hed' },
|
|
328
|
+
{ text: Vendor.Name, marginTop: 2 },
|
|
329
|
+
// { text: this.GetAddress(Vendor), marginTop: 3 },
|
|
330
|
+
this.GetVendorPhoneNumber(Vendor.Ph, Type)
|
|
331
|
+
]
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
static GetAddress(Vendor: any) {
|
|
336
|
+
var Address = this.GetFormatAddress(Vendor);
|
|
337
|
+
if (Address.length !== 5) {
|
|
338
|
+
return Address;
|
|
339
|
+
} else {
|
|
340
|
+
let a: any = '';
|
|
341
|
+
return a;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
static GetFormatContact(CustomerObj: any) {
|
|
346
|
+
var contactnew = '';
|
|
347
|
+
CustomerObj.Contact.forEach((Contact: any) => {
|
|
348
|
+
contactnew = contactnew + '(' + Contact.Type + '):' + Contact.No + '\n';
|
|
349
|
+
});
|
|
350
|
+
return contactnew;
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
static GetFormatAddress(CustomerObj: any) {
|
|
354
|
+
var Addressnew = '';
|
|
355
|
+
if (!TrUtils.IsNull(CustomerObj) && !TrUtils.IsNull(CustomerObj.Adrs)) {
|
|
356
|
+
CustomerObj.Adrs.forEach((Adrs: any) => {
|
|
357
|
+
Addressnew = Addressnew + Adrs + '\n';
|
|
358
|
+
});
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
return Addressnew;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
static GetVendorGSTIN(Vendor: any) {
|
|
365
|
+
let GSTIN: any = {};
|
|
366
|
+
if (!TrUtils.IsEmpty(Vendor.GSTIN)) {
|
|
367
|
+
let columns: any = [];
|
|
368
|
+
columns.push({ text: 'GSTIN :', width: 33, style: 'hed' });
|
|
369
|
+
columns.push({ text: Vendor.GSTIN, marginTop: 1.5 });
|
|
370
|
+
GSTIN.columns = columns;
|
|
371
|
+
return GSTIN;
|
|
372
|
+
} else {
|
|
373
|
+
return GSTIN;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
static GetVendorPhoneNumber(Phone: any, Type: any) {
|
|
378
|
+
let PhoneNumber: any = {};
|
|
379
|
+
if (Type !== 'Technician Copy') {
|
|
380
|
+
// var contact = this.GetFormatContact(Vendor);
|
|
381
|
+
// if (contact.length !== 0) {
|
|
382
|
+
let columns: any = [];
|
|
383
|
+
columns.push({ text: 'Phone', width: 27, style: 'hed' });
|
|
384
|
+
columns.push({text:Phone+ '\n'});
|
|
385
|
+
PhoneNumber.columns = columns;
|
|
386
|
+
return PhoneNumber;
|
|
387
|
+
// } else {
|
|
388
|
+
// return PhoneNumber;
|
|
389
|
+
// }
|
|
390
|
+
} else {
|
|
391
|
+
return PhoneNumber;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
static VendorDetailsAfterLine() {
|
|
396
|
+
return {
|
|
397
|
+
canvas: [
|
|
398
|
+
{
|
|
399
|
+
type: 'line',
|
|
400
|
+
lineColor: 'black',
|
|
401
|
+
x1: 0,
|
|
402
|
+
y1: 0,
|
|
403
|
+
x2: 575,
|
|
404
|
+
y2: 0,
|
|
405
|
+
lineWidth: 1
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
static getPartsData(MOutPrintData: any) {
|
|
412
|
+
|
|
413
|
+
return this.GetWithOutDiscAndTaxFieldHeader(
|
|
414
|
+
TrUtils.Stringify(MOutPrintData.Items), MOutPrintData.Entity.MPN, MOutPrintData.ShowTaxColumn, MOutPrintData.Entity.Body, MOutPrintData.ShowIGST, MOutPrintData.ShowDiscountColumn);
|
|
415
|
+
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
static GetWithOutDiscAndTaxFieldHeader(Items: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
|
|
419
|
+
if (Items.length !== 0) {
|
|
420
|
+
|
|
421
|
+
return this.WithOutTaxDataTable(PrintPartNo, ShowIGST, Items, Body, ShowTaxColumn, ShowDiscountColumn)
|
|
422
|
+
|
|
423
|
+
} else {
|
|
424
|
+
let a: any = '';
|
|
425
|
+
return a;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
static WithOutTaxDataTable(PrintPartNo: any, ShowIGST: any, Items: any, Body: any, ShowTaxColumn: any, ShowDiscountColumn: any) {
|
|
430
|
+
return this.WithOutTaxDataTableWithPartNumber(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
static WithOutTaxDataTableWithPartNumber(Items: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
|
|
434
|
+
return {
|
|
435
|
+
style: 'table_data',
|
|
436
|
+
table: {
|
|
437
|
+
widths: [25, '*', 150, 60],
|
|
438
|
+
body: this.BuildTableBodyForLaborAndParts(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn)
|
|
439
|
+
},
|
|
440
|
+
layout: PrintSharedService.LayOutStyle()
|
|
441
|
+
};
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
static GetHeaderNames(){
|
|
445
|
+
let headersNames: any = [{ text: 'S.No.', style: 'tableheader', Field: 'SNo' },
|
|
446
|
+
{ text: 'Description', style: 'tableheader', Field: 'Desc' },
|
|
447
|
+
{ text: 'MPN', style: 'tableheader', Field: 'MPN' },
|
|
448
|
+
{ text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' }];
|
|
449
|
+
|
|
450
|
+
return headersNames;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
static BuildTableBodyForLaborAndParts(Items: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ShowDiscountColumn: any) {
|
|
454
|
+
var body: any = [];
|
|
455
|
+
let columns: any = this.GetHeaderNames();
|
|
456
|
+
// if (ShowTaxColumn) {
|
|
457
|
+
// for (let i = 0; i < columns.length; i++) {
|
|
458
|
+
body.push(columns);
|
|
459
|
+
// }
|
|
460
|
+
// columns = columns[0];
|
|
461
|
+
// } else {
|
|
462
|
+
// body.push(columns);
|
|
463
|
+
// }
|
|
464
|
+
let PartsTable = this.GetPartsDataTable(Items, columns, body);
|
|
465
|
+
return PartsTable;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
static GetPartsDataTable(Items: any, columns: any, body: any) {
|
|
469
|
+
let SNo: number = 1;
|
|
470
|
+
// console.log('Items', Items);
|
|
471
|
+
// console.log('columns', columns);
|
|
472
|
+
Items.forEach((part: any) => {
|
|
473
|
+
var dataRow: any = [];
|
|
474
|
+
columns.forEach((column: any) => {
|
|
475
|
+
if (!TrUtils.IsFixedZero(part[column.Field]) && !TrUtils.IsNull(part[column.Field])) {
|
|
476
|
+
if (column.Field === 'QtyAndUoM') {
|
|
477
|
+
dataRow.push({ text: part[column.Field]?.toString(), alignment: 'right', nowrap: true });
|
|
478
|
+
} else {
|
|
479
|
+
// dataRow.push(part[column.Field].toString());
|
|
480
|
+
if (column.Field === 'Desc') {
|
|
481
|
+
let DescData: any = [];
|
|
482
|
+
DescData.push(part[column.Field]?.toString());
|
|
483
|
+
if (!TrUtils.IsEmpty(part['EDesc'])) {
|
|
484
|
+
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
485
|
+
}
|
|
486
|
+
dataRow.push({ stack: DescData });
|
|
487
|
+
} else {
|
|
488
|
+
dataRow.push({ text: part[column.Field].toString() });
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
} else {
|
|
492
|
+
if (column.Field === 'SNo') {
|
|
493
|
+
part[column.Field] = SNo;
|
|
494
|
+
SNo = SNo + 1;
|
|
495
|
+
} else {
|
|
496
|
+
part[column.Field] = '';
|
|
497
|
+
}
|
|
498
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
499
|
+
}
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
body.push(dataRow);
|
|
503
|
+
});
|
|
504
|
+
|
|
505
|
+
return body;
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
static GetSignatures(CName: any) {
|
|
509
|
+
return {
|
|
510
|
+
fontSize: this.MediumFont,
|
|
511
|
+
columns: [{
|
|
512
|
+
stack: [
|
|
513
|
+
this.CompanyName(CName),
|
|
514
|
+
{ columns: [this.Authorizedsignature()] }
|
|
515
|
+
]
|
|
516
|
+
}],
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
static CompanyName(CName: any) {
|
|
521
|
+
return {
|
|
522
|
+
style: 'forCompany',
|
|
523
|
+
text: ['For ', { text: CName, bold: 'true' }],
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
static Authorizedsignature() {
|
|
528
|
+
return {
|
|
529
|
+
style: 'Sign',
|
|
530
|
+
text: ['Authorized Signatory'],
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
static HeaderLineStyle() {
|
|
535
|
+
return {
|
|
536
|
+
hLineWidth: function (i: any, node: any) {
|
|
537
|
+
return (i === 1) ? 0.5 : 0;
|
|
538
|
+
},
|
|
539
|
+
vLineWidth: function (i: any, node: any) {
|
|
540
|
+
return (i === 0 || i === node.table.widths.length) ? 0 : 0;
|
|
541
|
+
},
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { SharedPDFService } from "../../shared/shared-pdf.service";
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export class TransferOrderPrintService {
|
|
6
|
+
|
|
7
|
+
static GetTransferOrderPrint(ReOrderPointData: any) {
|
|
8
|
+
// console.log('ReOrderPointData', ReOrderPointData);
|
|
9
|
+
|
|
10
|
+
let dd: any = {
|
|
11
|
+
info: {
|
|
12
|
+
title: 'Transfer Order',
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
header: function (currentPage: any, pageCount: any, pageSize: any) {
|
|
16
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
|
|
17
|
+
},
|
|
18
|
+
pageMargins: [10, 15, 10, 15],
|
|
19
|
+
pageSize: 'A4',
|
|
20
|
+
content: [
|
|
21
|
+
{ text: ReOrderPointData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 20 },
|
|
22
|
+
|
|
23
|
+
SharedPDFService.GetPrintType('Transfer Order'),
|
|
24
|
+
SharedPDFService.HeaderAfterLine(),
|
|
25
|
+
{ text: 'From : ' + ReOrderPointData.FromName , style: 'hed', marginTop:5 },
|
|
26
|
+
{ text: 'To : ' + ReOrderPointData.ToName , style: 'hed'},
|
|
27
|
+
{ text: 'Date : ' + ReOrderPointData.Date , style: 'hed', marginBottom:5},
|
|
28
|
+
this.GetItemsTable(ReOrderPointData.Items),
|
|
29
|
+
|
|
30
|
+
this.GetSignatures(ReOrderPointData.Entity.CName, ReOrderPointData.Type, ReOrderPointData.For),
|
|
31
|
+
],
|
|
32
|
+
styles: {
|
|
33
|
+
headerstyle: {
|
|
34
|
+
fontFamily: 'Calibri',
|
|
35
|
+
fontSize: 9
|
|
36
|
+
},
|
|
37
|
+
Sign: {
|
|
38
|
+
fontSize: 8,
|
|
39
|
+
margin: [0, 30, 0, 5]
|
|
40
|
+
},
|
|
41
|
+
forCompany: {
|
|
42
|
+
marginRight: 5,
|
|
43
|
+
marginTop: 10,
|
|
44
|
+
fontSize: 9,
|
|
45
|
+
alignment: 'right'
|
|
46
|
+
},
|
|
47
|
+
tableheader: {
|
|
48
|
+
bold: true,
|
|
49
|
+
fontFamily: 'Calibri',
|
|
50
|
+
margin: [0, 1, 0, 5],
|
|
51
|
+
alignment: 'center'
|
|
52
|
+
},
|
|
53
|
+
tableheader1: {
|
|
54
|
+
bold: true,
|
|
55
|
+
fontFamily: 'Calibri',
|
|
56
|
+
margin: [0, 2, 0, 2],
|
|
57
|
+
alignment: 'center'
|
|
58
|
+
},
|
|
59
|
+
tableExample: {
|
|
60
|
+
fontSize: 9
|
|
61
|
+
},
|
|
62
|
+
hed: {
|
|
63
|
+
fontSize: 9
|
|
64
|
+
},
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
};
|
|
68
|
+
return dd;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static CustomerAndVehicleDetailsAfterLine() {
|
|
72
|
+
return {
|
|
73
|
+
canvas: [
|
|
74
|
+
{
|
|
75
|
+
type: 'line',
|
|
76
|
+
lineColor: 'gray',
|
|
77
|
+
x1: 0,
|
|
78
|
+
y1: 0,
|
|
79
|
+
x2: 575,
|
|
80
|
+
y2: 0,
|
|
81
|
+
lineWidth: 1
|
|
82
|
+
}
|
|
83
|
+
]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
static GetSignatures(CName: any, For: any, Type: any) {
|
|
88
|
+
return {
|
|
89
|
+
columns: [{
|
|
90
|
+
stack: [
|
|
91
|
+
this.CompanyName(CName),
|
|
92
|
+
]
|
|
93
|
+
}],
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
static CompanyName(CName: any) {
|
|
98
|
+
return {
|
|
99
|
+
style: 'forCompany',
|
|
100
|
+
text: ['For ', { text: CName, }],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
static GetItemsTable(Items: any) {
|
|
105
|
+
return {
|
|
106
|
+
style: 'tableExample',
|
|
107
|
+
marginTop: 3,
|
|
108
|
+
marginBottom: 5,
|
|
109
|
+
table: {
|
|
110
|
+
widths: ['*', 'auto'],
|
|
111
|
+
headerRows: 1,
|
|
112
|
+
body: this.BuildTableBodyForLaborAndParts(Items)
|
|
113
|
+
},
|
|
114
|
+
layout: {
|
|
115
|
+
hLineWidth: function (i:any, node:any) {
|
|
116
|
+
|
|
117
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
|
|
118
|
+
},
|
|
119
|
+
vLineWidth: function (i:any, node:any) {
|
|
120
|
+
return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
|
|
121
|
+
},
|
|
122
|
+
hLineColor: function (i: any, node: any) {
|
|
123
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
|
|
124
|
+
},
|
|
125
|
+
vLineColor: function (i: any, node: any) {
|
|
126
|
+
return 'gray';
|
|
127
|
+
},
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
static BuildTableBodyForLaborAndParts(Items: any) {
|
|
133
|
+
let body: any = this.GetHeaderNames();
|
|
134
|
+
Items.forEach((item: any, index: any) => {
|
|
135
|
+
let dataRow: any = [];
|
|
136
|
+
|
|
137
|
+
dataRow.push({ text: item.Name, });
|
|
138
|
+
dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
|
|
139
|
+
|
|
140
|
+
body.push(dataRow);
|
|
141
|
+
});
|
|
142
|
+
return body;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
static GetHeaderNames() {
|
|
146
|
+
let HeadingNames: any;
|
|
147
|
+
HeadingNames = [[{ text: 'Description', style: 'tableheader1', Field: 'Name', alignment: 'left', line: true },
|
|
148
|
+
{ text: 'Quantity', style: 'tableheader1', Field: 'Qty', alignment: 'right' }
|
|
149
|
+
]];
|
|
150
|
+
|
|
151
|
+
return HeadingNames;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
}
|