shareneus 1.0.5

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.
Files changed (125) hide show
  1. package/dist/aggregation/aggregation.js +60 -0
  2. package/dist/enums/cache-enums.js +37 -0
  3. package/dist/enums/code-enums.js +288 -0
  4. package/dist/enums/enums.js +362 -0
  5. package/dist/enums/industry-enums.js +24 -0
  6. package/dist/excel-files/GSTR-RO-excel.service.js +935 -0
  7. package/dist/excel-files/GSTR1-excel.service.js +295 -0
  8. package/dist/excel-files/GSTR2-excel.service.js +295 -0
  9. package/dist/excel-files/analysis-excel.service.js +297 -0
  10. package/dist/excel-files/category-wise-item-excel.service.js +274 -0
  11. package/dist/excel-files/cust-balance-excel.service.js +287 -0
  12. package/dist/excel-files/cust-wise-sales-details.js +320 -0
  13. package/dist/excel-files/cust-wise-sales-summary-excel.service.js +302 -0
  14. package/dist/excel-files/expiring-drugs-excel.service.js +292 -0
  15. package/dist/excel-files/insurance-expire-excel.service.js +301 -0
  16. package/dist/excel-files/invoice-wise-excel.service.js +857 -0
  17. package/dist/excel-files/item-wise-doctor-sale-excel.service.js +258 -0
  18. package/dist/excel-files/item-wise-mout-details.js +292 -0
  19. package/dist/excel-files/item-wise-mout-summary.js +286 -0
  20. package/dist/excel-files/items-wise-sales-excel.service.js +314 -0
  21. package/dist/excel-files/manf-wise-sales-excel.service.js +276 -0
  22. package/dist/excel-files/operator-wise-details.js +265 -0
  23. package/dist/excel-files/operator-wise-summary.js +266 -0
  24. package/dist/excel-files/payment-receive-excel.service.js +225 -0
  25. package/dist/excel-files/payments-made-excel.service.js +302 -0
  26. package/dist/excel-files/repair-orders-excel.service.js +255 -0
  27. package/dist/excel-files/sa-wise-labor-sales-excel.service.js +232 -0
  28. package/dist/excel-files/sa-wise-part-sales-excel.service.js +232 -0
  29. package/dist/excel-files/sale-summary-excel.service.js +326 -0
  30. package/dist/excel-files/sales-by-service-details-excel.service.js +1 -0
  31. package/dist/excel-files/sales-by-service-summary-excel.service.js +422 -0
  32. package/dist/excel-files/scheduled-drug-summary-excel.service.js +367 -0
  33. package/dist/excel-files/scheduled-drugs-excel.service.js +366 -0
  34. package/dist/excel-files/spares-issue-excel.service.js +492 -0
  35. package/dist/excel-files/stock-excel.service.js +283 -0
  36. package/dist/excel-files/tally-sales-import.service.js +765 -0
  37. package/dist/excel-files/ven-balance-excel.service.js +293 -0
  38. package/dist/index.js +237 -0
  39. package/dist/services/analysis-pdf.service.js +105 -0
  40. package/dist/services/appointment-total.service.js +253 -0
  41. package/dist/services/auto-sales-receipt-pdf.service.js +539 -0
  42. package/dist/services/category-wise-item-pdf.service.js +98 -0
  43. package/dist/services/checklist-pdf.js +140 -0
  44. package/dist/services/checklists-pdf.js +124 -0
  45. package/dist/services/cn-print.service.js +211 -0
  46. package/dist/services/consultation-fee-receipt.service.js +378 -0
  47. package/dist/services/consultation-full-pdf.service.js +220 -0
  48. package/dist/services/consultation-pdf.service.js +360 -0
  49. package/dist/services/credit-note-pdf.service.js +578 -0
  50. package/dist/services/credit-note-totals.service.js +328 -0
  51. package/dist/services/cust-wise-sales-details-pdf.service.js +118 -0
  52. package/dist/services/cust-wise-sales-summary-pdf.service.js +111 -0
  53. package/dist/services/customer-balances-pdf.service.js +169 -0
  54. package/dist/services/dc-landscape-pdf.service.js +903 -0
  55. package/dist/services/dc-landscape-without-price-pdf.service.js +853 -0
  56. package/dist/services/dc-without-price-pdf.service.js +489 -0
  57. package/dist/services/debit-note-pdf.service.js +673 -0
  58. package/dist/services/debit-note-print.service.js +234 -0
  59. package/dist/services/debit-note-totals.service.js +293 -0
  60. package/dist/services/delivery-challan-pdf.service.js +434 -0
  61. package/dist/services/delivery-challan-print.service.js +177 -0
  62. package/dist/services/delivery-challan-totals.js +339 -0
  63. package/dist/services/equipment-design-pdf.service.js +144 -0
  64. package/dist/services/est.print-service.js +1053 -0
  65. package/dist/services/expiring-drugs-pdf.service.js +156 -0
  66. package/dist/services/hc-inv-pdf.service.js +837 -0
  67. package/dist/services/insurance-expire-pdf.service.js +99 -0
  68. package/dist/services/inv-pdf.service.js +785 -0
  69. package/dist/services/inv-print.service.js +415 -0
  70. package/dist/services/invoice-landscape-pdf.service.js +909 -0
  71. package/dist/services/invoice-total.service.js +659 -0
  72. package/dist/services/issue-parts-pdf.service.js +763 -0
  73. package/dist/services/item-detais-pdf.js +136 -0
  74. package/dist/services/item-wise-doctor-sale-pdf.service.js +164 -0
  75. package/dist/services/item-wise-mout-details-pdf.js +107 -0
  76. package/dist/services/item-wise-mout-summary-pdf.js +99 -0
  77. package/dist/services/item-wise-sales-pdf.service.js +178 -0
  78. package/dist/services/manf-wise-sales-pdf.service.js +173 -0
  79. package/dist/services/meeting-pdf.js +369 -0
  80. package/dist/services/mout-pdf.service.js +503 -0
  81. package/dist/services/operator-wise-details-pdf.service.js +103 -0
  82. package/dist/services/operator-wise-summary-pdf.js +101 -0
  83. package/dist/services/pack-ship-pdf.service.js +105 -0
  84. package/dist/services/pack-ship-print.service.js +167 -0
  85. package/dist/services/payment-pdf.service.js +373 -0
  86. package/dist/services/payment-report-pdf.service.js +106 -0
  87. package/dist/services/po-totals.service.js +279 -0
  88. package/dist/services/pos-receipt-pdf.js +438 -0
  89. package/dist/services/purchase-order-pdf.service.js +924 -0
  90. package/dist/services/purchase-order-print.service.js +150 -0
  91. package/dist/services/purchase-order-totals.service.js +280 -0
  92. package/dist/services/receipt-print.service.js +50 -0
  93. package/dist/services/reorder-point-pdf.service.js +151 -0
  94. package/dist/services/repair-orders-pdf.service.js +172 -0
  95. package/dist/services/ro-pdf.service.js +1764 -0
  96. package/dist/services/ro-print-service.js +737 -0
  97. package/dist/services/ro-totals.service.js +1241 -0
  98. package/dist/services/sales-by-service-pdf.service.js +116 -0
  99. package/dist/services/sales-pdf.service.js +630 -0
  100. package/dist/services/sales-print.service.js +305 -0
  101. package/dist/services/sales-receipt-pdf.service.js +611 -0
  102. package/dist/services/sales-receipt-print.service.js +425 -0
  103. package/dist/services/sales-totals.service.js +339 -0
  104. package/dist/services/scheduled-drug-pdf.service.js +176 -0
  105. package/dist/services/scheduled-drug-summary-pdf.service.js +188 -0
  106. package/dist/services/separate-wo-print.service.js +351 -0
  107. package/dist/services/shared-inv-pdf.service.js +763 -0
  108. package/dist/services/shared-pdf.service.js +2569 -0
  109. package/dist/services/shared-print.service.js +885 -0
  110. package/dist/services/task-pdf.service.js +220 -0
  111. package/dist/services/task-reports-pdf.service.js +296 -0
  112. package/dist/services/technician-pdf.service.js +238 -0
  113. package/dist/services/technician-print.service.js +87 -0
  114. package/dist/services/transfer-order-pdf.service.js +139 -0
  115. package/dist/services/vendor-balances-pdf.service.js +101 -0
  116. package/dist/services/vendor-credit-note-pdf.service.js +1007 -0
  117. package/dist/services/vendor-credit-note-print.service.js +104 -0
  118. package/dist/services/vendor-credit-note-totals.service.js +327 -0
  119. package/dist/services/vendor-debit-note-pdf.service.js +561 -0
  120. package/dist/services/vendor-debit-note-print.service.js +245 -0
  121. package/dist/services/vendor-debit-note-totals.service.js +305 -0
  122. package/dist/utils/my-date.js +652 -0
  123. package/dist/utils/tr-utils.js +354 -0
  124. package/package.json +24 -0
  125. package/tsconfig.json +109 -0
