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.
Files changed (212) hide show
  1. package/README.md +1 -0
  2. package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
  3. package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
  4. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
  5. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
  6. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
  7. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
  8. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
  9. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
  10. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
  11. package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
  12. package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
  13. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
  14. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
  15. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
  16. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
  17. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
  18. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
  19. package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
  20. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
  21. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
  22. package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
  23. package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
  24. package/dist/gst/excel/GSTR1-excel.service.js +17 -7
  25. package/dist/gst/excel/GSTR2-excel.service.js +17 -7
  26. package/dist/gst/excel/hsn-summary.js +17 -7
  27. package/dist/gst/excel/tally-sales-import.service.js +17 -7
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +6 -6
  30. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
  31. package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
  32. package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
  33. package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
  34. package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
  35. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
  36. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
  37. package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
  38. package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
  39. package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
  40. package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
  41. package/dist/shared/table-section/pdf-table.header.js +14 -2
  42. package/dist/shared/table-section/pdf-table.section.js +6 -13
  43. package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +15 -15
  44. package/package.json +1 -1
  45. package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
  46. package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
  47. package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
  48. package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
  49. package/src/accounting/credit-note/cn-print.service.ts +264 -0
  50. package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
  51. package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
  52. package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
  53. package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
  54. package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
  55. package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
  56. package/src/accounting/invoice/inv-pdf.service.ts +812 -0
  57. package/src/accounting/invoice/inv-print.service.ts +532 -0
  58. package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
  59. package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
  60. package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
  61. package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
  62. package/src/accounting/invoice/invoice-print.service.ts +2906 -0
  63. package/src/accounting/invoice/invoice-total.service.ts +834 -0
  64. package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
  65. package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
  66. package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
  67. package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
  68. package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
  69. package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
  70. package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
  71. package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
  72. package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
  73. package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
  74. package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
  75. package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
  76. package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
  77. package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
  78. package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
  79. package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
  80. package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
  81. package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
  82. package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
  83. package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
  84. package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
  85. package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
  86. package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
  87. package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
  88. package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
  89. package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
  90. package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
  91. package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
  92. package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
  93. package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
  94. package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
  95. package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
  96. package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
  97. package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
  98. package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
  99. package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
  100. package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
  101. package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
  102. package/src/aggregation/aggregation.ts +58 -0
  103. package/src/appointments/appointments/appointment-total.service.ts +298 -0
  104. package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
  105. package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
  106. package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
  107. package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
  108. package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
  109. package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
  110. package/src/enums/cache-enums.ts +33 -0
  111. package/src/enums/code-enums.ts +291 -0
  112. package/src/enums/country-enums.ts +9 -0
  113. package/src/enums/enums.ts +364 -0
  114. package/src/enums/industry-enums.ts +26 -0
  115. package/src/enums/treatment-enums.ts +9 -0
  116. package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
  117. package/src/gst/excel/GSTR1-excel.service.ts +313 -0
  118. package/src/gst/excel/GSTR2-excel.service.ts +314 -0
  119. package/src/gst/excel/hsn-summary.ts +314 -0
  120. package/src/gst/excel/tally-sales-import.service.ts +767 -0
  121. package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
  122. package/src/index.ts +194 -0
  123. package/src/inventory/items/adjustment-pdf.service.ts +177 -0
  124. package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
  125. package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
  126. package/src/inventory/items/item-detais-pdf.ts +141 -0
  127. package/src/inventory/items/item-price-for-pricelist.ts +368 -0
  128. package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
  129. package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
  130. package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
  131. package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
  132. package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
  133. package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
  134. package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
  135. package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
  136. package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
  137. package/src/inventory/material-out/mout-pdf.service.ts +545 -0
  138. package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
  139. package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
  140. package/src/purchases/bills/bill-pdf.service.ts +21 -0
  141. package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
  142. package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
  143. package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
  144. package/src/purchases/purchase-order/po-totals.service.ts +343 -0
  145. package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
  146. package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
  147. package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
  148. package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
  149. package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
  150. package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
  151. package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
  152. package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
  153. package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
  154. package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
  155. package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
  156. package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
  157. package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
  158. package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
  159. package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
  160. package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
  161. package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
  162. package/src/sales/sales/pack-ship-print.service.ts +198 -0
  163. package/src/sales/sales/sales-pdf.service.ts +658 -0
  164. package/src/sales/sales/sales-print.service.ts +376 -0
  165. package/src/sales/sales/sales-totals.service.ts +500 -0
  166. package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
  167. package/src/sales-receive/sales-receive-print.service.ts +242 -0
  168. package/src/sales-receive/sales-receive-totals.service.ts +651 -0
  169. package/src/services/checklist-pdf.ts +151 -0
  170. package/src/services/checklists-pdf.ts +133 -0
  171. package/src/services/est.print-service.ts +1155 -0
  172. package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
  173. package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
  174. package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
  175. package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
  176. package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
  177. package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
  178. package/src/services/ro-pdf.service.ts +1917 -0
  179. package/src/services/ro-print-service.ts +881 -0
  180. package/src/services/ro-totals.service.ts +1314 -0
  181. package/src/services/separate-wo-print.service.ts +396 -0
  182. package/src/services/service-history-pdf.service.ts +145 -0
  183. package/src/services/service-price-for-pricelist.ts +649 -0
  184. package/src/services/technician-pdf.service.ts +234 -0
  185. package/src/services/technician-print.service.ts +95 -0
  186. package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
  187. package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
  188. package/src/shared/math-operations.ts +208 -0
  189. package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
  190. package/src/shared/shared-pdf.service.ts +3042 -0
  191. package/src/shared/shared-print.service.ts +879 -0
  192. package/src/shared/table-section/pdf-table.config.ts +8 -0
  193. package/src/shared/table-section/pdf-table.header.ts +396 -0
  194. package/src/shared/table-section/pdf-table.row.ts +248 -0
  195. package/src/shared/table-section/pdf-table.section.ts +447 -0
  196. package/src/shared/totals-section/pdf-totals.section.ts +921 -0
  197. package/src/shared/transactions-pdf.service.ts +191 -0
  198. package/src/shared/util.ts +101 -0
  199. package/src/tasks/meetings/meeting-pdf.ts +410 -0
  200. package/src/tasks/tasks/task-pdf.service.ts +238 -0
  201. package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
  202. package/src/tax/index.ts +86 -0
  203. package/src/tax/tax-calculator.ts +1025 -0
  204. package/src/tax/tax.types.ts +535 -0
  205. package/src/transaction-calculations/discounts-distribution.ts +343 -0
  206. package/src/transaction-calculations/index.ts +3 -0
  207. package/src/transaction-calculations/total-calculation.ts +443 -0
  208. package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
  209. package/src/utils/my-date.ts +111 -0
  210. package/src/utils/tr-utils.ts +104 -0
  211. package/tsconfig.json +2 -2
  212. /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
