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