shareneus 1.7.4 → 1.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +18 -45
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +17 -7
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +17 -7
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +17 -7
- package/dist/accounting/invoice/unified-invoice-pdf.service.d.ts +1 -1
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +17 -7
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +17 -7
- package/dist/common/reports/excel/product-without-owner-excel.service.js +17 -7
- package/dist/gst/excel/GSTR-RO-excel.service.js +17 -7
- package/dist/gst/excel/GSTR1-excel.service.js +17 -7
- package/dist/gst/excel/GSTR2-excel.service.js +17 -7
- package/dist/gst/excel/hsn-summary.js +17 -7
- package/dist/gst/excel/tally-sales-import.service.js +17 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +17 -7
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +17 -7
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +17 -7
- package/dist/inventory/items/reports/excel/stock-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +17 -7
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +17 -7
- package/dist/services/reports/excel/insurance-expire-excel.service.js +17 -7
- package/dist/services/reports/excel/next-service-date-excel.service.js +17 -7
- package/dist/services/reports/excel/repair-orders-excel.service.js +17 -7
- package/dist/shared/table-section/pdf-table.header.d.ts +1 -1
- package/dist/shared/table-section/pdf-table.header.js +14 -2
- package/dist/shared/table-section/pdf-table.section.js +6 -13
- package/dist/{accounting/invoice/invoice-pdf.service.js → shared/transactions-pdf.service.js} +15 -15
- package/package.json +1 -1
- package/src/accounting/counter-sales/auto-sales-receipt-pdf.service.ts +569 -0
- package/src/accounting/counter-sales/pos-receipt-pdf.ts +577 -0
- package/src/accounting/counter-sales/sales-receipt-pdf.service.ts +628 -0
- package/src/accounting/counter-sales/sales-receipt-print.service.ts +506 -0
- package/src/accounting/credit-note/cn-print.service.ts +264 -0
- package/src/accounting/credit-note/credit-note-pdf.service.ts +602 -0
- package/src/accounting/credit-note/credit-note-totals.service.ts +424 -0
- package/src/accounting/debit-note/debit-note-pdf.service.ts +681 -0
- package/src/accounting/debit-note/debit-note-print.service.ts +276 -0
- package/src/accounting/debit-note/debit-note-totals.service.ts +361 -0
- package/src/accounting/invoice/hc-inv-pdf.service.ts +880 -0
- package/src/accounting/invoice/inv-pdf.service.ts +812 -0
- package/src/accounting/invoice/inv-print.service.ts +532 -0
- package/src/accounting/invoice/invoice-landscape-pdf.service.ts +947 -0
- package/src/accounting/invoice/invoice-letterhead-pdf.service.ts +813 -0
- package/src/accounting/invoice/invoice-pdf/invoice-pdf.service.ts +359 -0
- package/src/accounting/invoice/invoice-portrait-pdf.ts +972 -0
- package/src/accounting/invoice/invoice-print.service.ts +2906 -0
- package/src/accounting/invoice/invoice-total.service.ts +834 -0
- package/src/accounting/invoice/reports/excel/analysis-excel.service.ts +291 -0
- package/src/accounting/invoice/reports/excel/category-wise-item-excel.service.ts +267 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-details.ts +321 -0
- package/src/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.ts +300 -0
- package/src/accounting/invoice/reports/excel/invoice-wise-excel.service.ts +859 -0
- package/src/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.ts +255 -0
- package/src/accounting/invoice/reports/excel/items-wise-sales-excel.service.ts +312 -0
- package/src/accounting/invoice/reports/excel/manf-wise-sales-excel.service.ts +273 -0
- package/src/accounting/invoice/reports/excel/operator-wise-details.ts +258 -0
- package/src/accounting/invoice/reports/excel/operator-wise-summary.ts +259 -0
- package/src/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.ts +230 -0
- package/src/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.ts +231 -0
- package/src/accounting/invoice/reports/excel/sale-summary-excel.service.ts +326 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-details-excel.service.ts +0 -0
- package/src/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.ts +432 -0
- package/src/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.ts +373 -0
- package/src/accounting/invoice/reports/excel/scheduled-drugs-excel.service.ts +372 -0
- package/src/accounting/invoice/reports/pdf/analysis-pdf.service.ts +113 -0
- package/src/accounting/invoice/reports/pdf/category-wise-item-pdf.service.ts +107 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.ts +125 -0
- package/src/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.ts +119 -0
- package/src/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.ts +180 -0
- package/src/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.ts +193 -0
- package/src/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.ts +188 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.ts +118 -0
- package/src/accounting/invoice/reports/pdf/operator-wise-summary-pdf.ts +116 -0
- package/src/accounting/invoice/reports/pdf/sales-by-service-pdf.service.ts +132 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.ts +191 -0
- package/src/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.ts +202 -0
- package/src/accounting/invoice/shared-inv-pdf.service.ts +787 -0
- package/src/accounting/invoice/unified-invoice-pdf.service.ts +937 -0
- package/src/accounting/payment-receive/payment-pdf.service.ts +410 -0
- package/src/accounting/payment-receive/payment-receipt-pdf/receipt-pdf.service.ts +470 -0
- package/src/accounting/payment-receive/receipt-print.service.ts +71 -0
- package/src/accounting/payment-receive/reports/excel/cust-balance-excel.service.ts +298 -0
- package/src/accounting/payment-receive/reports/excel/payment-receive-excel.service.ts +221 -0
- package/src/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.ts +182 -0
- package/src/accounting/payment-receive/reports/pdf/payment-report-pdf.service.ts +116 -0
- package/src/aggregation/aggregation.ts +58 -0
- package/src/appointments/appointments/appointment-total.service.ts +298 -0
- package/src/appointments/consultations/consultation-fee-receipt.service.ts +407 -0
- package/src/appointments/consultations/consultation-full-pdf.service.ts +238 -0
- package/src/appointments/consultations/consultation-letterhead-pdf.service.ts +430 -0
- package/src/appointments/consultations/consultation-pdf.service.ts +417 -0
- package/src/common/reports/excel/product-without-owner-excel.service.ts +308 -0
- package/src/common/reports/pdf/product-without-owner-pdf.service.ts +146 -0
- package/src/enums/cache-enums.ts +33 -0
- package/src/enums/code-enums.ts +291 -0
- package/src/enums/country-enums.ts +9 -0
- package/src/enums/enums.ts +364 -0
- package/src/enums/industry-enums.ts +26 -0
- package/src/enums/treatment-enums.ts +9 -0
- package/src/gst/excel/GSTR-RO-excel.service.ts +926 -0
- package/src/gst/excel/GSTR1-excel.service.ts +313 -0
- package/src/gst/excel/GSTR2-excel.service.ts +314 -0
- package/src/gst/excel/hsn-summary.ts +314 -0
- package/src/gst/excel/tally-sales-import.service.ts +767 -0
- package/src/gst/pdf/hsn-summary-pdf.ts +176 -0
- package/src/index.ts +194 -0
- package/src/inventory/items/adjustment-pdf.service.ts +177 -0
- package/src/inventory/items/issue-parts-pdf.service.ts +795 -0
- package/src/inventory/items/item-bar-code-label-pdf.ts +194 -0
- package/src/inventory/items/item-detais-pdf.ts +141 -0
- package/src/inventory/items/item-price-for-pricelist.ts +368 -0
- package/src/inventory/items/reports/excel/expiring-drugs-excel.service.ts +290 -0
- package/src/inventory/items/reports/excel/item-wise-mout-details.ts +284 -0
- package/src/inventory/items/reports/excel/item-wise-mout-summary.ts +279 -0
- package/src/inventory/items/reports/excel/spares-issue-excel.service.ts +494 -0
- package/src/inventory/items/reports/excel/stock-excel.service.ts +319 -0
- package/src/inventory/items/reports/pdf/expiring-drugs-pdf.service.ts +172 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-details-pdf.ts +122 -0
- package/src/inventory/items/reports/pdf/item-wise-mout-summary-pdf.ts +115 -0
- package/src/inventory/items/reports/pdf/reorder-point-pdf.service.ts +163 -0
- package/src/inventory/material-out/mout-pdf.service.ts +545 -0
- package/src/inventory/transfer-order/transfer-order-pdf.service.ts +154 -0
- package/src/purchases/bills/bill-pdf/bill-pdf.service.ts +211 -0
- package/src/purchases/bills/bill-pdf.service.ts +21 -0
- package/src/purchases/payment-made/reports/excel/payments-made-excel.service.ts +313 -0
- package/src/purchases/payment-made/reports/excel/ven-balance-excel.service.ts +307 -0
- package/src/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.ts +114 -0
- package/src/purchases/purchase-order/po-totals.service.ts +343 -0
- package/src/purchases/purchase-order/purchase-order-pdf.service.ts +1016 -0
- package/src/purchases/purchase-order/purchase-order-print.service.ts +279 -0
- package/src/purchases/purchase-order/purchase-order-totals.service.ts +637 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-pdf.service.ts +1055 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-print.service.ts +145 -0
- package/src/purchases/vendor-credit-note/vendor-credit-note-totals.service.ts +399 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-pdf.service.ts +582 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-print.service.ts +295 -0
- package/src/purchases/vendor-debit-note/vendor-debit-note-totals.service.ts +377 -0
- package/src/sales/delivery-challan/dc-landscape-pdf.service.ts +922 -0
- package/src/sales/delivery-challan/dc-landscape-without-price-pdf.service.ts +869 -0
- package/src/sales/delivery-challan/dc-without-price-pdf.service.ts +505 -0
- package/src/sales/delivery-challan/delivery-challan-pdf.service.ts +461 -0
- package/src/sales/delivery-challan/delivery-challan-print.service.ts +229 -0
- package/src/sales/delivery-challan/delivery-challan-totals.ts +466 -0
- package/src/sales/sales/equipment-design-pdf.service.ts +153 -0
- package/src/sales/sales/pack-ship-pdf.service.ts +128 -0
- package/src/sales/sales/pack-ship-print.service.ts +198 -0
- package/src/sales/sales/sales-pdf.service.ts +658 -0
- package/src/sales/sales/sales-print.service.ts +376 -0
- package/src/sales/sales/sales-totals.service.ts +500 -0
- package/src/sales-receive/sales-receive-pdf.service.ts +602 -0
- package/src/sales-receive/sales-receive-print.service.ts +242 -0
- package/src/sales-receive/sales-receive-totals.service.ts +651 -0
- package/src/services/checklist-pdf.ts +151 -0
- package/src/services/checklists-pdf.ts +133 -0
- package/src/services/est.print-service.ts +1155 -0
- package/src/services/reports/excel/insurance-expire-excel.service.ts +292 -0
- package/src/services/reports/excel/next-service-date-excel.service.ts +317 -0
- package/src/services/reports/excel/repair-orders-excel.service.ts +249 -0
- package/src/services/reports/pdf/insurance-expire-pdf.service.ts +115 -0
- package/src/services/reports/pdf/next-service-date-pdf.service.ts +198 -0
- package/src/services/reports/pdf/repair-orders-pdf.service.ts +184 -0
- package/src/services/ro-pdf.service.ts +1917 -0
- package/src/services/ro-print-service.ts +881 -0
- package/src/services/ro-totals.service.ts +1314 -0
- package/src/services/separate-wo-print.service.ts +396 -0
- package/src/services/service-history-pdf.service.ts +145 -0
- package/src/services/service-price-for-pricelist.ts +649 -0
- package/src/services/technician-pdf.service.ts +234 -0
- package/src/services/technician-print.service.ts +95 -0
- package/src/shared/header-footer-section/pdf-header-footer.section.ts +519 -0
- package/src/shared/header-footer-section/pdf-shared.utils.ts +46 -0
- package/src/shared/math-operations.ts +208 -0
- package/src/shared/party-details-section/pdf-party-details.section.ts +602 -0
- package/src/shared/shared-pdf.service.ts +3042 -0
- package/src/shared/shared-print.service.ts +879 -0
- package/src/shared/table-section/pdf-table.config.ts +8 -0
- package/src/shared/table-section/pdf-table.header.ts +396 -0
- package/src/shared/table-section/pdf-table.row.ts +248 -0
- package/src/shared/table-section/pdf-table.section.ts +447 -0
- package/src/shared/totals-section/pdf-totals.section.ts +921 -0
- package/src/shared/transactions-pdf.service.ts +191 -0
- package/src/shared/util.ts +101 -0
- package/src/tasks/meetings/meeting-pdf.ts +410 -0
- package/src/tasks/tasks/task-pdf.service.ts +238 -0
- package/src/tasks/tasks/task-reports-pdf.service.ts +313 -0
- package/src/tax/index.ts +86 -0
- package/src/tax/tax-calculator.ts +1025 -0
- package/src/tax/tax.types.ts +535 -0
- package/src/transaction-calculations/discounts-distribution.ts +343 -0
- package/src/transaction-calculations/index.ts +3 -0
- package/src/transaction-calculations/total-calculation.ts +443 -0
- package/src/transaction-calculations/transaction-calculation-engine.ts +903 -0
- package/src/utils/my-date.ts +111 -0
- package/src/utils/tr-utils.ts +104 -0
- package/tsconfig.json +2 -2
- /package/dist/{accounting/invoice/invoice-pdf.service.d.ts → shared/transactions-pdf.service.d.ts} +0 -0
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
|
|
2
|
+
import * as XLSX from 'xlsx';
|
|
3
|
+
import { MyDate } from '../../../utils/my-date';
|
|
4
|
+
import { TrUtils } from '../../../utils/tr-utils';
|
|
5
|
+
|
|
6
|
+
export class InsuranceExpireXlsxFileService {
|
|
7
|
+
static wb: any = {};
|
|
8
|
+
static Row: any = 2;
|
|
9
|
+
static MergeArray: any[] = [];
|
|
10
|
+
static range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
|
|
11
|
+
static ws: any = {};
|
|
12
|
+
|
|
13
|
+
static GetInsuranceExpireExcelData(MainData: any, searchValue: any, HeaderName: any, EntitySettings: any) {
|
|
14
|
+
this.wb = {};
|
|
15
|
+
this.ws = {};
|
|
16
|
+
this.Row = 0;
|
|
17
|
+
this.range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
|
|
18
|
+
this.MergeArray = [];
|
|
19
|
+
let ws_name = HeaderName;
|
|
20
|
+
this.wb.Sheets = {};
|
|
21
|
+
this.wb.Props = {};
|
|
22
|
+
this.wb.SSF = {};
|
|
23
|
+
this.wb.SheetNames = [];
|
|
24
|
+
|
|
25
|
+
// MainData = this.GetTotals(MainData);
|
|
26
|
+
let showSearch: any = [];
|
|
27
|
+
for (const key in searchValue) {
|
|
28
|
+
if (!TrUtils.IsNull(searchValue[key]) && key !== 'Date' && key !== 'DescCntrlId') {
|
|
29
|
+
showSearch.push([{
|
|
30
|
+
text: (key === 'StDate') ? 'Start Date' : (key === 'EnDate') ? 'End Date' : (key === 'DescCntrl') ? 'Item' : key,
|
|
31
|
+
ColRange: 1,
|
|
32
|
+
bold: true,
|
|
33
|
+
ChildHeadings: [
|
|
34
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
35
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
36
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
37
|
+
],
|
|
38
|
+
}, {
|
|
39
|
+
text: (key === 'StDate') ? MyDate.ConvertUTCDateToReadable(searchValue[key]) : (key === 'EnDate') ? MyDate.ConvertUTCDateToReadable(searchValue[key]) : searchValue[key],
|
|
40
|
+
ColRange: 7,
|
|
41
|
+
bold: true,
|
|
42
|
+
ChildHeadings: [
|
|
43
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
44
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
45
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
46
|
+
],
|
|
47
|
+
}]);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// console.log(`${key}: ${searchValue[key]}`);
|
|
51
|
+
}
|
|
52
|
+
this.setHeadingInCell(HeaderName, showSearch);
|
|
53
|
+
|
|
54
|
+
this.setInvoiceDetailsInCell(MainData, EntitySettings.DecimalsNumber);
|
|
55
|
+
|
|
56
|
+
this.ws['!ref'] = XLSX.utils.encode_range(this.range);
|
|
57
|
+
|
|
58
|
+
this.ws['!merges'] = this.MergeArray;
|
|
59
|
+
this.ws["!cols"] = [ { wch: 15 }, { wch: 15 }, { wch: 30 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },{ wch: 15 }, { wch: 20 }];
|
|
60
|
+
|
|
61
|
+
this.wb.SheetNames.push(ws_name);
|
|
62
|
+
|
|
63
|
+
this.wb.Sheets[ws_name] = this.ws;
|
|
64
|
+
|
|
65
|
+
return this.wb;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static setHeadingInCell(HeaderName: any, searchValue: any) {
|
|
69
|
+
|
|
70
|
+
let MainHeadings: any[] = [
|
|
71
|
+
// {
|
|
72
|
+
// text: 'Receipt No',
|
|
73
|
+
// ColRange: 1,
|
|
74
|
+
// bold: true,
|
|
75
|
+
// ChildHeadings: []
|
|
76
|
+
// },
|
|
77
|
+
{
|
|
78
|
+
text: 'Customer',
|
|
79
|
+
ColRange: 1,
|
|
80
|
+
bold: true,
|
|
81
|
+
ChildHeadings: []
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
text: 'Phone',
|
|
85
|
+
ColRange: 1,
|
|
86
|
+
bold: true,
|
|
87
|
+
ChildHeadings: [],
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
{
|
|
91
|
+
text: 'Vehicle',
|
|
92
|
+
ColRange: 1,
|
|
93
|
+
bold: true,
|
|
94
|
+
ChildHeadings: [
|
|
95
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
96
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
97
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
text: 'Registration #',
|
|
102
|
+
ColRange: 1,
|
|
103
|
+
bold: true,
|
|
104
|
+
ChildHeadings: [
|
|
105
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
106
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
107
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
text: 'VIN / Chasis',
|
|
112
|
+
ColRange: 1,
|
|
113
|
+
bold: true,
|
|
114
|
+
ChildHeadings: [
|
|
115
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
116
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
117
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
text: 'Insurance Company',
|
|
122
|
+
ColRange: 1,
|
|
123
|
+
bold: true,
|
|
124
|
+
ChildHeadings: [
|
|
125
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
126
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
127
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
text: 'Policy No',
|
|
132
|
+
ColRange: 1,
|
|
133
|
+
bold: true,
|
|
134
|
+
ChildHeadings: [
|
|
135
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
136
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
137
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
138
|
+
],
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
text: 'Expiry Date',
|
|
142
|
+
ColRange: 1,
|
|
143
|
+
bold: true,
|
|
144
|
+
ChildHeadings: [
|
|
145
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
146
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
147
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
148
|
+
],
|
|
149
|
+
},
|
|
150
|
+
// {
|
|
151
|
+
// text: 'Reason Name',
|
|
152
|
+
// ColRange: 1,
|
|
153
|
+
// bold: true,
|
|
154
|
+
// ChildHeadings: [
|
|
155
|
+
// // { text: 'Central Tax', ColRange: 1 },
|
|
156
|
+
// // { text: 'State Tax', ColRange: 1 },
|
|
157
|
+
// // { text: 'IGST Tax', ColRange: 1 },
|
|
158
|
+
// ],
|
|
159
|
+
// },
|
|
160
|
+
// {
|
|
161
|
+
// text: 'Status',
|
|
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: 'Total',
|
|
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
|
+
];
|
|
182
|
+
|
|
183
|
+
this.SetDataInCell(HeaderName, 0, this.Row);
|
|
184
|
+
this.MergeArray.push({
|
|
185
|
+
s: { r: this.Row, c: 0 },
|
|
186
|
+
e: { r: this.Row, c: 0 + 8 - 1 },
|
|
187
|
+
});
|
|
188
|
+
this.Row += 2;
|
|
189
|
+
searchValue.forEach((search: any) => {
|
|
190
|
+
let ColStart: any = 0;
|
|
191
|
+
// console.log('search', search, ColStart);
|
|
192
|
+
search.forEach((item: any) => {
|
|
193
|
+
// console.log('text', oyo.text, ColStart);
|
|
194
|
+
this.SetDataInCell(item.text, ColStart, this.Row);
|
|
195
|
+
this.MergeArray.push({
|
|
196
|
+
s: { r: this.Row, c: ColStart },
|
|
197
|
+
e: { r: this.Row, c: ColStart + item.ColRange - 1 },
|
|
198
|
+
});
|
|
199
|
+
ColStart += item.ColRange;
|
|
200
|
+
});
|
|
201
|
+
this.Row += 1;
|
|
202
|
+
});
|
|
203
|
+
this.Row += 1;
|
|
204
|
+
let MainColStart: any = 0;
|
|
205
|
+
MainHeadings.forEach((MainHeader: any) => {
|
|
206
|
+
this.SetDataInCell(MainHeader.text, MainColStart, this.Row);
|
|
207
|
+
this.MergeArray.push({
|
|
208
|
+
s: { r: this.Row, c: MainColStart },
|
|
209
|
+
e: { r: this.Row, c: MainColStart + MainHeader.ColRange - 1 },
|
|
210
|
+
});
|
|
211
|
+
MainColStart += MainHeader.ColRange;
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
this.Row += 2;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
static setInvoiceDetailsInCell(MainData: any, DecimalsNumber: number) {
|
|
218
|
+
MainData.forEach((InvoiceList: any) => {
|
|
219
|
+
this.SetInvoiceDataInExcel(InvoiceList, DecimalsNumber);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
static SetInvoiceDataInExcel(InvoiceInfo: any, DecimalsNumber: number) {
|
|
224
|
+
// InvoiceInfo.Date = TrUtils.ConvertDateToReadableFormat(InvoiceInfo.CrDate);
|
|
225
|
+
let Vehicle:any=InvoiceInfo.Make + ' ' + InvoiceInfo.Model + ' ' + InvoiceInfo.Var + ' ' + InvoiceInfo.Year;
|
|
226
|
+
let InvoiceData: any = [
|
|
227
|
+
// { text: InvoiceInfo.Code, ColRange: 1, IsString: true },
|
|
228
|
+
{ text: InvoiceInfo.Customer.DName, ColRange: 1, IsString: true },
|
|
229
|
+
{ text: InvoiceInfo.Customer.Cons?.Phones?.Main, ColRange: 1, IsString: true },
|
|
230
|
+
{ text: Vehicle, ColRange: 1, IsString: true },
|
|
231
|
+
{ text: InvoiceInfo.RegNo, ColRange: 1, IsString: true },
|
|
232
|
+
{ text: InvoiceInfo.VIN, ColRange: 1, IsString: true },
|
|
233
|
+
{ text: InvoiceInfo.InsName, ColRange: 1, IsString: true },
|
|
234
|
+
{ text: InvoiceInfo.More?.Ins?.PolNo, ColRange: 1, IsString: false },
|
|
235
|
+
{ text: MyDate.ConvertUTCDateToReadable(InvoiceInfo.More?.Ins?.VTo), ColRange: 1, IsString: false },
|
|
236
|
+
// { text: InvoiceInfo.Sts, ColRange: 1, IsString: false },
|
|
237
|
+
// { text: InvoiceInfo.Adjust, ColRange: 1, IsString: false },
|
|
238
|
+
// { text: InvoiceInfo.Round, ColRange: 1, IsString: false },
|
|
239
|
+
// { text: InvoiceInfo.Total, ColRange: 1, IsString: false }
|
|
240
|
+
];
|
|
241
|
+
let ColStart: any = 0;
|
|
242
|
+
InvoiceData.forEach((InvData: any) => {
|
|
243
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
244
|
+
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
245
|
+
this.MergeArray.push({
|
|
246
|
+
s: { r: this.Row, c: ColStart },
|
|
247
|
+
e: { r: this.Row, c: ColStart + InvData.ColRange - 1 },
|
|
248
|
+
});
|
|
249
|
+
ColStart += InvData.ColRange;
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
this.Row += 1;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
static ConvertToString(Text: any, IsString: any, DecimalsNumber: number ) {
|
|
256
|
+
if (IsString) {
|
|
257
|
+
if (Text == null) {
|
|
258
|
+
Text = '';
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
if (Text == null) {
|
|
262
|
+
Text = 0;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
if (typeof Text === 'number') {
|
|
266
|
+
return Number(TrUtils.FixedTo(Text, DecimalsNumber));
|
|
267
|
+
} else {
|
|
268
|
+
return Text;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
static SetDataInCell(Data: any, ColRange: number, RowNum: any) {
|
|
273
|
+
var cell = { v: Data };
|
|
274
|
+
var cell_ref = XLSX.utils.encode_cell({ c: ColRange, r: RowNum });
|
|
275
|
+
if (this.range.e.c < ColRange) {
|
|
276
|
+
this.range.e.c = ColRange;
|
|
277
|
+
}
|
|
278
|
+
if (this.range.e.r < RowNum) {
|
|
279
|
+
this.range.e.r = RowNum;
|
|
280
|
+
}
|
|
281
|
+
cell = this.getcelltype(cell);
|
|
282
|
+
this.ws[cell_ref] = cell;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
static getcelltype(cell: any) {
|
|
286
|
+
if (typeof cell.v === 'number') cell.t = 'n';
|
|
287
|
+
else if (typeof cell.v === 'boolean') cell.t = 'b';
|
|
288
|
+
else cell.t = 's';
|
|
289
|
+
return cell;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
}
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
|
|
2
|
+
import * as XLSX from 'xlsx';
|
|
3
|
+
import { MyDate } from '../../../utils/my-date';
|
|
4
|
+
import { TrUtils } from '../../../utils/tr-utils';
|
|
5
|
+
|
|
6
|
+
export class NextServiceDateXlsxFileService {
|
|
7
|
+
static wb: any = {};
|
|
8
|
+
static Row: any = 2;
|
|
9
|
+
static MergeArray: any[] = [];
|
|
10
|
+
static range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
|
|
11
|
+
static ws: any = {};
|
|
12
|
+
|
|
13
|
+
static GetNextServiceDateExcelData(MainData: any, searchValue: any, HeaderName: any, isDetails: boolean, EntitySettings:any) {
|
|
14
|
+
this.wb = {};
|
|
15
|
+
this.ws = {};
|
|
16
|
+
this.Row = 0;
|
|
17
|
+
this.range = { s: { c: 0, r: 0 }, e: { c: 0, r: 0 } };
|
|
18
|
+
this.MergeArray = [];
|
|
19
|
+
let ws_name = HeaderName;
|
|
20
|
+
this.wb.Sheets = {};
|
|
21
|
+
this.wb.Props = {};
|
|
22
|
+
this.wb.SSF = {};
|
|
23
|
+
this.wb.SheetNames = [];
|
|
24
|
+
let showSearch: any = [];
|
|
25
|
+
for (const key in searchValue) {
|
|
26
|
+
if (!TrUtils.IsNull(searchValue[key]) && key !== 'Date' && key !== 'ManfCntrlId' && key !== 'VenCntrlId') {
|
|
27
|
+
showSearch.push([{
|
|
28
|
+
text: (key === 'StDate') ? 'Start Date' : (key === 'EnDate') ? 'End Date' : (key === 'ManfCntrl') ? 'Manufacturer' : (key === 'VenCntrl') ? 'Vendor' : key,
|
|
29
|
+
ColRange: 1,
|
|
30
|
+
bold: true,
|
|
31
|
+
ChildHeadings: [
|
|
32
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
33
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
34
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
35
|
+
],
|
|
36
|
+
}, {
|
|
37
|
+
text: (key === 'StDate') ? MyDate.ConvertUTCDateToReadable(searchValue[key]) : (key === 'EnDate') ? MyDate.ConvertUTCDateToReadable(searchValue[key]) : searchValue[key],
|
|
38
|
+
ColRange: 7,
|
|
39
|
+
bold: true,
|
|
40
|
+
ChildHeadings: [
|
|
41
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
42
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
43
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
44
|
+
],
|
|
45
|
+
}]);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// console.log(`${key}: ${searchValue[key]}`);
|
|
49
|
+
}
|
|
50
|
+
MainData = this.GetTotals(MainData);
|
|
51
|
+
|
|
52
|
+
this.setHeadingInCell(HeaderName, showSearch, isDetails);
|
|
53
|
+
|
|
54
|
+
this.setInvoiceDetailsInCell(MainData, isDetails, EntitySettings.DecimalsNumber);
|
|
55
|
+
|
|
56
|
+
this.ws['!ref'] = XLSX.utils.encode_range(this.range);
|
|
57
|
+
|
|
58
|
+
this.ws['!merges'] = this.MergeArray;
|
|
59
|
+
this.ws["!cols"] = [{ wch: 50 }, { wch: 10 }, { wch: 10 }, { wch: 10 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 20 }];
|
|
60
|
+
|
|
61
|
+
this.wb.SheetNames.push(ws_name);
|
|
62
|
+
|
|
63
|
+
this.wb.Sheets[ws_name] = this.ws;
|
|
64
|
+
|
|
65
|
+
return this.wb;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static GetTotals(MainData: any) {
|
|
69
|
+
MainData.forEach((InvoiceInfo: any) => {
|
|
70
|
+
|
|
71
|
+
// InvoiceInfo.Tax =
|
|
72
|
+
// InvoiceInfo.ItemsCGST + InvoiceInfo.ItemsSGST + InvoiceInfo.ItemsIGST;
|
|
73
|
+
InvoiceInfo.TotalAmount = InvoiceInfo.Tax + InvoiceInfo.NetAmt;
|
|
74
|
+
});
|
|
75
|
+
return MainData;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
static setHeadingInCell(HeaderName: any, showSearch: any, isDetails: boolean) {
|
|
79
|
+
|
|
80
|
+
let MainHeadings: any[] = [
|
|
81
|
+
// {
|
|
82
|
+
// text: 'SNo',
|
|
83
|
+
// ColRange: 1,
|
|
84
|
+
// bold: true,
|
|
85
|
+
// ChildHeadings: []
|
|
86
|
+
// },
|
|
87
|
+
{
|
|
88
|
+
text: 'Customer Name',
|
|
89
|
+
ColRange: 1,
|
|
90
|
+
bold: true,
|
|
91
|
+
ChildHeadings: [],
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
text: 'Mobile No',
|
|
95
|
+
ColRange: 1,
|
|
96
|
+
bold: true,
|
|
97
|
+
ChildHeadings: [],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
text: 'Reg. No',
|
|
101
|
+
ColRange: 1,
|
|
102
|
+
bold: true,
|
|
103
|
+
ChildHeadings: [
|
|
104
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
105
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
106
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
text: 'Vehicle',
|
|
111
|
+
ColRange: 1,
|
|
112
|
+
bold: true,
|
|
113
|
+
ChildHeadings: [
|
|
114
|
+
// { text: 'No', ColRange: 1 },
|
|
115
|
+
// { text: 'Date', ColRange: 1 },
|
|
116
|
+
// { text: 'Invoice Total', ColRange: 1 }
|
|
117
|
+
],
|
|
118
|
+
},
|
|
119
|
+
|
|
120
|
+
{
|
|
121
|
+
text: 'Sale Date',
|
|
122
|
+
ColRange: 1,
|
|
123
|
+
bold: true,
|
|
124
|
+
ChildHeadings: [
|
|
125
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
126
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
127
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
|
|
131
|
+
{
|
|
132
|
+
text: 'Last Service Date',
|
|
133
|
+
ColRange: 1,
|
|
134
|
+
bold: true,
|
|
135
|
+
ChildHeadings: [
|
|
136
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
137
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
138
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
text: 'Last Mileage',
|
|
143
|
+
ColRange: 1,
|
|
144
|
+
bold: true,
|
|
145
|
+
ChildHeadings: [
|
|
146
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
147
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
148
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
149
|
+
],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
text: 'Next Service Date',
|
|
153
|
+
ColRange: 1,
|
|
154
|
+
bold: true,
|
|
155
|
+
ChildHeadings: [
|
|
156
|
+
// { text: 'Central Tax', ColRange: 1 },
|
|
157
|
+
// { text: 'State Tax', ColRange: 1 },
|
|
158
|
+
// { text: 'IGST Tax', ColRange: 1 },
|
|
159
|
+
],
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
];
|
|
165
|
+
|
|
166
|
+
this.SetDataInCell(HeaderName, 0, this.Row);
|
|
167
|
+
this.MergeArray.push({
|
|
168
|
+
s: { r: this.Row, c: 0 },
|
|
169
|
+
e: { r: this.Row, c: 0 + 8 - 1 },
|
|
170
|
+
});
|
|
171
|
+
this.Row += 2;
|
|
172
|
+
showSearch.forEach((search: any) => {
|
|
173
|
+
let ColStart: any = 0;
|
|
174
|
+
// console.log('search', search, ColStart);
|
|
175
|
+
search.forEach((item: any) => {
|
|
176
|
+
// console.log('text', oyo.text, ColStart);
|
|
177
|
+
this.SetDataInCell(item.text, ColStart, this.Row);
|
|
178
|
+
this.MergeArray.push({
|
|
179
|
+
s: { r: this.Row, c: ColStart },
|
|
180
|
+
e: { r: this.Row, c: ColStart + item.ColRange - 1 },
|
|
181
|
+
});
|
|
182
|
+
ColStart += item.ColRange;
|
|
183
|
+
});
|
|
184
|
+
this.Row += 1;
|
|
185
|
+
});
|
|
186
|
+
this.Row += 1;
|
|
187
|
+
let MainColStart: any = 0;
|
|
188
|
+
MainHeadings.forEach((MainHeader: any) => {
|
|
189
|
+
this.SetDataInCell(MainHeader.text, MainColStart, this.Row);
|
|
190
|
+
this.MergeArray.push({
|
|
191
|
+
s: { r: this.Row, c: MainColStart },
|
|
192
|
+
e: { r: this.Row, c: MainColStart + MainHeader.ColRange - 1 },
|
|
193
|
+
});
|
|
194
|
+
MainColStart += MainHeader.ColRange;
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
this.Row += 2;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
static setInvoiceDetailsInCell(MainData: any, isDetails: boolean, DecimalsNumber: number) {
|
|
201
|
+
MainData.forEach((InvoiceList: any) => {
|
|
202
|
+
this.SetInvoiceDataInExcel(InvoiceList, isDetails, DecimalsNumber);
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
static PhoneGetter(Customer: any) {
|
|
207
|
+
if (!TrUtils.IsEmpty(Customer) && !TrUtils.IsEmpty(Customer.Cons) &&
|
|
208
|
+
!TrUtils.IsNull(Customer.Cons.Phones)) {
|
|
209
|
+
return Customer.Cons.Phones.Main;
|
|
210
|
+
} else {
|
|
211
|
+
return '';
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
static SetInvoiceDataInExcel(InvoiceInfo: any, isDetails: boolean, DecimalsNumber: number) {
|
|
216
|
+
InvoiceInfo.LSDate = this.ConvertDateToReadableFormat(InvoiceInfo.LSDate);
|
|
217
|
+
InvoiceInfo.NSDate = this.ConvertDateToReadableFormat(InvoiceInfo.NSDate);
|
|
218
|
+
InvoiceInfo.DDate = this.ConvertDateToReadableFormat(InvoiceInfo.DDate);
|
|
219
|
+
|
|
220
|
+
let InvoiceData: any = [
|
|
221
|
+
{ text: InvoiceInfo.Customer?.DName, ColRange: 1, IsString: true },
|
|
222
|
+
{ text: this.PhoneGetter(InvoiceInfo.Customer), ColRange: 1, IsString: true },
|
|
223
|
+
{ text: InvoiceInfo.RegNo, ColRange: 1, IsString: true },
|
|
224
|
+
{ text: InvoiceInfo.Make + '' + InvoiceInfo.Model + '' + InvoiceInfo.Var, ColRange: 1, IsString: false },
|
|
225
|
+
{ text: InvoiceInfo.DDate, ColRange: 1, IsString: false },
|
|
226
|
+
{ text: InvoiceInfo.LSDate, ColRange: 1, IsString: false },
|
|
227
|
+
{ text: InvoiceInfo.LMileage, ColRange: 1, IsString: false },
|
|
228
|
+
{ text: InvoiceInfo.NSDate, ColRange: 1, IsString: false }
|
|
229
|
+
];
|
|
230
|
+
let ColStart: any = 0;
|
|
231
|
+
InvoiceData.forEach((InvData: any) => {
|
|
232
|
+
InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
|
|
233
|
+
this.SetDataInCell(InvData.text, ColStart, this.Row);
|
|
234
|
+
this.MergeArray.push({
|
|
235
|
+
s: { r: this.Row, c: ColStart },
|
|
236
|
+
e: { r: this.Row, c: ColStart + InvData.ColRange - 1 },
|
|
237
|
+
});
|
|
238
|
+
ColStart += InvData.ColRange;
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
this.Row += 1;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
static ConvertDateToReadableFormat(DateObject: any) {
|
|
246
|
+
if (!TrUtils.IsEmpty(DateObject)) {
|
|
247
|
+
let date: any = new Date(DateObject);
|
|
248
|
+
let Month: any;
|
|
249
|
+
let Day: any;
|
|
250
|
+
|
|
251
|
+
let MonthName = new Array();
|
|
252
|
+
MonthName[0] = 'Jan';
|
|
253
|
+
MonthName[1] = 'Feb';
|
|
254
|
+
MonthName[2] = 'Mar';
|
|
255
|
+
MonthName[3] = 'Apr';
|
|
256
|
+
MonthName[4] = 'May';
|
|
257
|
+
MonthName[5] = 'Jun';
|
|
258
|
+
MonthName[6] = 'Jul';
|
|
259
|
+
MonthName[7] = 'Aug';
|
|
260
|
+
MonthName[8] = 'Sept';
|
|
261
|
+
MonthName[9] = 'Oct';
|
|
262
|
+
MonthName[10] = 'Nov';
|
|
263
|
+
MonthName[11] = 'Dec';
|
|
264
|
+
|
|
265
|
+
Month = MonthName[date.getMonth()];
|
|
266
|
+
|
|
267
|
+
if (date.getDate() < 10) {
|
|
268
|
+
Day = '0' + date.getDate();
|
|
269
|
+
} else {
|
|
270
|
+
Day = date.getDate();
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
date = Day + '-' + Month + '-' + date.getFullYear();
|
|
274
|
+
return date;
|
|
275
|
+
} else {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
static ConvertToString(Text: any, IsString: any, DecimalsNumber: number) {
|
|
281
|
+
if (IsString) {
|
|
282
|
+
if (Text == null) {
|
|
283
|
+
Text = '';
|
|
284
|
+
}
|
|
285
|
+
} else {
|
|
286
|
+
if (Text == null) {
|
|
287
|
+
Text = 0;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (typeof Text === 'number') {
|
|
291
|
+
return Number(TrUtils.FixedTo(Text, DecimalsNumber));
|
|
292
|
+
} else {
|
|
293
|
+
return Text;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
static SetDataInCell(Data: any, ColRange: number, RowNum: any) {
|
|
298
|
+
var cell = { v: Data };
|
|
299
|
+
var cell_ref = XLSX.utils.encode_cell({ c: ColRange, r: RowNum });
|
|
300
|
+
if (this.range.e.c < ColRange) {
|
|
301
|
+
this.range.e.c = ColRange;
|
|
302
|
+
}
|
|
303
|
+
if (this.range.e.r < RowNum) {
|
|
304
|
+
this.range.e.r = RowNum;
|
|
305
|
+
}
|
|
306
|
+
cell = this.getcelltype(cell);
|
|
307
|
+
this.ws[cell_ref] = cell;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
static getcelltype(cell: any) {
|
|
311
|
+
if (typeof cell.v === 'number') cell.t = 'n';
|
|
312
|
+
else if (typeof cell.v === 'boolean') cell.t = 'b';
|
|
313
|
+
else cell.t = 's';
|
|
314
|
+
return cell;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
}
|