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,857 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.InvoicesWiseXlsxFileService = void 0;
27
+ const XLSX = __importStar(require("xlsx"));
28
+ const tr_utils_1 = require("../utils/tr-utils");
29
+ class InvoicesWiseXlsxFileService {
30
+ static GetInvoiceWiseExcelData(MainData, WOTypes) {
31
+ this.wb = {};
32
+ this.ws = {};
33
+ this.Row = 0;
34
+ this.range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
35
+ this.MergeArray = [];
36
+ let ws_name = 'Invoices';
37
+ this.wb.Sheets = {};
38
+ this.wb.Props = {};
39
+ this.wb.SSF = {};
40
+ this.wb.SheetNames = [];
41
+ MainData = this.GetTotals(MainData, WOTypes);
42
+ this.setHeadingInCell();
43
+ this.setInvoiceDetailsInCell(MainData);
44
+ this.ws['!ref'] = XLSX.utils.encode_range(this.range);
45
+ this.ws['!merges'] = this.MergeArray;
46
+ this.wb.SheetNames.push(ws_name);
47
+ this.wb.Sheets[ws_name] = this.ws;
48
+ return this.wb;
49
+ }
50
+ static GetTotals(MainData, WOTypes) {
51
+ MainData.forEach((InvoiceInfo) => {
52
+ if (InvoiceInfo.VIN == null) {
53
+ InvoiceInfo.VIN = '';
54
+ }
55
+ if (InvoiceInfo.Name == null) {
56
+ InvoiceInfo.Name = '';
57
+ }
58
+ if (InvoiceInfo.TeNa == null) {
59
+ InvoiceInfo.TeNa = '';
60
+ }
61
+ if (InvoiceInfo.Type == null) {
62
+ InvoiceInfo.TypeName = '';
63
+ }
64
+ else {
65
+ InvoiceInfo.TypeName = this.GetWOTypeName(InvoiceInfo.Type, WOTypes);
66
+ }
67
+ // let CGST18: number = 0;
68
+ // let SGST18: number = 0;
69
+ // let CGST28: number = 0;
70
+ // let SGST28: number = 0;
71
+ // let Total18perc: number = 0;
72
+ // let Total18perctax: number = 0;
73
+ // let Total28perc: number = 0;
74
+ // let Total28perctax: number = 0;
75
+ // if(!TrUtils.IsNull(InvoiceInfo.Items) && InvoiceInfo.Items.length !==0){
76
+ // InvoiceInfo.Items.forEach((item: any) => {
77
+ // if (item.TCode === 106) {
78
+ // Total18perc=Total18perc+TrUtils.SetValueToZeroIfNull(item.UnAmt);
79
+ // CGST18 = CGST18 + TrUtils.SetValueToZeroIfNull(item.CGST);
80
+ // SGST18 = SGST18 + TrUtils.SetValueToZeroIfNull(item.SGST);
81
+ // Total18perctax=Total18perctax+Total18perc+CGST18+SGST18;
82
+ // } else if (item.TCode === 107) {
83
+ // Total28perc=Total28perc+TrUtils.SetValueToZeroIfNull(item.UnAmt);
84
+ // CGST28 = CGST28 + TrUtils.SetValueToZeroIfNull(item.CGST);
85
+ // SGST28 = SGST28 + TrUtils.SetValueToZeroIfNull(item.SGST);
86
+ // Total28perctax=Total28perctax+Total28perc+CGST28+SGST28;
87
+ // }
88
+ // });
89
+ // }
90
+ // InvoiceInfo.Total18perctax = TrUtils.FixPriceValue(Total18perctax);
91
+ // InvoiceInfo.Total28perctax = TrUtils.FixPriceValue(Total28perctax);
92
+ // InvoiceInfo.Total18perc = TrUtils.FixPriceValue(Total18perc);
93
+ // InvoiceInfo.Total28perc = TrUtils.FixPriceValue(Total28perc);
94
+ // InvoiceInfo.Items18CGST = TrUtils.FixPriceValue(CGST18);
95
+ // InvoiceInfo.Items18SGST = TrUtils.FixPriceValue(SGST18);
96
+ // InvoiceInfo.Items28CGST = TrUtils.FixPriceValue(CGST28);
97
+ // InvoiceInfo.Items28SGST = TrUtils.FixPriceValue(SGST28);
98
+ // InvoiceInfo.TotalCGST = TrUtils.FixPriceValue(CGST18+CGST28);
99
+ // InvoiceInfo.TotalSGST = TrUtils.FixPriceValue(SGST18+SGST28);
100
+ // InvoiceInfo.Items18GST = TrUtils.FixPriceValue(CGST18+SGST18);
101
+ // InvoiceInfo.Items28GST = TrUtils.FixPriceValue(CGST28+SGST28);
102
+ InvoiceInfo.GSTAmount =
103
+ InvoiceInfo.ItemsCGST + InvoiceInfo.ItemsSGST + InvoiceInfo.ItemsIGST;
104
+ InvoiceInfo.TotalAmount = InvoiceInfo.GSTAmount + InvoiceInfo.ItemsNetAmt;
105
+ InvoiceInfo.OpsGSTAmount =
106
+ InvoiceInfo.OpsCGST + InvoiceInfo.OpsSGST + InvoiceInfo.OpsIGST;
107
+ InvoiceInfo.TotalOpsAmount =
108
+ InvoiceInfo.OpsGSTAmount + InvoiceInfo.OpsNetAmt;
109
+ });
110
+ return MainData;
111
+ }
112
+ static GetWOTypeName(Type, WOTypes) {
113
+ let Index = WOTypes.findIndex((wotype) => {
114
+ return Type === wotype._id;
115
+ });
116
+ if (Index !== -1) {
117
+ return WOTypes[Index].Name;
118
+ }
119
+ else {
120
+ return '';
121
+ }
122
+ }
123
+ static setHeadingInCell() {
124
+ // let MainHeadings: any[] = [
125
+ // {
126
+ // text: 'GSTIN/UIN',
127
+ // ColRange: 1,
128
+ // bold: true,
129
+ // ChildHeadings: []
130
+ // },
131
+ // {
132
+ // text: 'Name',
133
+ // ColRange: 1,
134
+ // bold: true,
135
+ // ChildHeadings: []
136
+ // },
137
+ // {
138
+ // text: 'InvoiceInfo Details',
139
+ // ColRange: 4,
140
+ // bold: true,
141
+ // ChildHeadings: [
142
+ // { text: 'No', ColRange: 1 },
143
+ // { text: 'Date', ColRange: 1 },
144
+ // { text: 'InvoiceInfo Total', ColRange: 1 }
145
+ // ]
146
+ // },
147
+ // {
148
+ // text: 'Rate',
149
+ // ColRange: 1,
150
+ // bold: true,
151
+ // ChildHeadings: []
152
+ // },
153
+ // {
154
+ // text: 'Taxable Value',
155
+ // ColRange: 1,
156
+ // bold: true,
157
+ // ChildHeadings: []
158
+ // },
159
+ // {
160
+ // text: 'Amount',
161
+ // ColRange: 3,
162
+ // bold: true,
163
+ // ChildHeadings: [
164
+ // { text: 'Central Tax', ColRange: 1 },
165
+ // { text: 'State Tax', ColRange: 1 },
166
+ // { text: 'IGST Tax', ColRange: 1 },
167
+ // ]
168
+ // }
169
+ // ]
170
+ let MainHeadings = [
171
+ // {
172
+ // text: 'SNo',
173
+ // ColRange: 1,
174
+ // bold: true,
175
+ // ChildHeadings: []
176
+ // },
177
+ {
178
+ text: 'Date',
179
+ ColRange: 1,
180
+ bold: true,
181
+ ChildHeadings: [],
182
+ },
183
+ {
184
+ text: 'Invoice No',
185
+ ColRange: 1,
186
+ bold: true,
187
+ ChildHeadings: [
188
+ // { text: 'No', ColRange: 1 },
189
+ // { text: 'Date', ColRange: 1 },
190
+ // { text: 'InvoiceInfo Total', ColRange: 1 }
191
+ ],
192
+ },
193
+ {
194
+ text: 'RO No',
195
+ ColRange: 1,
196
+ bold: true,
197
+ ChildHeadings: [],
198
+ },
199
+ {
200
+ text: 'RO Date',
201
+ ColRange: 1,
202
+ bold: true,
203
+ ChildHeadings: [],
204
+ },
205
+ {
206
+ text: 'Customer',
207
+ ColRange: 1,
208
+ bold: true,
209
+ ChildHeadings: [
210
+ // { text: 'Central Tax', ColRange: 1 },
211
+ // { text: 'State Tax', ColRange: 1 },
212
+ // { text: 'IGST Tax', ColRange: 1 },
213
+ ],
214
+ },
215
+ {
216
+ text: 'Phone',
217
+ ColRange: 1,
218
+ bold: true,
219
+ ChildHeadings: [
220
+ // { text: 'Central Tax', ColRange: 1 },
221
+ // { text: 'State Tax', ColRange: 1 },
222
+ // { text: 'IGST Tax', ColRange: 1 },
223
+ ],
224
+ },
225
+ {
226
+ text: 'Chassis No',
227
+ ColRange: 1,
228
+ bold: true,
229
+ ChildHeadings: [
230
+ // { text: 'Central Tax', ColRange: 1 },
231
+ // { text: 'State Tax', ColRange: 1 },
232
+ // { text: 'IGST Tax', ColRange: 1 },
233
+ ],
234
+ },
235
+ {
236
+ text: 'Vehicle',
237
+ ColRange: 1,
238
+ bold: true,
239
+ ChildHeadings: [
240
+ // { text: 'Central Tax', ColRange: 1 },
241
+ // { text: 'State Tax', ColRange: 1 },
242
+ // { text: 'IGST Tax', ColRange: 1 },
243
+ ],
244
+ },
245
+ // {
246
+ // text: 'Color',
247
+ // ColRange: 1,
248
+ // bold: true,
249
+ // ChildHeadings: [
250
+ // // { text: 'Central Tax', ColRange: 1 },
251
+ // // { text: 'State Tax', ColRange: 1 },
252
+ // // { text: 'IGST Tax', ColRange: 1 },
253
+ // ]
254
+ // },
255
+ {
256
+ text: 'Year Of Model',
257
+ ColRange: 1,
258
+ bold: true,
259
+ ChildHeadings: [
260
+ // { text: 'Central Tax', ColRange: 1 },
261
+ // { text: 'State Tax', ColRange: 1 },
262
+ // { text: 'IGST Tax', ColRange: 1 },
263
+ ],
264
+ },
265
+ {
266
+ text: 'Reg. No',
267
+ ColRange: 1,
268
+ bold: true,
269
+ ChildHeadings: [
270
+ // { text: 'Central Tax', ColRange: 1 },
271
+ // { text: 'State Tax', ColRange: 1 },
272
+ // { text: 'IGST Tax', ColRange: 1 },
273
+ ],
274
+ },
275
+ {
276
+ text: 'Sale Date',
277
+ ColRange: 1,
278
+ bold: true,
279
+ ChildHeadings: [
280
+ // { text: 'Central Tax', ColRange: 1 },
281
+ // { text: 'State Tax', ColRange: 1 },
282
+ // { text: 'IGST Tax', ColRange: 1 },
283
+ ],
284
+ },
285
+ // {
286
+ // text: 'Supervisor',
287
+ // ColRange: 1,
288
+ // bold: true,
289
+ // ChildHeadings: [
290
+ // // { text: 'Central Tax', ColRange: 1 },
291
+ // // { text: 'State Tax', ColRange: 1 },
292
+ // // { text: 'IGST Tax', ColRange: 1 },
293
+ // ]
294
+ // },
295
+ {
296
+ text: 'Technician',
297
+ ColRange: 1,
298
+ bold: true,
299
+ ChildHeadings: [
300
+ // { text: 'Central Tax', ColRange: 1 },
301
+ // { text: 'State Tax', ColRange: 1 },
302
+ // { text: 'IGST Tax', ColRange: 1 },
303
+ ],
304
+ },
305
+ {
306
+ text: 'Service Advisor',
307
+ ColRange: 1,
308
+ bold: true,
309
+ ChildHeadings: [
310
+ // { text: 'Central Tax', ColRange: 1 },
311
+ // { text: 'State Tax', ColRange: 1 },
312
+ // { text: 'IGST Tax', ColRange: 1 },
313
+ ],
314
+ },
315
+ {
316
+ text: 'Service Type',
317
+ ColRange: 1,
318
+ bold: true,
319
+ ChildHeadings: [
320
+ // { text: 'Central Tax', ColRange: 1 },
321
+ // { text: 'State Tax', ColRange: 1 },
322
+ // { text: 'IGST Tax', ColRange: 1 },
323
+ ],
324
+ },
325
+ {
326
+ text: 'Meter Reading',
327
+ ColRange: 1,
328
+ bold: true,
329
+ ChildHeadings: [
330
+ // { text: 'Central Tax', ColRange: 1 },
331
+ // { text: 'State Tax', ColRange: 1 },
332
+ // { text: 'IGST Tax', ColRange: 1 },
333
+ ],
334
+ },
335
+ {
336
+ text: 'Quantity',
337
+ ColRange: 1,
338
+ bold: true,
339
+ ChildHeadings: [
340
+ // { text: 'Central Tax', ColRange: 1 },
341
+ // { text: 'State Tax', ColRange: 1 },
342
+ // { text: 'IGST Tax', ColRange: 1 },
343
+ ],
344
+ },
345
+ // {
346
+ // text: '18% Spares Amount before Tax',
347
+ // ColRange: 1,
348
+ // bold: true,
349
+ // ChildHeadings: [
350
+ // // { text: 'Central Tax', ColRange: 1 },
351
+ // // { text: 'State Tax', ColRange: 1 },
352
+ // // { text: 'IGST Tax', ColRange: 1 },
353
+ // ],
354
+ // },
355
+ // {
356
+ // text: '28% Spares Amount before Tax',
357
+ // ColRange: 1,
358
+ // bold: true,
359
+ // ChildHeadings: [
360
+ // // { text: 'Central Tax', ColRange: 1 },
361
+ // // { text: 'State Tax', ColRange: 1 },
362
+ // // { text: 'IGST Tax', ColRange: 1 },
363
+ // ],
364
+ // },
365
+ {
366
+ text: 'Spares Amount',
367
+ ColRange: 1,
368
+ bold: true,
369
+ ChildHeadings: [
370
+ // { text: 'Central Tax', ColRange: 1 },
371
+ // { text: 'State Tax', ColRange: 1 },
372
+ // { text: 'IGST Tax', ColRange: 1 },
373
+ ],
374
+ },
375
+ {
376
+ text: 'Spares Discount',
377
+ ColRange: 1,
378
+ bold: true,
379
+ ChildHeadings: [
380
+ // { text: 'Central Tax', ColRange: 1 },
381
+ // { text: 'State Tax', ColRange: 1 },
382
+ // { text: 'IGST Tax', ColRange: 1 },
383
+ ],
384
+ },
385
+ {
386
+ text: 'Spares After Discount',
387
+ ColRange: 1,
388
+ bold: true,
389
+ ChildHeadings: [
390
+ // { text: 'Central Tax', ColRange: 1 },
391
+ // { text: 'State Tax', ColRange: 1 },
392
+ // { text: 'IGST Tax', ColRange: 1 },
393
+ ],
394
+ },
395
+ // {
396
+ // text: '18% CGST',
397
+ // ColRange: 1,
398
+ // bold: true,
399
+ // ChildHeadings: [
400
+ // // { text: 'Central Tax', ColRange: 1 },
401
+ // // { text: 'State Tax', ColRange: 1 },
402
+ // // { text: 'IGST Tax', ColRange: 1 },
403
+ // ],
404
+ // },
405
+ // {
406
+ // text: '18% SGST',
407
+ // ColRange: 1,
408
+ // bold: true,
409
+ // ChildHeadings: [
410
+ // // { text: 'Central Tax', ColRange: 1 },
411
+ // // { text: 'State Tax', ColRange: 1 },
412
+ // // { text: 'IGST Tax', ColRange: 1 },
413
+ // ],
414
+ // },
415
+ // {
416
+ // text: '28% CGST',
417
+ // ColRange: 1,
418
+ // bold: true,
419
+ // ChildHeadings: [
420
+ // // { text: 'Central Tax', ColRange: 1 },
421
+ // // { text: 'State Tax', ColRange: 1 },
422
+ // // { text: 'IGST Tax', ColRange: 1 },
423
+ // ],
424
+ // },
425
+ // {
426
+ // text: '28% SGST',
427
+ // ColRange: 1,
428
+ // bold: true,
429
+ // ChildHeadings: [
430
+ // // { text: 'Central Tax', ColRange: 1 },
431
+ // // { text: 'State Tax', ColRange: 1 },
432
+ // // { text: 'IGST Tax', ColRange: 1 },
433
+ // ],
434
+ // },
435
+ // {
436
+ // text: 'Total CGST',
437
+ // ColRange: 1,
438
+ // bold: true,
439
+ // ChildHeadings: [
440
+ // // { text: 'Central Tax', ColRange: 1 },
441
+ // // { text: 'State Tax', ColRange: 1 },
442
+ // // { text: 'IGST Tax', ColRange: 1 },
443
+ // ],
444
+ // },
445
+ // {
446
+ // text: 'Total SGST',
447
+ // ColRange: 1,
448
+ // bold: true,
449
+ // ChildHeadings: [
450
+ // // { text: 'Central Tax', ColRange: 1 },
451
+ // // { text: 'State Tax', ColRange: 1 },
452
+ // // { text: 'IGST Tax', ColRange: 1 },
453
+ // ],
454
+ // },
455
+ // {
456
+ // text: '18% Spares Amount after Tax',
457
+ // ColRange: 1,
458
+ // bold: true,
459
+ // ChildHeadings: [
460
+ // // { text: 'Central Tax', ColRange: 1 },
461
+ // // { text: 'State Tax', ColRange: 1 },
462
+ // // { text: 'IGST Tax', ColRange: 1 },
463
+ // ],
464
+ // },
465
+ // {
466
+ // text: '28% Spares Amount after Tax',
467
+ // ColRange: 1,
468
+ // bold: true,
469
+ // ChildHeadings: [
470
+ // // { text: 'Central Tax', ColRange: 1 },
471
+ // // { text: 'State Tax', ColRange: 1 },
472
+ // // { text: 'IGST Tax', ColRange: 1 },
473
+ // ],
474
+ // },
475
+ {
476
+ text: 'CGST',
477
+ ColRange: 1,
478
+ bold: true,
479
+ ChildHeadings: [
480
+ // { text: 'Central Tax', ColRange: 1 },
481
+ // { text: 'State Tax', ColRange: 1 },
482
+ // { text: 'IGST Tax', ColRange: 1 },
483
+ ],
484
+ },
485
+ {
486
+ text: 'SGST',
487
+ ColRange: 1,
488
+ bold: true,
489
+ ChildHeadings: [
490
+ // { text: 'Central Tax', ColRange: 1 },
491
+ // { text: 'State Tax', ColRange: 1 },
492
+ // { text: 'IGST Tax', ColRange: 1 },
493
+ ],
494
+ },
495
+ {
496
+ text: 'IGST',
497
+ ColRange: 1,
498
+ bold: true,
499
+ ChildHeadings: [
500
+ // { text: 'Central Tax', ColRange: 1 },
501
+ // { text: 'State Tax', ColRange: 1 },
502
+ // { text: 'IGST Tax', ColRange: 1 },
503
+ ],
504
+ },
505
+ // {
506
+ // text: 'CESS',
507
+ // ColRange: 1,
508
+ // bold: true,
509
+ // ChildHeadings: [
510
+ // // { text: 'Central Tax', ColRange: 1 },
511
+ // // { text: 'State Tax', ColRange: 1 },
512
+ // // { text: 'IGST Tax', ColRange: 1 },
513
+ // ]
514
+ // },
515
+ {
516
+ text: 'GST Amount',
517
+ ColRange: 1,
518
+ bold: true,
519
+ ChildHeadings: [
520
+ // { text: 'Central Tax', ColRange: 1 },
521
+ // { text: 'State Tax', ColRange: 1 },
522
+ // { text: 'IGST Tax', ColRange: 1 },
523
+ ],
524
+ },
525
+ {
526
+ text: 'Total Spares Amount',
527
+ ColRange: 1,
528
+ bold: true,
529
+ ChildHeadings: [
530
+ // { text: 'Central Tax', ColRange: 1 },
531
+ // { text: 'State Tax', ColRange: 1 },
532
+ // { text: 'IGST Tax', ColRange: 1 },
533
+ ],
534
+ },
535
+ {
536
+ text: 'Labor Amount',
537
+ ColRange: 1,
538
+ bold: true,
539
+ ChildHeadings: [
540
+ // { text: 'Central Tax', ColRange: 1 },
541
+ // { text: 'State Tax', ColRange: 1 },
542
+ // { text: 'IGST Tax', ColRange: 1 },
543
+ ],
544
+ },
545
+ {
546
+ text: 'Labor Discount',
547
+ ColRange: 1,
548
+ bold: true,
549
+ ChildHeadings: [
550
+ // { text: 'Central Tax', ColRange: 1 },
551
+ // { text: 'State Tax', ColRange: 1 },
552
+ // { text: 'IGST Tax', ColRange: 1 },
553
+ ],
554
+ },
555
+ {
556
+ text: 'Labor After Discount',
557
+ ColRange: 1,
558
+ bold: true,
559
+ ChildHeadings: [
560
+ // { text: 'Central Tax', ColRange: 1 },
561
+ // { text: 'State Tax', ColRange: 1 },
562
+ // { text: 'IGST Tax', ColRange: 1 },
563
+ ],
564
+ },
565
+ {
566
+ text: 'Service CGST',
567
+ ColRange: 1,
568
+ bold: true,
569
+ ChildHeadings: [
570
+ // { text: 'Central Tax', ColRange: 1 },
571
+ // { text: 'State Tax', ColRange: 1 },
572
+ // { text: 'IGST Tax', ColRange: 1 },
573
+ ],
574
+ },
575
+ {
576
+ text: 'Service SGST',
577
+ ColRange: 1,
578
+ bold: true,
579
+ ChildHeadings: [
580
+ // { text: 'Central Tax', ColRange: 1 },
581
+ // { text: 'State Tax', ColRange: 1 },
582
+ // { text: 'IGST Tax', ColRange: 1 },
583
+ ],
584
+ },
585
+ {
586
+ text: 'Service IGST',
587
+ ColRange: 1,
588
+ bold: true,
589
+ ChildHeadings: [
590
+ // { text: 'Central Tax', ColRange: 1 },
591
+ // { text: 'State Tax', ColRange: 1 },
592
+ // { text: 'IGST Tax', ColRange: 1 },
593
+ ],
594
+ },
595
+ // {
596
+ // text: 'Service CESS',
597
+ // ColRange: 1,
598
+ // bold: true,
599
+ // ChildHeadings: [
600
+ // // { text: 'Central Tax', ColRange: 1 },
601
+ // // { text: 'State Tax', ColRange: 1 },
602
+ // // { text: 'IGST Tax', ColRange: 1 },
603
+ // ]
604
+ // },
605
+ {
606
+ text: 'Service GST Amount',
607
+ ColRange: 1,
608
+ bold: true,
609
+ ChildHeadings: [
610
+ // { text: 'Central Tax', ColRange: 1 },
611
+ // { text: 'State Tax', ColRange: 1 },
612
+ // { text: 'IGST Tax', ColRange: 1 },
613
+ ],
614
+ },
615
+ {
616
+ text: 'Total Labor Amount',
617
+ ColRange: 1,
618
+ bold: true,
619
+ ChildHeadings: [
620
+ // { text: 'Central Tax', ColRange: 1 },
621
+ // { text: 'State Tax', ColRange: 1 },
622
+ // { text: 'IGST Tax', ColRange: 1 },
623
+ ],
624
+ },
625
+ // {
626
+ // text: 'Bill Amount',
627
+ // ColRange: 1,
628
+ // bold: true,
629
+ // ChildHeadings: [
630
+ // // { text: 'Central Tax', ColRange: 1 },
631
+ // // { text: 'State Tax', ColRange: 1 },
632
+ // // { text: 'IGST Tax', ColRange: 1 },
633
+ // ]
634
+ // }, {
635
+ // text: 'Discount Amount',
636
+ // ColRange: 1,
637
+ // bold: true,
638
+ // ChildHeadings: [
639
+ // // { text: 'Central Tax', ColRange: 1 },
640
+ // // { text: 'State Tax', ColRange: 1 },
641
+ // // { text: 'IGST Tax', ColRange: 1 },
642
+ // ]
643
+ // },
644
+ // {
645
+ // text: 'Total Bill Amount',
646
+ // ColRange: 1,
647
+ // bold: true,
648
+ // ChildHeadings: [
649
+ // // { text: 'Central Tax', ColRange: 1 },
650
+ // // { text: 'State Tax', ColRange: 1 },
651
+ // // { text: 'IGST Tax', ColRange: 1 },
652
+ // ]
653
+ // },
654
+ // {
655
+ // text: 'Insurance Amount',
656
+ // ColRange: 1,
657
+ // bold: true,
658
+ // ChildHeadings: [
659
+ // // { text: 'Central Tax', ColRange: 1 },
660
+ // // { text: 'State Tax', ColRange: 1 },
661
+ // // { text: 'IGST Tax', ColRange: 1 },
662
+ // ]
663
+ // }, {
664
+ // text: 'Charges',
665
+ // ColRange: 1,
666
+ // bold: true,
667
+ // ChildHeadings: [
668
+ // // { text: 'Central Tax', ColRange: 1 },
669
+ // // { text: 'State Tax', ColRange: 1 },
670
+ // // { text: 'IGST Tax', ColRange: 1 },
671
+ // ]
672
+ // }, {
673
+ // text: 'Deductions',
674
+ // ColRange: 1,
675
+ // bold: true,
676
+ // ChildHeadings: [
677
+ // // { text: 'Central Tax', ColRange: 1 },
678
+ // // { text: 'State Tax', ColRange: 1 },
679
+ // // { text: 'IGST Tax', ColRange: 1 },
680
+ // ]
681
+ // }, {
682
+ // text: 'Round Off Amount',
683
+ // ColRange: 1,
684
+ // bold: true,
685
+ // ChildHeadings: [
686
+ // // { text: 'Central Tax', ColRange: 1 },
687
+ // // { text: 'State Tax', ColRange: 1 },
688
+ // // { text: 'IGST Tax', ColRange: 1 },
689
+ // ]
690
+ // },
691
+ {
692
+ text: 'Total Value',
693
+ ColRange: 1,
694
+ bold: true,
695
+ ChildHeadings: [
696
+ // { text: 'Central Tax', ColRange: 1 },
697
+ // { text: 'State Tax', ColRange: 1 },
698
+ // { text: 'IGST Tax', ColRange: 1 },
699
+ ],
700
+ },
701
+ ];
702
+ let MainColStart = 0;
703
+ MainHeadings.forEach((MainHeader) => {
704
+ this.SetDataInCell(MainHeader.text, MainColStart, this.Row);
705
+ this.MergeArray.push({
706
+ s: { r: this.Row, c: MainColStart },
707
+ e: { r: this.Row, c: MainColStart + MainHeader.ColRange - 1 },
708
+ });
709
+ MainColStart += MainHeader.ColRange;
710
+ });
711
+ this.Row += 2;
712
+ }
713
+ static setInvoiceDetailsInCell(MainData) {
714
+ MainData.forEach((InvoiceList) => {
715
+ this.SetInvoiceDataInExcel(InvoiceList);
716
+ });
717
+ }
718
+ static SetInvoiceDataInExcel(InvoiceInfo) {
719
+ InvoiceInfo.CrDate = this.ConvertDateToReadableFormat(InvoiceInfo.CrDate);
720
+ InvoiceInfo.WCrDate = this.ConvertDateToReadableFormat(InvoiceInfo.WCrDate);
721
+ InvoiceInfo.ProdDDate = this.ConvertDateToReadableFormat(InvoiceInfo.ProdDDate);
722
+ let InvoiceData = [
723
+ { text: InvoiceInfo.CrDate, ColRange: 1, IsString: true },
724
+ { text: InvoiceInfo.Code, ColRange: 1, IsString: true },
725
+ { text: InvoiceInfo.WCrDate, ColRange: 1, IsString: true },
726
+ { text: InvoiceInfo.WCode, ColRange: 1, IsString: true },
727
+ { text: InvoiceInfo.CustName, ColRange: 1, IsString: true },
728
+ { text: InvoiceInfo.CustPh, ColRange: 1, IsString: true },
729
+ { text: InvoiceInfo.VIN, ColRange: 1, IsString: false },
730
+ { text: InvoiceInfo.Model, ColRange: 1, IsString: false },
731
+ { text: InvoiceInfo.Year, ColRange: 1, IsString: false },
732
+ { text: InvoiceInfo.RegNo, ColRange: 1, IsString: false },
733
+ { text: InvoiceInfo.ProdDDate, ColRange: 1, IsString: false },
734
+ { text: InvoiceInfo.TeNa, ColRange: 1, IsString: false },
735
+ { text: InvoiceInfo.Name, ColRange: 1, IsString: false },
736
+ { text: InvoiceInfo.TypeName, ColRange: 1, IsString: false },
737
+ { text: InvoiceInfo.MOut, ColRange: 1, IsString: false },
738
+ { text: InvoiceInfo.ItemsQty, ColRange: 1, IsString: false },
739
+ // { text: InvoiceInfo.Total18perc, ColRange: 1, IsString: false },
740
+ // { text: InvoiceInfo.Total28perc, ColRange: 1, IsString: false },
741
+ { text: InvoiceInfo.ItemsUnAmt, ColRange: 1, IsString: false },
742
+ { text: InvoiceInfo.ItemsDisc, ColRange: 1, IsString: false },
743
+ { text: InvoiceInfo.ItemsNetAmt, ColRange: 1, IsString: false },
744
+ // { text: InvoiceInfo.Items18CGST, ColRange: 1, IsString: false },
745
+ // { text: InvoiceInfo.Items18SGST, ColRange: 1, IsString: false },
746
+ // { text: InvoiceInfo.Items28CGST, ColRange: 1, IsString: false },
747
+ // { text: InvoiceInfo.Items28SGST, ColRange: 1, IsString: false },
748
+ // { text: InvoiceInfo.TotalCGST, ColRange: 1, IsString: false },
749
+ // { text: InvoiceInfo.TotalSGST, ColRange: 1, IsString: false },
750
+ // { text: InvoiceInfo.Total18perctax, ColRange: 1, IsString: false },
751
+ // { text: InvoiceInfo.Total28perctax, ColRange: 1, IsString: false },
752
+ { text: InvoiceInfo.ItemsCGST, ColRange: 1, IsString: false },
753
+ { text: InvoiceInfo.ItemsSGST, ColRange: 1, IsString: false },
754
+ { text: InvoiceInfo.ItemsIGST, ColRange: 1, IsString: false },
755
+ { text: InvoiceInfo.GSTAmount, ColRange: 1, IsString: false },
756
+ { text: InvoiceInfo.TotalAmount, ColRange: 1, IsString: false },
757
+ { text: InvoiceInfo.OpsPr, ColRange: 1, IsString: false },
758
+ { text: InvoiceInfo.OpsDisc, ColRange: 1, IsString: false },
759
+ { text: InvoiceInfo.OpsNetAmt, ColRange: 1, IsString: false },
760
+ { text: InvoiceInfo.OpsCGST, ColRange: 1, IsString: false },
761
+ { text: InvoiceInfo.OpsSGST, ColRange: 1, IsString: false },
762
+ { text: InvoiceInfo.OpsIGST, ColRange: 1, IsString: false },
763
+ { text: InvoiceInfo.OpsGSTAmount, ColRange: 1, IsString: false },
764
+ { text: InvoiceInfo.TotalOpsAmount, ColRange: 1, IsString: false },
765
+ // { text: InvoiceInfo.SubTotal, ColRange: 1, IsString: false },
766
+ { text: InvoiceInfo.Total, ColRange: 1, IsString: false },
767
+ ];
768
+ let ColStart = 0;
769
+ InvoiceData.forEach((InvData) => {
770
+ InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
771
+ this.SetDataInCell(InvData.text, ColStart, this.Row);
772
+ this.MergeArray.push({
773
+ s: { r: this.Row, c: ColStart },
774
+ e: { r: this.Row, c: ColStart + InvData.ColRange - 1 },
775
+ });
776
+ ColStart += InvData.ColRange;
777
+ });
778
+ this.Row += 1;
779
+ }
780
+ static ConvertToString(Text, IsString) {
781
+ if (IsString) {
782
+ if (Text == null) {
783
+ Text = '';
784
+ }
785
+ }
786
+ else {
787
+ if (Text == null) {
788
+ Text = 0;
789
+ }
790
+ }
791
+ if (typeof Text === 'number') {
792
+ return Number(tr_utils_1.TrUtils.FixedTo(Text));
793
+ }
794
+ else {
795
+ return Text;
796
+ }
797
+ }
798
+ static SetDataInCell(Data, ColRange, RowNum) {
799
+ var cell = { v: Data };
800
+ var cell_ref = XLSX.utils.encode_cell({ c: ColRange, r: RowNum });
801
+ if (this.range.e.c < ColRange) {
802
+ this.range.e.c = ColRange;
803
+ }
804
+ if (this.range.e.r < RowNum) {
805
+ this.range.e.r = RowNum;
806
+ }
807
+ cell = this.getcelltype(cell);
808
+ this.ws[cell_ref] = cell;
809
+ }
810
+ static getcelltype(cell) {
811
+ if (typeof cell.v === 'number')
812
+ cell.t = 'n';
813
+ else if (typeof cell.v === 'boolean')
814
+ cell.t = 'b';
815
+ else
816
+ cell.t = 's';
817
+ return cell;
818
+ }
819
+ static ConvertDateToReadableFormat(DateObject) {
820
+ if (!tr_utils_1.TrUtils.IsEmpty(DateObject)) {
821
+ let date = new Date(DateObject);
822
+ let Month;
823
+ let Day;
824
+ let MonthName = new Array();
825
+ MonthName[0] = 'Jan';
826
+ MonthName[1] = 'Feb';
827
+ MonthName[2] = 'Mar';
828
+ MonthName[3] = 'Apr';
829
+ MonthName[4] = 'May';
830
+ MonthName[5] = 'Jun';
831
+ MonthName[6] = 'Jul';
832
+ MonthName[7] = 'Aug';
833
+ MonthName[8] = 'Sept';
834
+ MonthName[9] = 'Oct';
835
+ MonthName[10] = 'Nov';
836
+ MonthName[11] = 'Dec';
837
+ Month = MonthName[date.getMonth()];
838
+ if (date.getDate() < 10) {
839
+ Day = '0' + date.getDate();
840
+ }
841
+ else {
842
+ Day = date.getDate();
843
+ }
844
+ date = Day + '-' + Month + '-' + date.getFullYear();
845
+ return date;
846
+ }
847
+ else {
848
+ return null;
849
+ }
850
+ }
851
+ }
852
+ exports.InvoicesWiseXlsxFileService = InvoicesWiseXlsxFileService;
853
+ InvoicesWiseXlsxFileService.wb = {};
854
+ InvoicesWiseXlsxFileService.Row = 2;
855
+ InvoicesWiseXlsxFileService.MergeArray = [];
856
+ InvoicesWiseXlsxFileService.range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
857
+ InvoicesWiseXlsxFileService.ws = {};