@@ -0,0 +1,853 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DCLandscapeWithoutPricePdfService = void 0;
4
+ const my_date_1 = require("../utils/my-date");
5
+ const tr_utils_1 = require("../utils/tr-utils");
6
+ const shared_pdf_service_1 = require("./shared-pdf.service");
7
+ const shared_print_service_1 = require("./shared-print.service");
8
+ class DCLandscapeWithoutPricePdfService {
9
+ constructor() {
10
+ this.FontSize = 8;
11
+ }
12
+ static GetDeliveryChallanPrint(ROPrintData, numberofCopies) {
13
+ var contents = [];
14
+ if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
15
+ contents.push(this.CommonHeaderDetails(ROPrintData, null), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies));
16
+ }
17
+ else {
18
+ numberofCopies.forEach((text, index) => {
19
+ contents.push(this.CommonHeaderDetails(ROPrintData, text), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, index, numberofCopies));
20
+ });
21
+ }
22
+ var dd = {
23
+ info: {
24
+ title: this.GetFileName(ROPrintData),
25
+ },
26
+ background: function (currentPage, pageSize) {
27
+ return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
28
+ },
29
+ header: function (currentPage, pageCount) {
30
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
31
+ },
32
+ pageMargins: [10, 15, 10, 15],
33
+ // pageOrientation: 'landscape',
34
+ content: contents,
35
+ // footer:footers,
36
+ // footer: {
37
+ // columns: this.CommonTotalDetails(ROPrintData, null, numberofCopies)
38
+ // },
39
+ styles: shared_pdf_service_1.SharedPDFService.GetStyles()
40
+ };
41
+ return dd;
42
+ }
43
+ static GetFileName(ROPrintData) {
44
+ let fileName = ROPrintData.HeaderName;
45
+ if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
46
+ fileName = fileName + '-' + ROPrintData.Product.RegNo;
47
+ }
48
+ return fileName;
49
+ }
50
+ static GetAddress(Entity) {
51
+ return Entity.Adrs1 + ', ' + Entity.Adrs2 + ', ' + Entity.City + '-' + Entity.PIN + ', Cell : ' + Entity.Phone;
52
+ }
53
+ static GetHeaderInfo(InvoicePDFData) {
54
+ let TaxInfo = [];
55
+ if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
56
+ TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 7, width: 'auto' });
57
+ }
58
+ // if (!TrUtils.IsEmpty(InvoicePDFData.Entity.PAN)) {
59
+ // TaxInfo.push({ text: 'PAN : ' + InvoicePDFData.Entity.PAN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
60
+ // );
61
+ // }
62
+ if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
63
+ TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 7, width: '*' });
64
+ }
65
+ TaxInfo.push(this.GetBillofSupplyName(InvoicePDFData.Settings));
66
+ return TaxInfo;
67
+ }
68
+ static GetBillofSupplyName(Settings) {
69
+ return { text: Settings.Tax === 'BS' ? 'Bill of Supply' : null, alignment: 'right', marginRight: 5, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
70
+ }
71
+ static CommonHeaderDetails(ROPrintData, text) {
72
+ return [
73
+ { text: 'DELIVERY CHALLAN', alignment: 'center', bold: true, fontSize: 10 },
74
+ { text: text, color: 'grey', alignment: 'right', width: 100, marginTop: (text !== null) ? -11 : 0, fontSize: 10 },
75
+ {
76
+ style: 'tableExample',
77
+ table: {
78
+ widths: ['*', '*', '*'],
79
+ body: [
80
+ [
81
+ {
82
+ stack: [
83
+ { text: ROPrintData.Entity.CName, alignment: 'center', bold: true, fontSize: 10 },
84
+ // this.GetAddresDetailsAndLogo(ROPrintData.Entity, ROPrintData.Image, ROPrintData.AColor, ROPrintData.HColor, text)
85
+ { text: this.GetAddress(ROPrintData.Entity), alignment: 'center', style: ['headerstyle'] },
86
+ {
87
+ stack: this.GetHeaderInfo(ROPrintData)
88
+ },
89
+ ]
90
+ },
91
+ shared_pdf_service_1.SharedPDFService.GetCustomer(ROPrintData.Customer, ROPrintData.Type, ROPrintData.For, ROPrintData.Product, ROPrintData.Settings, 'Customer Name & Address', false),
92
+ shared_pdf_service_1.SharedPDFService.GetVehicleDetails(ROPrintData.Type, ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate, ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Product, ROPrintData.PrintType, ROPrintData.IsProforma, ROPrintData.Settings, false, ROPrintData.BL, null, null, null)
93
+ ],
94
+ ]
95
+ },
96
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
97
+ },
98
+ // this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
99
+ // SharedPDFService.GetCustomerAndVehicleDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate,
100
+ // ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Product, ROPrintData.PrintType, ROPrintData.For,
101
+ // ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.InsComp,
102
+ // ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, ROPrintData.IsProforma, ROPrintData.Settings, null, false, ROPrintData.BL),
103
+ // SharedPDFService.GetOwnerDetails(ROPrintData.Cust, ROPrintData.Type, ROPrintData.For),
104
+ // SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
105
+ // SharedPDFService.GetDisplayTable(),
106
+ ];
107
+ }
108
+ static MainHeading(CName, Entity, Image, HColor, CopyName) {
109
+ let headerstyle;
110
+ let MainHeaderStyle = shared_pdf_service_1.SharedPDFService.GetMainHeaderStyleForLeftAlignHeader(CName);
111
+ // if (Header === 1) {
112
+ headerstyle = 'header2';
113
+ // } else {
114
+ // headerstyle = 'temp2header';
115
+ // }
116
+ return shared_pdf_service_1.SharedPDFService.HeaderAlignmentBasedOnCondition(CName, Image, HColor, headerstyle, MainHeaderStyle, Entity, CopyName);
117
+ }
118
+ static GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text) {
119
+ let Details = [
120
+ {
121
+ stack: [
122
+ { columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
123
+ {
124
+ columns: [{
125
+ width: 150,
126
+ margin: [0, 0, 0, 5],
127
+ stack: shared_pdf_service_1.SharedPDFService.GetHeader(Entity, HColor),
128
+ color: AColor,
129
+ style: 'header'
130
+ },
131
+ shared_pdf_service_1.SharedPDFService.GetEntityDetails(Entity)]
132
+ }
133
+ ]
134
+ }
135
+ ];
136
+ if (!tr_utils_1.TrUtils.IsNull(Image)) {
137
+ // Details.unshift({ text: '', width: 120 });
138
+ if (Entity.CName.length < 28) {
139
+ Details[0].stack[0].columns.push({ text: '', width: 140 });
140
+ }
141
+ if (!tr_utils_1.TrUtils.IsNull(text)) {
142
+ Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
143
+ }
144
+ Details.unshift({ image: Image, width: 120, height: 80 });
145
+ }
146
+ else {
147
+ Details[0].stack[1].columns.unshift({ text: '', width: 130 });
148
+ if (!tr_utils_1.TrUtils.IsNull(text)) {
149
+ Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
150
+ }
151
+ }
152
+ return Details;
153
+ }
154
+ static GetMainHeaderDetails(Entity, HeaderName, Image, HColor, AColor, text) {
155
+ return [
156
+ // SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
157
+ shared_pdf_service_1.SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
158
+ shared_pdf_service_1.SharedPDFService.GetPrintType(HeaderName),
159
+ shared_pdf_service_1.SharedPDFService.HeaderAfterLine()
160
+ ];
161
+ }
162
+ static PreparesparePartsTable(ROPrintData) {
163
+ let List = [];
164
+ if (ROPrintData.Entity.Body === 1) {
165
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
166
+ if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
167
+ ROPrintData.PrintInfo[i].Text = '';
168
+ }
169
+ // List.push(ROPrintData.PrintInfo[i].Text,
170
+ // this.GetLaborPartsTableForView(ROPrintData.PrintInfo[i].Items)
171
+ // );
172
+ }
173
+ }
174
+ else {
175
+ if (ROPrintData.Entity.Body === 2) {
176
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
177
+ if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
178
+ ROPrintData.PrintInfo[i].Text = '';
179
+ }
180
+ List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
181
+ }
182
+ }
183
+ else {
184
+ if (ROPrintData.Summary) {
185
+ // List.push('',
186
+ // this.GetLaborPartsTableForView(ROPrintData.Items)
187
+ // );
188
+ }
189
+ else {
190
+ for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
191
+ if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
192
+ ROPrintData.PrintInfo[i].Text = '';
193
+ }
194
+ List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
195
+ }
196
+ }
197
+ }
198
+ }
199
+ return List;
200
+ }
201
+ static WithOutDiscountFieldTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
202
+ if (Parts.length !== 0) {
203
+ if (PrintPartNo) {
204
+ return {
205
+ style: 'tableExample',
206
+ marginLeft: 20,
207
+ table: {
208
+ widths: [15, 67, 160, 25, 50, 60, 30, 53],
209
+ headerRows: 1,
210
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
211
+ },
212
+ layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
213
+ };
214
+ }
215
+ else {
216
+ return {
217
+ style: 'tableExample',
218
+ marginLeft: 20,
219
+ table: {
220
+ widths: [15, 215, 25, 50, 60, 45, 60],
221
+ headerRows: 1,
222
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
223
+ },
224
+ layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
225
+ };
226
+ }
227
+ }
228
+ else {
229
+ let a = '';
230
+ return a;
231
+ }
232
+ }
233
+ static GetWithOutDiscountFieldHeader1(permission, Body, ShowIGST, ShowDiscountColumn) {
234
+ let headersNames;
235
+ if (permission) {
236
+ headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
237
+ { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
238
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
239
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
240
+ { text: 'Batch No', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
241
+ { text: 'Expiry', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
242
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
243
+ { text: 'Offer Qty', style: 'tableheader', rowSpan: 2, lineHeight: 1 },
244
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'center', },
245
+ { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tabFleheader' }
246
+ ],
247
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'MPN', lineHeight: 0.5 },
248
+ { text: '', Field: 'Desc', lineHeight: 0.5 }, { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
249
+ { text: '', Field: 'Batch', lineHeight: 0.5 }, { text: 'Expiry', Field: 'ExDate', lineHeight: 0.5 },
250
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: '', Field: 'OfQty', lineHeight: 0.5 }, { text: '', Field: 'UnPr', lineHeight: 0.5 },
251
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
252
+ ]
253
+ ];
254
+ let Count = 9;
255
+ if (ShowDiscountColumn) {
256
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
257
+ headersNames[0].splice(Count + 1, 0, {});
258
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
259
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
260
+ Count = 11;
261
+ }
262
+ if (ShowIGST) {
263
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
264
+ headersNames[0].splice(Count + 1, 0, {});
265
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
266
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
267
+ }
268
+ else {
269
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
270
+ headersNames[0].splice(Count + 1, 0, {});
271
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
272
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.7 });
273
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
274
+ headersNames[0].splice(Count + 3, 0, {});
275
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
276
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
277
+ }
278
+ }
279
+ else {
280
+ headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 },
281
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.6 },
282
+ { text: 'HSN/SAC', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
283
+ { text: 'Batch No', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
284
+ { text: 'Expiry', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
285
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.6 },
286
+ { text: 'Offer Qty', style: 'tableheader', rowSpan: 2, lineHeight: 1 },
287
+ { text: 'Unit Price', style: 'tableheader', rowSpan: 2, alignment: 'center', lineHeight: 0.6 },
288
+ { text: 'Line Total', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 }
289
+ ],
290
+ [{ text: '', Field: 'SNo', lineHeight: 0.5 },
291
+ { text: '', Field: 'Desc', lineHeight: 0.5 }, { text: 'HSN/SAC', Field: 'HSN', lineHeight: 0.5 },
292
+ { text: '', Field: 'Batch', lineHeight: 0.5 }, { text: 'Expiry', Field: 'ExDate', lineHeight: 0.5 },
293
+ { text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: '', Field: 'OfQty', lineHeight: 0.5 }, { text: '', Field: 'UnPr', lineHeight: 0.5 },
294
+ { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
295
+ ]];
296
+ let Count = 8;
297
+ if (ShowDiscountColumn) {
298
+ headersNames[0].splice(Count, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
299
+ headersNames[0].splice(Count + 1, 0, {});
300
+ headersNames[1].splice(Count, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
301
+ headersNames[1].splice(Count + 1, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
302
+ Count = 10;
303
+ }
304
+ if (ShowIGST) {
305
+ headersNames[0].splice(Count, 0, { text: 'IGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
306
+ headersNames[0].splice(Count + 1, 0, {});
307
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'IGSTPerc', type: 'percentage', lineHeight: 0.8 });
308
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'IGSTAmt', type: 'amount', lineHeight: 0.5 });
309
+ }
310
+ else {
311
+ headersNames[0].splice(Count, 0, { text: 'CGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
312
+ headersNames[0].splice(Count + 1, 0, {});
313
+ headersNames[1].splice(Count, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'CGSTPerc', type: 'percentage', lineHeight: 0.8 });
314
+ headersNames[1].splice(Count + 1, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'CGSTAmt', type: 'amount', lineHeight: 0.5 });
315
+ headersNames[0].splice(Count + 2, 0, { text: 'SGST/UTGST', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.8 });
316
+ headersNames[0].splice(Count + 3, 0, {});
317
+ headersNames[1].splice(Count + 2, 0, { text: 'Rate %', alignment: 'center', style: 'tableheader', Field: 'SGSTPerc', type: 'percentage', lineHeight: 0.8 });
318
+ headersNames[1].splice(Count + 3, 0, { text: 'Amount', alignment: 'center', style: 'tableheader', Field: 'SGSTAmt', type: 'amount', lineHeight: 0.5 });
319
+ }
320
+ }
321
+ return headersNames;
322
+ }
323
+ static GetWithOutDiscountFieldHeader2(permission, Body, ShowDiscountColumn) {
324
+ let headersNames = [[
325
+ { text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 1 },
326
+ { text: 'Batch No', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
327
+ { text: 'Expiry', rowSpan: 2, style: 'tableheader', lineHeight: 1 },
328
+ { text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 1 },
329
+ // { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'right', },
330
+ // { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
331
+ ],
332
+ [
333
+ { text: '', Field: 'Desc', lineHeight: 1 },
334
+ { text: '', Field: 'Batch', lineHeight: 1 },
335
+ { text: '', Field: 'ExDate', lineHeight: 1 },
336
+ { text: '', Field: 'QtyAndUoM', lineHeight: 1 },
337
+ // { text: '', Field: 'UnPr', lineHeight: 0.5 },
338
+ // { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
339
+ ]];
340
+ if (permission) {
341
+ let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 1 };
342
+ let MPN = { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 1 };
343
+ let sno1 = { text: '', Field: 'SNo', lineHeight: 1 };
344
+ let MPN1 = { text: '', Field: 'MPN', lineHeight: 1 };
345
+ headersNames[0].unshift(sno, MPN);
346
+ headersNames[1].unshift(sno1, MPN1);
347
+ // if (ShowDiscountColumn) {
348
+ // headersNames[0].splice(5, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
349
+ // headersNames[0].splice(6, 0, {});
350
+ // headersNames[1].splice(5, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
351
+ // headersNames[1].splice(6, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
352
+ // }
353
+ }
354
+ else {
355
+ let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
356
+ let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
357
+ headersNames[0].unshift(sno);
358
+ headersNames[1].unshift(sno1);
359
+ // if (ShowDiscountColumn) {
360
+ // headersNames[0].splice(4, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
361
+ // headersNames[0].splice(5, 0, {});
362
+ // headersNames[1].splice(4, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
363
+ // headersNames[1].splice(5, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
364
+ // }
365
+ }
366
+ return headersNames;
367
+ }
368
+ static GetWithOutDiscountFieldHeader(permission, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn) {
369
+ if (Body === 2) {
370
+ let headersNames = [{ text: 'Description', style: 'tableheader', Field: 'Desc' },
371
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' },
372
+ // { text: 'Unit Price', style: 'tableheader', Field: 'UnPr' },
373
+ // { text: 'Labor Charges', style: 'tableheader', Field: 'Price' },
374
+ // { text: 'Tax', style: 'tableheader', Field: 'TaxAmount' },
375
+ // { text: 'Line Total', style: 'tableheader', Field: 'LineTotal' }
376
+ ];
377
+ if (permission) {
378
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
379
+ let MPN = { text: 'Part No', style: 'tableheader', Field: 'MPN' };
380
+ headersNames.unshift(sno, MPN);
381
+ }
382
+ else {
383
+ let sno = { text: 'S.No.', style: 'tableheader', Field: 'SNo' };
384
+ headersNames.unshift(sno);
385
+ }
386
+ return headersNames;
387
+ }
388
+ else {
389
+ if (ShowTaxColumn) {
390
+ return this.GetWithOutDiscountFieldHeader1(permission, Body, ShowIGST, ShowDiscountColumn);
391
+ }
392
+ else {
393
+ return this.GetWithOutDiscountFieldHeader2(permission, Body, ShowDiscountColumn);
394
+ }
395
+ }
396
+ }
397
+ static BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
398
+ var body = [];
399
+ let columns = this.GetWithOutDiscountFieldHeader(PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
400
+ // if (ShowTaxColumn) {
401
+ for (let i = 0; i < columns.length; i++) {
402
+ body.push(columns[i]);
403
+ }
404
+ columns = columns[1];
405
+ // } else {
406
+ // body.push(columns);
407
+ // }
408
+ let DummyOps = [];
409
+ if (Parts.length !== 0) {
410
+ // let dummypartadding1: any = {};
411
+ // dummypartadding1.SNo = '';
412
+ // dummypartadding1.Desc = 'Spare Parts';
413
+ // dummypartadding1.Qty = '';
414
+ // dummypartadding1.UnPr = '';
415
+ // dummypartadding1.LineTotal = '';
416
+ // Parts.unshift(dummypartadding1);
417
+ // if (Parts.length <= 15) {
418
+ // let Count: number = 18 - Parts.length;
419
+ // for (let i = 0; i < Count; i++) {
420
+ // Parts.push({});
421
+ // }
422
+ // } else {
423
+ // let Count: number = 58 - Parts.length;
424
+ // for (let i = 0; i < Count; i++) {
425
+ // Parts.push({});
426
+ // }
427
+ // }
428
+ }
429
+ let SNo = 1;
430
+ Parts.forEach((part) => {
431
+ var dataRow = [];
432
+ columns.forEach((column) => {
433
+ if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
434
+ || (column.text === 'Line Total' || column.text === 'Expiry')) {
435
+ if (part[column.Field] === 'Spare Parts') {
436
+ dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
437
+ }
438
+ else {
439
+ if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
440
+ && tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
441
+ part[column.Field] = '';
442
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
443
+ }
444
+ else {
445
+ if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'Batch' || column.Field === 'ExDate' || column.Field === 'QtyAndUoM'
446
+ || column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
447
+ || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
448
+ if (column.Field === 'Disc') {
449
+ if (column.type === 'percentage') {
450
+ if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
451
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true });
452
+ }
453
+ else {
454
+ dataRow.push({ text: '', noWrap: true });
455
+ }
456
+ }
457
+ else {
458
+ if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
459
+ dataRow.push({ text: part[column.Field].toString(), noWrap: true });
460
+ }
461
+ else {
462
+ dataRow.push({ text: '', noWrap: true });
463
+ }
464
+ }
465
+ }
466
+ else {
467
+ if (column.Field === 'Batch') {
468
+ if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
469
+ dataRow.push({ text: part[column.Field].BN, nowrap: true });
470
+ }
471
+ else {
472
+ dataRow.push({ text: '', noWrap: true });
473
+ }
474
+ }
475
+ else if (column.Field === 'ExDate') {
476
+ if (!tr_utils_1.TrUtils.IsNull(part['Batch'])) {
477
+ dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(part['Batch'].ExDt), nowrap: true });
478
+ }
479
+ else {
480
+ dataRow.push({ text: '', noWrap: true });
481
+ }
482
+ }
483
+ else {
484
+ if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
485
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
486
+ }
487
+ else {
488
+ dataRow.push({ text: '', noWrap: true });
489
+ }
490
+ }
491
+ }
492
+ }
493
+ else {
494
+ // dataRow.push(part[column.Field].toString());
495
+ if (column.Field === 'Desc') {
496
+ let DescData = [];
497
+ DescData.push(part[column.Field].toString());
498
+ if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
499
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
500
+ }
501
+ dataRow.push({ stack: DescData });
502
+ }
503
+ else {
504
+ dataRow.push({ text: part[column.Field].toString() });
505
+ }
506
+ }
507
+ }
508
+ }
509
+ }
510
+ else {
511
+ if (column.Field === 'SNo' && !tr_utils_1.TrUtils.IsNull(part.Desc)) {
512
+ part[column.Field] = SNo;
513
+ SNo = SNo + 1;
514
+ }
515
+ else {
516
+ part[column.Field] = '';
517
+ }
518
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
519
+ }
520
+ });
521
+ body.push(dataRow);
522
+ });
523
+ // if (Labor.length !== 0) {
524
+ // let dummypartadding1: any = {};
525
+ // dummypartadding1.SNo = '';
526
+ // dummypartadding1.Desc = 'Labor';
527
+ // dummypartadding1.Qty = '';
528
+ // dummypartadding1.UnPr = '';
529
+ // dummypartadding1.LineTotal = '';
530
+ // Labor.unshift(dummypartadding1);
531
+ // // DummyOps.unshift(dummypartadding1);
532
+ // }
533
+ // if (Body === 2) {
534
+ // for (let i = 0; i < Labor.length; i++) {
535
+ // Labor[i].UnPr = '';
536
+ // }
537
+ // }
538
+ // Labor.forEach((Ops: any) => {
539
+ // var dataRow: any = [];
540
+ // columns.forEach((column: any) => {
541
+ // if ((!TrUtils.IsFixedZero(Ops[column.Field]) && !TrUtils.IsNull(Ops[column.Field]))
542
+ // || (column.text === 'Line Total')) {
543
+ // if (Ops[column.Field] === 'Labor') {
544
+ // dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
545
+ // } else {
546
+ // if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
547
+ // && TrUtils.CheckInvalidSelect(Ops.TCode))) {
548
+ // Ops[column.Field] = '';
549
+ // dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
550
+ // } else {
551
+ // if (column.text === 'Line Total' || column.Field === 'Price' || column.text === 'Tax' || column.Field === 'UnPr'
552
+ // || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
553
+ // || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
554
+ // if (column.Field === 'Disc') {
555
+ // if (column.type === 'percentage') {
556
+ // if (Ops.Perc && !TrUtils.IsZero(Ops[column.Field])) {
557
+ // dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
558
+ // } else {
559
+ // dataRow.push({ text: '', noWrap: true });
560
+ // }
561
+ // } else {
562
+ // if (!Ops.Perc && !TrUtils.IsZero(Ops[column.Field])) {
563
+ // dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
564
+ // } else {
565
+ // dataRow.push({ text: '', noWrap: true });
566
+ // }
567
+ // }
568
+ // } else {
569
+ // if (!TrUtils.IsZero(Ops[column.Field])) {
570
+ // dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true });
571
+ // } else {
572
+ // dataRow.push({ text: '', noWrap: true });
573
+ // }
574
+ // }
575
+ // } else {
576
+ // dataRow.push(Ops[column.Field].toString());
577
+ // }
578
+ // }
579
+ // }
580
+ // } else {
581
+ // if (column.Field === 'SNo') {
582
+ // Ops[column.Field] = SNo;
583
+ // SNo = SNo + 1;
584
+ // } else {
585
+ // Ops[column.Field] = '';
586
+ // }
587
+ // dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
588
+ // }
589
+ // });
590
+ // body.push(dataRow);
591
+ // });
592
+ return body;
593
+ }
594
+ static GetWithOutDiscAndTaxFieldHeader(Parts, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
595
+ if (Parts.length !== 0) {
596
+ if (ShowTaxColumn) {
597
+ return this.TaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
598
+ }
599
+ else {
600
+ if (ConsolidateGST) {
601
+ return this.ConsolidateDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
602
+ }
603
+ else {
604
+ return this.NoTaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
605
+ }
606
+ }
607
+ }
608
+ else {
609
+ let a = '';
610
+ return a;
611
+ }
612
+ }
613
+ static TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn) {
614
+ if (PrintPartNo) {
615
+ if (ShowIGST) {
616
+ if (ShowDiscountColumn) {
617
+ return [24, 50, '*', 35, 35, 35, 30, 25, 40, 20, 35, 20, 35, 45];
618
+ }
619
+ else {
620
+ return [24, 50, '*', 35, 35, 35, 30, 25, 40, 20, 35, 51];
621
+ }
622
+ }
623
+ else {
624
+ if (ShowDiscountColumn) {
625
+ return [24, 45, '*', 35, 35, 35, 30, 22, 40, 20, 34, 20, 32, 20, 32, 48];
626
+ }
627
+ else {
628
+ return [24, 45, '*', 35, 35, 35, 30, 22, 40, 20, 32, 20, 32, 54];
629
+ }
630
+ }
631
+ }
632
+ else {
633
+ if (ShowIGST) {
634
+ if (ShowDiscountColumn) {
635
+ return [24, '*', 35, 41, 35, 30, 25, 40, 20, 35, 20, 35, 41];
636
+ }
637
+ else {
638
+ return [24, '*', 35, 50, 35, 30, 25, 40, 20, 40, 50];
639
+ }
640
+ }
641
+ else {
642
+ if (ShowDiscountColumn) {
643
+ return [24, '*', 35, 45, 35, 30, 22, 40, 20, 34, 20, 35, 20, 35, 45];
644
+ }
645
+ else {
646
+ return [24, '*', 35, 50, 35, 30, 22, 40, 20, 35, 20, 35, 50];
647
+ }
648
+ }
649
+ }
650
+ }
651
+ static TaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
652
+ if (PrintPartNo) {
653
+ if (ShowIGST) {
654
+ return {
655
+ style: 'tableExample',
656
+ marginTop: -6,
657
+ table: {
658
+ widths: this.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
659
+ // headerRows: 2,
660
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
661
+ },
662
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
663
+ };
664
+ }
665
+ else {
666
+ return {
667
+ style: 'tableExample',
668
+ marginTop: -6,
669
+ table: {
670
+ widths: this.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
671
+ // headerRows: 2,
672
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
673
+ },
674
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
675
+ };
676
+ }
677
+ }
678
+ else {
679
+ if (ShowIGST) {
680
+ return {
681
+ style: 'tableExample',
682
+ marginTop: -6,
683
+ table: {
684
+ widths: this.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
685
+ // headerRows: 2,
686
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
687
+ },
688
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
689
+ };
690
+ }
691
+ else {
692
+ return {
693
+ style: 'tableExample',
694
+ marginTop: -6,
695
+ table: {
696
+ widths: this.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
697
+ // headerRows: 2,
698
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
699
+ },
700
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
701
+ };
702
+ }
703
+ }
704
+ }
705
+ static LayOutStyle() {
706
+ return {
707
+ hLineWidth: function (i, node) {
708
+ return (i === 0 || i === 1 || i === 2) ? 0.7 : 0;
709
+ },
710
+ vLineWidth: function (i, node) {
711
+ return (i === 0 || i === 1 || i === 2) ? 0.7 : 0.7;
712
+ },
713
+ hLineColor: function (i, node) {
714
+ let color;
715
+ if (i === 0 || i === node.table.body.length) {
716
+ color = 'black';
717
+ }
718
+ else {
719
+ if (i === 1) {
720
+ color = 'gray';
721
+ }
722
+ else {
723
+ color = 'lightgray';
724
+ }
725
+ }
726
+ return color;
727
+ },
728
+ vLineColor: function (i, node) {
729
+ let color;
730
+ if (i === 0 || i === node.table.widths.length) {
731
+ color = 'black';
732
+ }
733
+ else {
734
+ color = 'lightgray';
735
+ }
736
+ return color;
737
+ },
738
+ };
739
+ }
740
+ static ConsolidateDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
741
+ if (PrintPartNo) {
742
+ return {
743
+ style: 'tableExample',
744
+ marginTop: -6,
745
+ table: {
746
+ widths: [15, 70, 273, 25, 60, 80, 10, 40],
747
+ // headerRows: 1,
748
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
749
+ },
750
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
751
+ };
752
+ }
753
+ else {
754
+ return {
755
+ style: 'tableExample',
756
+ marginTop: -6,
757
+ table: {
758
+ widths: [20, 300, 50, 80, 80, 10, 40],
759
+ // headerRows: 1,
760
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
761
+ },
762
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
763
+ };
764
+ }
765
+ }
766
+ static WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo) {
767
+ if (PrintPartNo) {
768
+ if (ShowDiscountColumn) {
769
+ return [24, 70, '*', 25, 60, 45, 45, 50];
770
+ }
771
+ else {
772
+ return [25, 70, '*', 80, 80, 80];
773
+ }
774
+ }
775
+ else {
776
+ if (ShowDiscountColumn) {
777
+ return [25, '*', 70, 70, 70, 70, 70];
778
+ }
779
+ else {
780
+ return [25, '*', 80, 80, 80];
781
+ }
782
+ }
783
+ }
784
+ static NoTaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
785
+ if (PrintPartNo) {
786
+ return {
787
+ style: 'tableExample',
788
+ marginTop: -6,
789
+ table: {
790
+ widths: this.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
791
+ // headerRows: 1,
792
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
793
+ },
794
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
795
+ };
796
+ }
797
+ else {
798
+ return {
799
+ style: 'tableExample',
800
+ marginTop: -6,
801
+ table: {
802
+ widths: this.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
803
+ // headerRows: 1,
804
+ body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
805
+ },
806
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
807
+ };
808
+ }
809
+ }
810
+ static CommonTotalDetails(ROPrintData, index, numberofCopies) {
811
+ let CommonDetails = [
812
+ shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
813
+ // SharedPDFService.GetUnderLine(),
814
+ this.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
815
+ ];
816
+ // if (ROPrintData.Type !== 'Invoice') {
817
+ // CommonDetails.splice(2, 0, SharedPDFService.GetUnderLine());
818
+ // }
819
+ if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
820
+ CommonDetails.push({ text: '', pageBreak: 'after' });
821
+ }
822
+ return CommonDetails;
823
+ }
824
+ static GetSignatures(CName, For, Type) {
825
+ return {
826
+ columns: [{
827
+ stack: [
828
+ this.CompanyName(CName),
829
+ { columns: [this.Authorizedsignature(), shared_pdf_service_1.SharedPDFService.SurveyorSignature(For, Type), this.CustomerSignature()] }
830
+ ]
831
+ }],
832
+ };
833
+ }
834
+ static CompanyName(CName) {
835
+ return {
836
+ style: 'forCompany1',
837
+ text: ['For ', { text: CName, bold: 'true' }],
838
+ };
839
+ }
840
+ static Authorizedsignature() {
841
+ return {
842
+ style: 'Sign1',
843
+ text: ['Authorized Signatory'],
844
+ };
845
+ }
846
+ static CustomerSignature() {
847
+ return {
848
+ style: 'Sign1',
849
+ text: ['Customer Signature'], marginLeft: 90
850
+ };
851
+ }
852
+ }
853
+ exports.DCLandscapeWithoutPricePdfService = DCLandscapeWithoutPricePdfService;