@@ -0,0 +1,494 @@
1
+
2
+ import * as XLSX from 'xlsx';
3
+ import { TrUtils } from '../../../../utils/tr-utils';
4
+
5
+ export class IssueSparesXlsxFileService {
6
+
7
+
8
+
9
+ static wb: any = {};
10
+ static Row: any = 2;
11
+ static MergeArray: any[] = [];
12
+ static range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
13
+
14
+ static ws: any = {};
15
+
16
+ static GetInvoiceWiseExcelData(MainData: any, WOTypes: any, EntitySettings: any) {
17
+ this.wb={};
18
+ this.ws = {};
19
+ this.Row=0;
20
+ this.range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
21
+ this.MergeArray=[];
22
+ let ws_name = 'Spares Issue';
23
+ this.wb.Sheets = {};
24
+ this.wb.Props = {};
25
+ this.wb.SSF = {};
26
+ this.wb.SheetNames = [];
27
+
28
+ MainData = this.GetTotals(MainData, WOTypes);
29
+
30
+ this.setHeadingInCell();
31
+
32
+ this.setInvoiceDetailsInCell(MainData, EntitySettings.DecimalsNumber);
33
+
34
+ this.ws['!ref'] = XLSX.utils.encode_range(this.range);
35
+
36
+ this.ws['!merges'] = this.MergeArray;
37
+ this.ws["!cols"] = [{wch: 15},{wch: 15},{wch: 20},{wch: 20},{wch: 10},{wch: 15},{wch: 20},{wch: 20},{wch: 10},{wch: 50},{wch: 40}];
38
+
39
+ this.wb.SheetNames.push(ws_name);
40
+
41
+ this.wb.Sheets[ws_name] = this.ws;
42
+
43
+ return this.wb;
44
+ }
45
+
46
+
47
+
48
+ static GetTotals(MainData: any, WOTypes: any) {
49
+ MainData.forEach((InvoiceInfo: any) => {
50
+ if (InvoiceInfo.VIN == null) {
51
+ InvoiceInfo.VIN = '';
52
+ }
53
+ if (InvoiceInfo.Name == null) {
54
+ InvoiceInfo.Name = '';
55
+ }
56
+ if (InvoiceInfo.TeNa == null) {
57
+ InvoiceInfo.TeNa = '';
58
+ }
59
+ // if (InvoiceInfo.Type == null) {
60
+ // InvoiceInfo.TypeName = '';
61
+ // } else {
62
+ // InvoiceInfo.TypeName = this.GetWOTypeName(InvoiceInfo.Type, WOTypes);
63
+ // }
64
+ // InvoiceInfo.GSTAmount =
65
+ // InvoiceInfo.ItemsCGST + InvoiceInfo.ItemsSGST + InvoiceInfo.ItemsIGST;
66
+ // InvoiceInfo.TotalAmount = InvoiceInfo.GSTAmount + InvoiceInfo.ItemsNetAmt;
67
+
68
+ // InvoiceInfo.OpsGSTAmount =
69
+ // InvoiceInfo.OpsCGST + InvoiceInfo.OpsSGST + InvoiceInfo.OpsIGST;
70
+ // InvoiceInfo.TotalOpsAmount =
71
+ // InvoiceInfo.OpsGSTAmount + InvoiceInfo.OpsNetAmt;
72
+ });
73
+ return MainData;
74
+ }
75
+
76
+ static GetWOTypeName(Type: any, WOTypes: any) {
77
+ let Index: any = WOTypes.findIndex((wotype: any) => {
78
+ return Type === wotype._id;
79
+ });
80
+ if (Index !== -1) {
81
+ return WOTypes[Index].Name;
82
+ } else {
83
+ return '';
84
+ }
85
+ }
86
+
87
+ static setHeadingInCell() {
88
+ // let MainHeadings: any[] = [
89
+ // {
90
+ // text: 'GSTIN/UIN',
91
+ // ColRange: 1,
92
+ // bold: true,
93
+ // ChildHeadings: []
94
+ // },
95
+ // {
96
+ // text: 'Name',
97
+ // ColRange: 1,
98
+ // bold: true,
99
+ // ChildHeadings: []
100
+ // },
101
+ // {
102
+ // text: 'Invoice Details',
103
+ // ColRange: 4,
104
+ // bold: true,
105
+ // ChildHeadings: [
106
+ // { text: 'No', ColRange: 1 },
107
+ // { text: 'Date', ColRange: 1 },
108
+ // { text: 'Invoice Total', ColRange: 1 }
109
+ // ]
110
+ // },
111
+ // {
112
+ // text: 'Rate',
113
+ // ColRange: 1,
114
+ // bold: true,
115
+ // ChildHeadings: []
116
+ // },
117
+ // {
118
+ // text: 'Taxable Value',
119
+ // ColRange: 1,
120
+ // bold: true,
121
+ // ChildHeadings: []
122
+ // },
123
+ // {
124
+ // text: 'Amount',
125
+ // ColRange: 3,
126
+ // bold: true,
127
+ // ChildHeadings: [
128
+ // { text: 'Central Tax', ColRange: 1 },
129
+ // { text: 'State Tax', ColRange: 1 },
130
+ // { text: 'IGST Tax', ColRange: 1 },
131
+ // ]
132
+ // }
133
+ // ]
134
+ let MainHeadings: any[] = [
135
+
136
+ // {
137
+ // text: 'Date',
138
+ // ColRange: 1,
139
+ // bold: true,
140
+ // ChildHeadings: [],
141
+ // },
142
+ // {
143
+ // text: 'Invoice No',
144
+ // ColRange: 1,
145
+ // bold: true
146
+ // },
147
+ {
148
+ text: 'Date',
149
+ ColRange: 1,
150
+ bold: true,
151
+ ChildHeadings: [],
152
+ },
153
+ {
154
+ text: 'RO No',
155
+ ColRange: 1,
156
+ bold: true,
157
+ ChildHeadings: [],
158
+ },
159
+
160
+ // {
161
+ // text: 'Customer',
162
+ // ColRange: 1,
163
+ // bold: true,
164
+ // ChildHeadings: [
165
+ // // { text: 'Central Tax', ColRange: 1 },
166
+ // // { text: 'State Tax', ColRange: 1 },
167
+ // // { text: 'IGST Tax', ColRange: 1 },
168
+ // ],
169
+ // },
170
+ {
171
+ text: 'Chassis No',
172
+ ColRange: 1,
173
+ bold: true,
174
+ ChildHeadings: [
175
+ // { text: 'Central Tax', ColRange: 1 },
176
+ // { text: 'State Tax', ColRange: 1 },
177
+ // { text: 'IGST Tax', ColRange: 1 },
178
+ ],
179
+ },
180
+ {
181
+ text: 'Vehicle',
182
+ ColRange: 1,
183
+ bold: true,
184
+ ChildHeadings: [
185
+ // { text: 'Central Tax', ColRange: 1 },
186
+ // { text: 'State Tax', ColRange: 1 },
187
+ // { text: 'IGST Tax', ColRange: 1 },
188
+ ],
189
+ },
190
+ // {
191
+ // text: 'Color',
192
+ // ColRange: 1,
193
+ // bold: true,
194
+ // ChildHeadings: [
195
+ // // { text: 'Central Tax', ColRange: 1 },
196
+ // // { text: 'State Tax', ColRange: 1 },
197
+ // // { text: 'IGST Tax', ColRange: 1 },
198
+ // ]
199
+ // },
200
+ {
201
+ text: 'Year Of Model',
202
+ ColRange: 1,
203
+ bold: true,
204
+ ChildHeadings: [
205
+ // { text: 'Central Tax', ColRange: 1 },
206
+ // { text: 'State Tax', ColRange: 1 },
207
+ // { text: 'IGST Tax', ColRange: 1 },
208
+ ],
209
+ },
210
+ {
211
+ text: 'Reg. No',
212
+ ColRange: 1,
213
+ bold: true,
214
+ ChildHeadings: [
215
+ // { text: 'Central Tax', ColRange: 1 },
216
+ // { text: 'State Tax', ColRange: 1 },
217
+ // { text: 'IGST Tax', ColRange: 1 },
218
+ ],
219
+ },
220
+ // {
221
+ // text: 'Supervisor',
222
+ // ColRange: 1,
223
+ // bold: true,
224
+ // ChildHeadings: [
225
+ // // { text: 'Central Tax', ColRange: 1 },
226
+ // // { text: 'State Tax', ColRange: 1 },
227
+ // // { text: 'IGST Tax', ColRange: 1 },
228
+ // ]
229
+ // },
230
+
231
+ {
232
+ text: 'Service Advisor',
233
+ ColRange: 1,
234
+ bold: true,
235
+ ChildHeadings: [
236
+ // { text: 'Central Tax', ColRange: 1 },
237
+ // { text: 'State Tax', ColRange: 1 },
238
+ // { text: 'IGST Tax', ColRange: 1 },
239
+ ],
240
+ },
241
+ {
242
+ text: 'Service Type',
243
+ ColRange: 1,
244
+ bold: true,
245
+ ChildHeadings: [
246
+ // { text: 'Central Tax', ColRange: 1 },
247
+ // { text: 'State Tax', ColRange: 1 },
248
+ // { text: 'IGST Tax', ColRange: 1 },
249
+ ],
250
+ },
251
+ {
252
+ text: 'Meter Reading',
253
+ ColRange: 1,
254
+ bold: true,
255
+ ChildHeadings: [
256
+ // { text: 'Central Tax', ColRange: 1 },
257
+ // { text: 'State Tax', ColRange: 1 },
258
+ // { text: 'IGST Tax', ColRange: 1 },
259
+ ],
260
+ },
261
+ {
262
+ text: 'Product',
263
+ ColRange: 1,
264
+ bold: true,
265
+ ChildHeadings: [
266
+ // { text: 'Central Tax', ColRange: 1 },
267
+ // { text: 'State Tax', ColRange: 1 },
268
+ // { text: 'IGST Tax', ColRange: 1 },
269
+ ],
270
+ },
271
+ {
272
+ text: 'Description',
273
+ ColRange: 1,
274
+ bold: true,
275
+ ChildHeadings: [
276
+ // { text: 'Central Tax', ColRange: 1 },
277
+ // { text: 'State Tax', ColRange: 1 },
278
+ // { text: 'IGST Tax', ColRange: 1 },
279
+ ],
280
+ },
281
+ {
282
+ text: 'Qty',
283
+ ColRange: 1,
284
+ bold: true,
285
+ ChildHeadings: [
286
+ // { text: 'Central Tax', ColRange: 1 },
287
+ // { text: 'State Tax', ColRange: 1 },
288
+ // { text: 'IGST Tax', ColRange: 1 },
289
+ ],
290
+ },
291
+ {
292
+ text: 'UoM',
293
+ ColRange: 1,
294
+ bold: true,
295
+ ChildHeadings: [
296
+ // { text: 'Central Tax', ColRange: 1 },
297
+ // { text: 'State Tax', ColRange: 1 },
298
+ // { text: 'IGST Tax', ColRange: 1 },
299
+ ],
300
+ },
301
+
302
+ {
303
+ text: 'Unit Price',
304
+ ColRange: 1,
305
+ bold: true,
306
+ ChildHeadings: [
307
+ // { text: 'Central Tax', ColRange: 1 },
308
+ // { text: 'State Tax', ColRange: 1 },
309
+ // { text: 'IGST Tax', ColRange: 1 },
310
+ ],
311
+ },
312
+ {
313
+ text: 'Gross Amount',
314
+ ColRange: 1,
315
+ bold: true,
316
+ ChildHeadings: [
317
+ // { text: 'Central Tax', ColRange: 1 },
318
+ // { text: 'State Tax', ColRange: 1 },
319
+ // { text: 'IGST Tax', ColRange: 1 },
320
+ ],
321
+ },
322
+ {
323
+ text: 'Technician',
324
+ ColRange: 1,
325
+ bold: true,
326
+ ChildHeadings: [
327
+ // { text: 'Central Tax', ColRange: 1 },
328
+ // { text: 'State Tax', ColRange: 1 },
329
+ // { text: 'IGST Tax', ColRange: 1 },
330
+ ],
331
+ },
332
+ ];
333
+ let MainColStart: any = 0;
334
+ MainHeadings.forEach((MainHeader: any) => {
335
+ this.SetDataInCell(MainHeader.text, MainColStart, this.Row);
336
+ this.MergeArray.push({
337
+ s: { r: this.Row, c: MainColStart },
338
+ e: { r: this.Row, c: MainColStart + MainHeader.ColRange - 1 },
339
+ });
340
+ MainColStart += MainHeader.ColRange;
341
+ });
342
+
343
+ this.Row += 2;
344
+ }
345
+
346
+ static setInvoiceDetailsInCell(MainData: any, DecimalsNumber: number) {
347
+ MainData.forEach((InvoiceList: any) => {
348
+ this.SetInvoiceDataInExcel(InvoiceList, DecimalsNumber);
349
+ });
350
+ }
351
+
352
+ static SetInvoiceDataInExcel(InvoiceInfo: any, DecimalsNumber: number) {
353
+ InvoiceInfo.CrDate = this.ConvertDateToReadableFormat(InvoiceInfo.CrDate);
354
+ InvoiceInfo.WCrDate = this.ConvertDateToReadableFormat(InvoiceInfo.WCrDate);
355
+ if(TrUtils.IsNull(InvoiceInfo.Prod)){
356
+ InvoiceInfo.Prod={};
357
+ }
358
+ if(TrUtils.IsNull(InvoiceInfo.WOType)){
359
+ InvoiceInfo.WOType={};
360
+ }
361
+ let Product:string='';
362
+ let Price:any=0;
363
+ let UnAmt:any=0;
364
+ if(!TrUtils.IsNull(InvoiceInfo.Parts)){
365
+ if(!TrUtils.IsNull(InvoiceInfo.Parts.MPN)){
366
+ Product= InvoiceInfo.Parts.MPN + ' - '+InvoiceInfo.Parts.Desc;
367
+ }else{
368
+ Product= InvoiceInfo.Parts.Desc;
369
+ }
370
+
371
+ if(!TrUtils.IsZero(InvoiceInfo.Parts.AssPr)){
372
+ Price=TrUtils.FixPriceValue(InvoiceInfo.Parts.AssPr, DecimalsNumber);
373
+ }else {
374
+ Price=TrUtils.FixPriceValue(InvoiceInfo.Parts.UnPr, DecimalsNumber);
375
+ }
376
+
377
+ if(!TrUtils.IsZero(InvoiceInfo.Parts.AssAmt)){
378
+ UnAmt= TrUtils.FixPriceValue(InvoiceInfo.Parts.AssAmt, DecimalsNumber);
379
+ } else {
380
+ UnAmt=TrUtils.FixPriceValue(InvoiceInfo.Parts.UnAmt, DecimalsNumber);
381
+ };
382
+
383
+ }
384
+ if(TrUtils.IsNull(InvoiceInfo.Parts)){
385
+ InvoiceInfo.Parts={};
386
+ }
387
+
388
+ let InvoiceData: any = [
389
+ // { text: InvoiceInfo.CrDate, ColRange: 1, IsString: true },
390
+ // { text: InvoiceInfo.Code, ColRange: 1, IsString: true },
391
+ { text: InvoiceInfo.CrDate, ColRange: 1, IsString: true },
392
+ { text: InvoiceInfo.Code, ColRange: 1, IsString: true },
393
+ // { text: InvoiceInfo.CustName, ColRange: 1, IsString: true },
394
+ { text: InvoiceInfo.Prod.VIN, ColRange: 1, IsString: false },
395
+ { text: InvoiceInfo.Prod.Model, ColRange: 1, IsString: false },
396
+ { text: InvoiceInfo.Prod.Year, ColRange: 1, IsString: false },
397
+ { text: InvoiceInfo.Prod.RegNo, ColRange: 1, IsString: false },
398
+ { text: InvoiceInfo.Name, ColRange: 1, IsString: false },
399
+ { text: InvoiceInfo.WOType.Name, ColRange: 1, IsString: false },
400
+ { text: InvoiceInfo.MIn, ColRange: 1, IsString: false },
401
+ { text: Product, ColRange: 1, IsString: false },
402
+ { text: InvoiceInfo.Parts.Desc, ColRange: 1, IsString: false },
403
+ { text: InvoiceInfo.Parts.Qty, ColRange: 1, IsString: false },
404
+ { text: InvoiceInfo.Parts.UoM, ColRange: 1, IsString: false },
405
+ { text: Price, ColRange: 1, IsString: false },
406
+ { text: UnAmt, ColRange: 1, IsString: false },
407
+ { text: InvoiceInfo.TeNa, ColRange: 1, IsString: false },
408
+ ];
409
+ let ColStart: any = 0;
410
+ InvoiceData.forEach((InvData: any) => {
411
+ InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
412
+ this.SetDataInCell(InvData.text, ColStart, this.Row);
413
+ this.MergeArray.push({
414
+ s: { r: this.Row, c: ColStart },
415
+ e: { r: this.Row, c: ColStart + InvData.ColRange - 1 },
416
+ });
417
+ ColStart += InvData.ColRange;
418
+ });
419
+
420
+ this.Row += 1;
421
+ }
422
+
423
+ static ConvertToString(Text: any, IsString: any, DecimalsNumber: number) {
424
+ if (IsString) {
425
+ if (Text == null) {
426
+ Text = '';
427
+ }
428
+ } else {
429
+ if (Text == null) {
430
+ Text = 0;
431
+ }
432
+ }
433
+ if (typeof Text === 'number') {
434
+ return Number(TrUtils.FixedTo(Text, DecimalsNumber));
435
+ } else {
436
+ return Text;
437
+ }
438
+ }
439
+
440
+ static SetDataInCell(Data: any, ColRange: number, RowNum: any) {
441
+ var cell = { v: Data };
442
+ var cell_ref = XLSX.utils.encode_cell({ c: ColRange, r: RowNum });
443
+ if (this.range.e.c < ColRange) {
444
+ this.range.e.c = ColRange;
445
+ }
446
+ if (this.range.e.r < RowNum) {
447
+ this.range.e.r = RowNum;
448
+ }
449
+ cell = this.getcelltype(cell);
450
+ this.ws[cell_ref] = cell;
451
+ }
452
+
453
+ static getcelltype(cell: any) {
454
+ if (typeof cell.v === 'number') cell.t = 'n';
455
+ else if (typeof cell.v === 'boolean') cell.t = 'b';
456
+ else cell.t = 's';
457
+ return cell;
458
+ }
459
+
460
+ static ConvertDateToReadableFormat(DateObject: any) {
461
+ if (!TrUtils.IsEmpty(DateObject)) {
462
+ let date: any = new Date(DateObject);
463
+ let Month: any;
464
+ let Day: any;
465
+
466
+ let MonthName = new Array();
467
+ MonthName[0] = 'Jan';
468
+ MonthName[1] = 'Feb';
469
+ MonthName[2] = 'Mar';
470
+ MonthName[3] = 'Apr';
471
+ MonthName[4] = 'May';
472
+ MonthName[5] = 'Jun';
473
+ MonthName[6] = 'Jul';
474
+ MonthName[7] = 'Aug';
475
+ MonthName[8] = 'Sept';
476
+ MonthName[9] = 'Oct';
477
+ MonthName[10] = 'Nov';
478
+ MonthName[11] = 'Dec';
479
+
480
+ Month = MonthName[date.getMonth()];
481
+
482
+ if (date.getDate() < 10) {
483
+ Day = '0' + date.getDate();
484
+ } else {
485
+ Day = date.getDate();
486
+ }
487
+
488
+ date = Day + '-' + Month + '-' + date.getFullYear();
489
+ return date;
490
+ } else {
491
+ return null;
492
+ }
493
+ }
494
+ }