shareneus 1.4.41 → 1.4.43
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/dist/accounting/counter-sales/auto-sales-receipt-pdf.service.js +2 -2
- package/dist/accounting/counter-sales/pos-receipt-pdf.js +1 -1
- package/dist/accounting/counter-sales/sales-receipt-pdf.service.js +2 -2
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +3 -5
- package/dist/accounting/credit-note/cn-print.service.js +3 -5
- package/dist/accounting/credit-note/credit-note-pdf.service.js +2 -2
- package/dist/accounting/debit-note/debit-note-pdf.service.js +2 -2
- package/dist/accounting/debit-note/debit-note-print.service.js +3 -5
- package/dist/accounting/invoice/hc-inv-pdf.service.js +4 -4
- package/dist/accounting/invoice/inv-pdf.service.js +2 -2
- package/dist/accounting/invoice/inv-print.service.js +2 -1
- package/dist/accounting/invoice/invoice-landscape-pdf.service.d.ts +1 -0
- package/dist/accounting/invoice/invoice-landscape-pdf.service.js +16 -12
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +2 -2
- package/dist/accounting/invoice/invoice-portrait-pdf.js +6 -6
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +1 -1
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +1 -1
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +1 -1
- package/dist/accounting/invoice/shared-inv-pdf.service.js +2 -2
- package/dist/accounting/payment-receive/payment-pdf.service.js +1 -1
- package/dist/accounting/payment-receive/receipt-print.service.js +1 -1
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +1 -1
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +1 -1
- package/dist/appointments/consultations/consultation-fee-receipt.service.js +1 -1
- package/dist/appointments/consultations/consultation-full-pdf.service.js +1 -1
- package/dist/appointments/consultations/consultation-letterhead-pdf.service.js +1 -1
- package/dist/appointments/consultations/consultation-pdf.service.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/inventory/items/issue-parts-pdf.service.js +2 -2
- package/dist/inventory/items/item-bar-code-label-pdf.js +1 -1
- package/dist/inventory/items/item-detais-pdf.js +1 -1
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +1 -1
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +1 -1
- package/dist/inventory/material-out/mout-pdf.service.js +2 -2
- package/dist/inventory/transfer-order/transfer-order-pdf.service.js +1 -1
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +1 -1
- package/dist/purchases/purchase-order/purchase-order-pdf.service.js +2 -2
- package/dist/purchases/purchase-order/purchase-order-print.service.js +2 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.d.ts +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.js +2 -2
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.js +2 -1
- package/dist/purchases/vendor-debit-note/vendor-debit-note-pdf.service.js +2 -2
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +2 -1
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +2 -2
- package/dist/sales/delivery-challan/dc-landscape-without-price-pdf.service.js +2 -2
- package/dist/sales/delivery-challan/dc-without-price-pdf.service.js +2 -2
- package/dist/sales/delivery-challan/delivery-challan-pdf.service.js +2 -2
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +2 -1
- package/dist/sales/sales/equipment-design-pdf.service.js +2 -2
- package/dist/sales/sales/pack-ship-pdf.service.js +2 -2
- package/dist/sales/sales/pack-ship-print.service.js +1 -1
- package/dist/sales/sales/sales-pdf.service.js +2 -2
- package/dist/sales/sales/sales-print.service.js +2 -1
- package/dist/services/checklist-pdf.js +2 -2
- package/dist/services/checklists-pdf.js +1 -1
- package/dist/services/est.print-service.js +1 -1
- package/dist/services/reports/pdf/insurance-expire-pdf.service.js +1 -1
- package/dist/services/reports/pdf/next-service-date-pdf.service.js +1 -1
- package/dist/services/reports/pdf/repair-orders-pdf.service.js +1 -1
- package/dist/services/ro-pdf.service.js +2 -2
- package/dist/services/ro-print-service.js +1 -1
- package/dist/services/separate-wo-print.service.js +1 -1
- package/dist/services/technician-pdf.service.js +1 -1
- package/dist/services/technician-print.service.js +1 -1
- package/dist/shared/shared-pdf.service.d.ts +926 -0
- package/dist/shared/shared-pdf.service.js +2608 -0
- package/dist/shared/{shared-services → shared-pdfs}/shared-pdf.service.js +2 -2
- package/dist/shared/{shared-services/shared-print.service.js → shared-print.service.js} +2 -2
- package/dist/tasks/meetings/meeting-pdf.js +1 -1
- package/dist/tasks/tasks/task-pdf.service.js +2 -2
- package/dist/tasks/tasks/task-reports-pdf.service.js +2 -2
- package/package.json +1 -1
- /package/dist/shared/{shared-services → shared-pdfs}/shared-pdf.service.d.ts +0 -0
- /package/dist/shared/{shared-services/shared-print.service.d.ts → shared-print.service.d.ts} +0 -0
|
@@ -0,0 +1,2608 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SharedPDFService = void 0;
|
|
4
|
+
const enums_1 = require("../enums/enums");
|
|
5
|
+
const my_date_1 = require("../utils/my-date");
|
|
6
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
|
+
class SharedPDFService {
|
|
8
|
+
static MainHeading(CName, Entity, Image, HColor, CopyName) {
|
|
9
|
+
let headerstyle;
|
|
10
|
+
let MainHeaderStyle = this.GetMainHeaderStyleForLeftAlignHeader(CName);
|
|
11
|
+
if (Entity.Header === 1) {
|
|
12
|
+
headerstyle = 'header';
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
headerstyle = 'temp2header';
|
|
16
|
+
}
|
|
17
|
+
return this.HeaderAlignmentBasedOnCondition(CName, Image, HColor, headerstyle, MainHeaderStyle, Entity, CopyName);
|
|
18
|
+
}
|
|
19
|
+
static HeaderAlignmentBasedOnCondition(CName, Image, HColor, headerstyle, MainHeaderStyle, Entity, CopyName) {
|
|
20
|
+
let HeaderDetails = [];
|
|
21
|
+
// HeaderDetails.push({ text: 'Original', color: 'grey', alignment: 'right' });
|
|
22
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
23
|
+
if (Entity.Header === 1) {
|
|
24
|
+
HeaderDetails.push({ text: '' + CName + '', style: [headerstyle, MainHeaderStyle], color: HColor, alignment: this.GetLeftMArgin(CName) });
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
HeaderDetails.push({ text: '' + CName + '', style: [headerstyle, MainHeaderStyle], color: HColor, alignment: 'left', margin: [10, 0, 0, 0] });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
HeaderDetails.push({ text: '' + CName + '', style: [headerstyle, MainHeaderStyle], color: HColor });
|
|
32
|
+
}
|
|
33
|
+
// if (!TrUtils.IsNull(CopyName)) {
|
|
34
|
+
// HeaderDetails.push({ text: CopyName, color: 'grey', alignment: 'right', width: 100, marginTop: -15, fontSize: 10 });
|
|
35
|
+
// }
|
|
36
|
+
return HeaderDetails;
|
|
37
|
+
}
|
|
38
|
+
static GetLeftMArgin(WorkShopName) {
|
|
39
|
+
if (WorkShopName.length < 28) {
|
|
40
|
+
return 'center';
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return 'left';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
static GetMainHeader(Entity, Image, AColor, HColor, text) {
|
|
47
|
+
if (Entity.Header === 1) {
|
|
48
|
+
return {
|
|
49
|
+
columns: this.GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text)
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return {
|
|
54
|
+
columns: this.GetLeftAlignmentHeader(Entity, Image, AColor, HColor, text)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
static GetConsultationMainHeader(Entity, Image, AColor, HColor, text) {
|
|
59
|
+
return {
|
|
60
|
+
columns: this.GetConsultationLeftAlignmentHeader(Entity, Image, AColor, HColor, text), width: '60%'
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
static ConsultationMainHeading(CName, Entity, Image, HColor, CopyName) {
|
|
64
|
+
let headerstyle;
|
|
65
|
+
let MainHeaderStyle = {
|
|
66
|
+
fontSize: 15,
|
|
67
|
+
bold: true,
|
|
68
|
+
};
|
|
69
|
+
// if (Entity.Header === 1) {
|
|
70
|
+
// headerstyle = 'header';
|
|
71
|
+
// } else {
|
|
72
|
+
headerstyle = 'temp2header';
|
|
73
|
+
// }
|
|
74
|
+
return this.ConsultHeaderAlignmentBasedOnCondition(CName, Image, HColor, headerstyle, MainHeaderStyle, Entity, CopyName);
|
|
75
|
+
}
|
|
76
|
+
static ConsultHeaderAlignmentBasedOnCondition(CName, Image, HColor, headerstyle, MainHeaderStyle, Entity, CopyName) {
|
|
77
|
+
let HeaderDetails = [];
|
|
78
|
+
// HeaderDetails.push({ text: 'Original', color: 'grey', alignment: 'right' });
|
|
79
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
80
|
+
// if (Entity.Header === 1) {
|
|
81
|
+
// HeaderDetails.push({ text: '' + CName + '', style: [headerstyle, MainHeaderStyle], color: HColor, alignment: this.GetLeftMArgin(CName) })
|
|
82
|
+
// } else {
|
|
83
|
+
HeaderDetails.push({ text: '' + CName + '', style: [headerstyle, MainHeaderStyle], color: HColor, alignment: 'left', margin: [10, 0, 0, 0] });
|
|
84
|
+
// }
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
HeaderDetails.push({ text: '' + CName + '', style: [headerstyle, MainHeaderStyle], color: HColor });
|
|
88
|
+
}
|
|
89
|
+
// if (!TrUtils.IsNull(CopyName)) {
|
|
90
|
+
// HeaderDetails.push({ text: CopyName, color: 'grey', alignment: 'right', width: 100, marginTop: -15, fontSize: 10 });
|
|
91
|
+
// }
|
|
92
|
+
return HeaderDetails;
|
|
93
|
+
}
|
|
94
|
+
static GetConsultationLeftAlignmentHeader(Entity, Image, AColor, HColor, text) {
|
|
95
|
+
let Details = [
|
|
96
|
+
{
|
|
97
|
+
stack: [{ columns: [this.ConsultationMainHeading(Entity.CName, Entity, Image, HColor, text)], marginTop: 15 },
|
|
98
|
+
{
|
|
99
|
+
columns: [
|
|
100
|
+
this.GetEntityDetails(Entity)
|
|
101
|
+
]
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
107
|
+
Details[0].stack[1].columns.unshift({
|
|
108
|
+
width: 290,
|
|
109
|
+
margin: [10, 0, 0, 5],
|
|
110
|
+
stack: this.GetHeader(Entity, HColor),
|
|
111
|
+
color: AColor,
|
|
112
|
+
style: 'temp2header'
|
|
113
|
+
});
|
|
114
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
115
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
116
|
+
}
|
|
117
|
+
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
Details[0].stack[1].columns.unshift({
|
|
121
|
+
width: 420,
|
|
122
|
+
margin: [0, 0, 0, 5],
|
|
123
|
+
stack: this.GetHeader(Entity, HColor),
|
|
124
|
+
color: AColor,
|
|
125
|
+
style: 'temp2header'
|
|
126
|
+
});
|
|
127
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
128
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return Details;
|
|
132
|
+
}
|
|
133
|
+
static GetWatermarkImage(Image, pageSize, Wmark) {
|
|
134
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Wmark) {
|
|
135
|
+
return {
|
|
136
|
+
margun: [10, 15, 10, 15],
|
|
137
|
+
image: Image,
|
|
138
|
+
width: pageSize.width,
|
|
139
|
+
alignment: 'center',
|
|
140
|
+
height: pageSize.height,
|
|
141
|
+
opacity: 0.04,
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
return this.emptyObject();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
static GetLeftAlignmentHeader(Entity, Image, AColor, HColor, text) {
|
|
149
|
+
let Details = [
|
|
150
|
+
{
|
|
151
|
+
stack: [{ columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
|
|
152
|
+
{
|
|
153
|
+
columns: [
|
|
154
|
+
this.emptyObject()
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
];
|
|
160
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
161
|
+
Details[0].stack[1].columns.unshift({
|
|
162
|
+
width: 290,
|
|
163
|
+
margin: [10, 0, 0, 5],
|
|
164
|
+
stack: this.GetHeader(Entity, HColor),
|
|
165
|
+
color: AColor,
|
|
166
|
+
style: 'temp2header'
|
|
167
|
+
});
|
|
168
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
169
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
170
|
+
}
|
|
171
|
+
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
Details[0].stack[1].columns.unshift({
|
|
175
|
+
width: 420,
|
|
176
|
+
margin: [0, 0, 0, 5],
|
|
177
|
+
stack: this.GetHeader(Entity, HColor),
|
|
178
|
+
color: AColor,
|
|
179
|
+
style: 'temp2header'
|
|
180
|
+
});
|
|
181
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
182
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
return Details;
|
|
186
|
+
}
|
|
187
|
+
static GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text) {
|
|
188
|
+
let Details = [
|
|
189
|
+
{
|
|
190
|
+
stack: [
|
|
191
|
+
{ columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
|
|
192
|
+
{
|
|
193
|
+
columns: [{
|
|
194
|
+
width: 300,
|
|
195
|
+
margin: [0, 0, 0, 5],
|
|
196
|
+
stack: this.GetHeader(Entity, HColor),
|
|
197
|
+
color: AColor,
|
|
198
|
+
style: 'header'
|
|
199
|
+
},
|
|
200
|
+
this.emptyObject()]
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
}
|
|
204
|
+
];
|
|
205
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
|
|
206
|
+
// Details.unshift({ text: '', width: 120 });
|
|
207
|
+
if (Entity.CName.length < 28) {
|
|
208
|
+
Details[0].stack[0].columns.push({ text: '', width: 150 });
|
|
209
|
+
}
|
|
210
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
211
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 7 });
|
|
212
|
+
}
|
|
213
|
+
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
214
|
+
}
|
|
215
|
+
else {
|
|
216
|
+
Details[0].stack[1].columns.unshift({ text: '', width: 130 });
|
|
217
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
218
|
+
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 7 });
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return Details;
|
|
222
|
+
}
|
|
223
|
+
static GetHeader(Entity, HColor) {
|
|
224
|
+
let headerstyle;
|
|
225
|
+
if (Entity.Header === 1) {
|
|
226
|
+
headerstyle = 'ws_adrs_center';
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
headerstyle = 'ws_adrs_left';
|
|
230
|
+
}
|
|
231
|
+
let SubHeader = [
|
|
232
|
+
{ text: '' + Entity.Adrs1 + '', style: [headerstyle] },
|
|
233
|
+
{ text: '' + Entity.City + this.getPinCode(Entity.PIN) + ', ' + 'Ph: ' + Entity.Phone, style: headerstyle },
|
|
234
|
+
{ text: '' + this.GetEmail(Entity.Email) + '', style: headerstyle },
|
|
235
|
+
// { text: 'GSTIN:' + Entity.GSTIN + ', ' + 'PAN: ' + Entity.PAN, style: headerstyle },
|
|
236
|
+
];
|
|
237
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Adrs2)) {
|
|
238
|
+
SubHeader.splice(1, 0, { text: '' + Entity.Adrs2 + '', style: [headerstyle] });
|
|
239
|
+
}
|
|
240
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.TLine)) {
|
|
241
|
+
SubHeader.unshift({ text: this.GetTagLine(Entity.TLine), fontSize: 10, bold: true, color: HColor, margin: [0, 0, 0, 2] });
|
|
242
|
+
}
|
|
243
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.GSTIN) || !tr_utils_1.TrUtils.IsEmpty(Entity.PAN)) {
|
|
244
|
+
let Data = '';
|
|
245
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.GSTIN)) {
|
|
246
|
+
Data = 'GSTIN:' + Entity.GSTIN;
|
|
247
|
+
}
|
|
248
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.GSTIN) && !tr_utils_1.TrUtils.IsEmpty(Entity.PAN)) {
|
|
249
|
+
Data = Data + ', ';
|
|
250
|
+
}
|
|
251
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.PAN)) {
|
|
252
|
+
Data = Data + 'PAN:' + Entity.PAN;
|
|
253
|
+
}
|
|
254
|
+
SubHeader.push({ text: Data, style: headerstyle, fontSize: this.TermsandCond });
|
|
255
|
+
}
|
|
256
|
+
if (Entity.GSTType === 2) {
|
|
257
|
+
SubHeader.push({ text: '* under composition scheme', fontSize: this.TermsandCond });
|
|
258
|
+
}
|
|
259
|
+
return SubHeader;
|
|
260
|
+
}
|
|
261
|
+
static GetMainHeaderStyleForLeftAlignHeader(WorkShopName) {
|
|
262
|
+
var wsname_fontSize;
|
|
263
|
+
if (tr_utils_1.TrUtils.IsNull(WorkShopName)) {
|
|
264
|
+
WorkShopName = '';
|
|
265
|
+
}
|
|
266
|
+
switch (true) {
|
|
267
|
+
case (WorkShopName.length < 30):
|
|
268
|
+
wsname_fontSize = 20;
|
|
269
|
+
break;
|
|
270
|
+
case (WorkShopName.length < 35):
|
|
271
|
+
wsname_fontSize = 20;
|
|
272
|
+
break;
|
|
273
|
+
case (WorkShopName.length < 50):
|
|
274
|
+
wsname_fontSize = 17;
|
|
275
|
+
break;
|
|
276
|
+
default:
|
|
277
|
+
wsname_fontSize = 14;
|
|
278
|
+
}
|
|
279
|
+
var HeaderSize = {
|
|
280
|
+
fontSize: wsname_fontSize,
|
|
281
|
+
bold: true,
|
|
282
|
+
};
|
|
283
|
+
return HeaderSize;
|
|
284
|
+
}
|
|
285
|
+
static GetEntityDetails(Entity) {
|
|
286
|
+
let SetData = [];
|
|
287
|
+
if (Entity.PrUPI && !Entity.IsProforma) {
|
|
288
|
+
SetData.push({ qr: Entity.UPI, fit: '100', marginLeft: 150 });
|
|
289
|
+
SetData.push({ text: 'Scan To Pay', fontSize: this.TermsandCond, marginLeft: 151, bold: true, marginTop: 2 });
|
|
290
|
+
}
|
|
291
|
+
// SetData.push({ columns: [this.GetEntityTax(Entity)] })
|
|
292
|
+
return {
|
|
293
|
+
lineHeight: 0.7,
|
|
294
|
+
stack: SetData
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
static GetEntityTax(Entity) {
|
|
298
|
+
let EntityData = [];
|
|
299
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.GSTIN)) {
|
|
300
|
+
EntityData.push({ name: 'GSTIN', value: Entity.GSTIN });
|
|
301
|
+
}
|
|
302
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.PAN)) {
|
|
303
|
+
EntityData.push({ name: 'PAN No', value: Entity.PAN });
|
|
304
|
+
}
|
|
305
|
+
if (EntityData.length !== 0) {
|
|
306
|
+
return this.GetEntityeDataTable(EntityData, Entity);
|
|
307
|
+
}
|
|
308
|
+
else {
|
|
309
|
+
return this.emptyObject();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
static GetEntityeDataTable(EntityFields, Entity) {
|
|
313
|
+
return {
|
|
314
|
+
lineHeight: 0.7,
|
|
315
|
+
marginTop: 5,
|
|
316
|
+
marginLeft: 10,
|
|
317
|
+
fontSize: this.TermsandCond,
|
|
318
|
+
// fontSize: this.SubHeaderSize,
|
|
319
|
+
table: {
|
|
320
|
+
body: [
|
|
321
|
+
[{
|
|
322
|
+
table: {
|
|
323
|
+
fontSize: this.TermsandCond,
|
|
324
|
+
widths: ['auto', 'auto', '*'],
|
|
325
|
+
body: this.EntityTableDataDetails(EntityFields, Entity)
|
|
326
|
+
},
|
|
327
|
+
layout: 'noBorders',
|
|
328
|
+
}]
|
|
329
|
+
]
|
|
330
|
+
},
|
|
331
|
+
layout: 'noBorders',
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
static EntityTableDataDetails(EntityFields, Entity) {
|
|
335
|
+
var body = [];
|
|
336
|
+
EntityFields.forEach((row) => {
|
|
337
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(row.value) && !tr_utils_1.TrUtils.IsEmpty(row.value)) {
|
|
338
|
+
var dataRow = [];
|
|
339
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true, fontSize: 8 });
|
|
340
|
+
dataRow.push(':');
|
|
341
|
+
dataRow.push({ text: (row.value).toString(), noWrap: true, fontSize: 9 });
|
|
342
|
+
body.push(dataRow);
|
|
343
|
+
if (row.name === 'GSTIN' && Entity.GSTType === 2) {
|
|
344
|
+
let data = [];
|
|
345
|
+
data.push({ text: '* under composition scheme', colSpan: 3, fontSize: 7, marginLeft: 10 }, {}, {});
|
|
346
|
+
body.push(data);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
// else {
|
|
350
|
+
// var a: any = [];
|
|
351
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
352
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
353
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
354
|
+
// body.push(a);
|
|
355
|
+
// }
|
|
356
|
+
});
|
|
357
|
+
return body;
|
|
358
|
+
}
|
|
359
|
+
static GetTagLine(TLine) {
|
|
360
|
+
if (!tr_utils_1.TrUtils.IsEmpty(TLine)) {
|
|
361
|
+
return TLine;
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
let TagLine = '';
|
|
365
|
+
return TagLine;
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
static GetEmail(email) {
|
|
369
|
+
let Email = '';
|
|
370
|
+
if (!tr_utils_1.TrUtils.IsNull(email)) {
|
|
371
|
+
return 'Email: ' + email;
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
return Email;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
static getPinCode(pin) {
|
|
378
|
+
let code = '';
|
|
379
|
+
if (!tr_utils_1.TrUtils.IsNull(pin)) {
|
|
380
|
+
return ' - ' + pin;
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
return code;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
static GetPrintType(type) {
|
|
387
|
+
return {
|
|
388
|
+
// marginLeft: 10,
|
|
389
|
+
columns: [{ text: '', width: 120 },
|
|
390
|
+
{ text: type, alignment: 'center' }, { text: '', width: 140 }
|
|
391
|
+
],
|
|
392
|
+
style: 'Receiptheader1'
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
static GetUnderLine() {
|
|
396
|
+
return {
|
|
397
|
+
marginTop: 10,
|
|
398
|
+
canvas: [
|
|
399
|
+
{
|
|
400
|
+
type: 'line',
|
|
401
|
+
color: 'grey',
|
|
402
|
+
x1: 0,
|
|
403
|
+
y1: 0,
|
|
404
|
+
x2: 575,
|
|
405
|
+
y2: 0,
|
|
406
|
+
lineWidth: 0.9
|
|
407
|
+
}
|
|
408
|
+
]
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
static GetUnderLine1(withPass) {
|
|
412
|
+
if (withPass) {
|
|
413
|
+
return {
|
|
414
|
+
marginTop: 10,
|
|
415
|
+
canvas: [
|
|
416
|
+
{
|
|
417
|
+
type: 'line',
|
|
418
|
+
color: 'grey',
|
|
419
|
+
x1: 0,
|
|
420
|
+
y1: 0,
|
|
421
|
+
x2: 575,
|
|
422
|
+
y2: 0,
|
|
423
|
+
dash: { length: 5, space: 10 },
|
|
424
|
+
lineWidth: 0.9
|
|
425
|
+
}
|
|
426
|
+
]
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
return this.emptyObject();
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
static GetLightUnderLine(width, color) {
|
|
434
|
+
return {
|
|
435
|
+
canvas: [
|
|
436
|
+
{
|
|
437
|
+
type: 'line',
|
|
438
|
+
color: color,
|
|
439
|
+
x1: 0,
|
|
440
|
+
y1: 0,
|
|
441
|
+
x2: width,
|
|
442
|
+
y2: 0,
|
|
443
|
+
lineWidth: 0.3
|
|
444
|
+
}
|
|
445
|
+
]
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
static HeaderAfterLine() {
|
|
449
|
+
return {
|
|
450
|
+
canvas: [
|
|
451
|
+
{
|
|
452
|
+
type: 'line',
|
|
453
|
+
lineColor: 'grey',
|
|
454
|
+
x1: 0,
|
|
455
|
+
y1: 0,
|
|
456
|
+
x2: 575,
|
|
457
|
+
y2: 0,
|
|
458
|
+
lineWidth: 1.5
|
|
459
|
+
}
|
|
460
|
+
]
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
static HeaderAfterLine2() {
|
|
464
|
+
return {
|
|
465
|
+
canvas: [
|
|
466
|
+
{
|
|
467
|
+
type: 'line',
|
|
468
|
+
lineColor: 'grey',
|
|
469
|
+
x1: 0,
|
|
470
|
+
y1: 0,
|
|
471
|
+
x2: 545,
|
|
472
|
+
y2: 0,
|
|
473
|
+
lineWidth: 1.5
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
static HeaderAfterLine1() {
|
|
479
|
+
return {
|
|
480
|
+
canvas: [
|
|
481
|
+
{
|
|
482
|
+
type: 'line',
|
|
483
|
+
lineColor: 'grey',
|
|
484
|
+
x1: 0,
|
|
485
|
+
y1: 0,
|
|
486
|
+
x2: 545,
|
|
487
|
+
y2: 0,
|
|
488
|
+
lineWidth: 1.5
|
|
489
|
+
}
|
|
490
|
+
]
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
static CustomerAndVehicleDetailsAfterLine() {
|
|
494
|
+
return {
|
|
495
|
+
canvas: [
|
|
496
|
+
{
|
|
497
|
+
type: 'line',
|
|
498
|
+
lineColor: 'grey',
|
|
499
|
+
x1: 0,
|
|
500
|
+
y1: 0,
|
|
501
|
+
x2: 575,
|
|
502
|
+
y2: 0,
|
|
503
|
+
lineWidth: 1
|
|
504
|
+
}
|
|
505
|
+
]
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
static convertImgToBase64URL(url, callback, outputFormat) {
|
|
509
|
+
var canvas = document.createElement('CANVAS'), ctx = canvas.getContext('2d'), img = new Image;
|
|
510
|
+
img.crossOrigin = 'Anonymous';
|
|
511
|
+
img.onload = function () {
|
|
512
|
+
var dataURL;
|
|
513
|
+
canvas.height = img.height;
|
|
514
|
+
canvas.width = img.width;
|
|
515
|
+
ctx.drawImage(img, 0, 0);
|
|
516
|
+
dataURL = canvas.toDataURL(outputFormat);
|
|
517
|
+
callback(dataURL);
|
|
518
|
+
canvas = null;
|
|
519
|
+
};
|
|
520
|
+
img.onerror = outputFormat;
|
|
521
|
+
img.src = url;
|
|
522
|
+
}
|
|
523
|
+
static GetShowLine(ROData) {
|
|
524
|
+
if (ROData.Parts.length !== 0 || ROData.Ops.length !== 0) {
|
|
525
|
+
return this.GetUnderLine();
|
|
526
|
+
}
|
|
527
|
+
else {
|
|
528
|
+
return this.emptyObject();
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
static GetTemsAndConditions(Terms) {
|
|
532
|
+
if (!tr_utils_1.TrUtils.IsNull(Terms)) {
|
|
533
|
+
return {
|
|
534
|
+
text: '' + Terms + '', marginTop: 5, marginBottom: 5,
|
|
535
|
+
fontSize: this.TermsandCond, alignment: 'justify'
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
return this.emptyObject();
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
static GetSearchValueDetails(searchValue) {
|
|
543
|
+
let showSearch = [];
|
|
544
|
+
for (const key in searchValue) {
|
|
545
|
+
if (!tr_utils_1.TrUtils.IsNull(searchValue[key]) && !tr_utils_1.TrUtils.CheckInvalidSelect(searchValue[key]) && key !== 'Date' && key !== 'CustCntrlId' && key !== 'DescCntrlId' && key !== 'ManfCntrlId' && key !== 'VenCntrlId') {
|
|
546
|
+
showSearch.push({
|
|
547
|
+
name: (key === 'StDate') ? 'Start Date' : (key === 'EnDate') ? 'End Date' : (key === 'CustCntrl') ? 'Customer' : (key === 'DescCntrl') ? 'Item' : (key === 'ManfCntrl') ? 'Manufacturer' : (key === 'VenCntrl') ? 'Vendor' : key,
|
|
548
|
+
value: (key === 'StDate') ? my_date_1.MyDate.ConvertUTCDateToReadable(searchValue[key]) : (key === 'EnDate') ? my_date_1.MyDate.ConvertUTCDateToReadable(searchValue[key]) : searchValue[key],
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
// console.log('showSearch', showSearch);
|
|
552
|
+
// console.log(`${key}: ${searchValue[key]}`);
|
|
553
|
+
}
|
|
554
|
+
return {
|
|
555
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
556
|
+
lineHeight: 1,
|
|
557
|
+
fontSize: this.SubHeaderSize,
|
|
558
|
+
marginBottom: 5,
|
|
559
|
+
table: {
|
|
560
|
+
body: this.GetBankDataTable(showSearch, false)
|
|
561
|
+
},
|
|
562
|
+
layout: 'noBorders',
|
|
563
|
+
};
|
|
564
|
+
}
|
|
565
|
+
static GetBankDetials(Bankinfo, isPrint) {
|
|
566
|
+
if (isPrint && !tr_utils_1.TrUtils.IsNull(Bankinfo)) {
|
|
567
|
+
let AccountFields = [];
|
|
568
|
+
let BANK = { name: 'BANK', value: Bankinfo.Name };
|
|
569
|
+
let Acc = { name: 'A/C NO', value: Bankinfo.ACNo };
|
|
570
|
+
let AccHolderName = { name: 'Account Holder Name', value: Bankinfo.ACName };
|
|
571
|
+
let Branch = { name: 'Branch', value: tr_utils_1.TrUtils.IsNull(Bankinfo.Bran) ? '' : Bankinfo.Bran };
|
|
572
|
+
let IFSC = { name: 'IFSC NO', value: Bankinfo.IFSC };
|
|
573
|
+
// let TotalPartsAmount = { name: 'Final Labor Amount', value: this.LabourtotalAmount(ROPrintData.LaborInsTotal) };
|
|
574
|
+
AccountFields.push(BANK);
|
|
575
|
+
// if (!TrUtils.IsNull(ROPrintData.OverAllLaborDiscount) && ROPrintData.OverAllLaborDiscount !== 0) {
|
|
576
|
+
AccountFields.push(Acc);
|
|
577
|
+
AccountFields.push(AccHolderName);
|
|
578
|
+
// }
|
|
579
|
+
AccountFields.push(Branch);
|
|
580
|
+
AccountFields.push(IFSC);
|
|
581
|
+
// AccountFields.push(TotalPartsAmount);
|
|
582
|
+
return {
|
|
583
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
584
|
+
lineHeight: 1,
|
|
585
|
+
fontSize: this.SubHeaderSize,
|
|
586
|
+
marginBottom: 5,
|
|
587
|
+
table: {
|
|
588
|
+
body: this.GetBankDataTable(AccountFields, true)
|
|
589
|
+
},
|
|
590
|
+
layout: 'noBorders',
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
else {
|
|
594
|
+
return this.emptyObject();
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
static GetBankDataTable(data, isBank) {
|
|
598
|
+
var body = [];
|
|
599
|
+
if (isBank) {
|
|
600
|
+
body = [[{ text: 'Bank Details', bold: true, colSpan: 3 }, {}, {}]];
|
|
601
|
+
;
|
|
602
|
+
}
|
|
603
|
+
data.forEach((row) => {
|
|
604
|
+
// if ((!TrUtils.IsFixedZero(row.value) && !TrUtils.IsNull(row.value)) || row.name === 'Total') {
|
|
605
|
+
var dataRow = [];
|
|
606
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true });
|
|
607
|
+
dataRow.push(':');
|
|
608
|
+
dataRow.push({ text: (row.value).toString(), noWrap: true, });
|
|
609
|
+
body.push(dataRow);
|
|
610
|
+
// }
|
|
611
|
+
// else {
|
|
612
|
+
// var a: any = [];
|
|
613
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
614
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
615
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
616
|
+
// body.push(a);
|
|
617
|
+
// }
|
|
618
|
+
});
|
|
619
|
+
return body;
|
|
620
|
+
}
|
|
621
|
+
//Not Use This Function any where
|
|
622
|
+
static LaborTotalTable(ROPrintData) {
|
|
623
|
+
let AccountFields = [];
|
|
624
|
+
if (ROPrintData.For === enums_1.PayTypeEnum.Insurance) {
|
|
625
|
+
let LaborTotal = { name: 'Labor Total', value: ROPrintData.BasicLaborTotal };
|
|
626
|
+
let Disc = { name: 'Labor Discount', value: ROPrintData.OverAllLaborDiscount };
|
|
627
|
+
let VAT = { name: 'Service Tax', value: ROPrintData.OverAllLaborTaxAmount };
|
|
628
|
+
// let TotalPartsAmount = { name: 'Final Labor Amount', value: this.LabourtotalAmount(ROPrintData.LaborInsTotal) };
|
|
629
|
+
AccountFields.push(LaborTotal);
|
|
630
|
+
// if (!TrUtils.IsNull(ROPrintData.OverAllLaborDiscount) && ROPrintData.OverAllLaborDiscount !== 0) {
|
|
631
|
+
AccountFields.push(Disc);
|
|
632
|
+
// }
|
|
633
|
+
AccountFields.push(VAT);
|
|
634
|
+
// AccountFields.push(TotalPartsAmount);
|
|
635
|
+
}
|
|
636
|
+
else {
|
|
637
|
+
let LaborTotal = { name: 'Labor Total', value: ROPrintData.BasicLaborTotal };
|
|
638
|
+
let Disc = { name: 'Labor Discount', value: ROPrintData.OverAllLaborDiscount };
|
|
639
|
+
let VAT = { name: 'Service Tax ', value: ROPrintData.OverAllLaborTaxAmount };
|
|
640
|
+
// let TotalPartsAmount = { name: 'Final Labor Amount', value: this.LabourtotalAmount(ROPrintData.LaborTotal) }
|
|
641
|
+
AccountFields.push(LaborTotal);
|
|
642
|
+
// if (!TrUtils.IsNull(ROPrintData.OverAllLaborDiscount) && ROPrintData.OverAllLaborDiscount !== 0) {
|
|
643
|
+
AccountFields.push(Disc);
|
|
644
|
+
// }
|
|
645
|
+
AccountFields.push(VAT);
|
|
646
|
+
// AccountFields.push(TotalPartsAmount);
|
|
647
|
+
}
|
|
648
|
+
return {
|
|
649
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
650
|
+
lineHeight: 1,
|
|
651
|
+
fontSize: this.SubHeaderSize,
|
|
652
|
+
marginBottom: 5,
|
|
653
|
+
table: {
|
|
654
|
+
body: this.GetDataTable(AccountFields, true)
|
|
655
|
+
},
|
|
656
|
+
layout: 'noBorders',
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
//Not Use This Function any where
|
|
660
|
+
static PartsTotalTables(ROPrintData) {
|
|
661
|
+
let AccountFields = [];
|
|
662
|
+
if (ROPrintData.For === enums_1.PayTypeEnum.Insurance) {
|
|
663
|
+
let PartsTotal = { name: 'Parts Total', value: ROPrintData.BasicPartsTotal };
|
|
664
|
+
let Disc = { name: 'Parts Discount', value: ROPrintData.OverAllPartsDiscount };
|
|
665
|
+
let VAT = { name: 'Parts Tax', value: ROPrintData.OverAllPartsTaxAmount };
|
|
666
|
+
// let TotalPartsAmount = { name: 'Final Parts Amount', value: this.PartstotalAmount(ROPrintData.PartsInsTotal)};
|
|
667
|
+
AccountFields.push(PartsTotal);
|
|
668
|
+
AccountFields.push(Disc);
|
|
669
|
+
AccountFields.push(VAT);
|
|
670
|
+
// AccountFields.push(TotalPartsAmount);
|
|
671
|
+
}
|
|
672
|
+
else {
|
|
673
|
+
let PartsTotal = { name: 'Parts Total', value: ROPrintData.BasicPartsTotal };
|
|
674
|
+
let Disc = { name: 'Parts Discount', value: ROPrintData.OverAllPartsDiscount };
|
|
675
|
+
let VAT = { name: 'Parts Tax', value: ROPrintData.OverAllPartsTaxAmount };
|
|
676
|
+
// let TotalPartsAmount = { name: 'Final Parts Amount', value: this.PartstotalAmount(ROPrintData.PartsTotal) }
|
|
677
|
+
AccountFields.push(PartsTotal);
|
|
678
|
+
AccountFields.push(Disc);
|
|
679
|
+
AccountFields.push(VAT);
|
|
680
|
+
// AccountFields.push(TotalPartsAmount);
|
|
681
|
+
}
|
|
682
|
+
return {
|
|
683
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
684
|
+
lineHeight: 1,
|
|
685
|
+
fontSize: this.SubHeaderSize,
|
|
686
|
+
marginBottom: 5,
|
|
687
|
+
table: {
|
|
688
|
+
body: this.GetDataTable(AccountFields, true)
|
|
689
|
+
},
|
|
690
|
+
layout: 'noBorders',
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
static GetDataTable(data, istotal) {
|
|
694
|
+
var body = [];
|
|
695
|
+
data.forEach((row) => {
|
|
696
|
+
// if ((!TrUtils.IsFixedZero(row.value) && !TrUtils.IsNull(row.value)) || row.name === 'Total') {
|
|
697
|
+
if (tr_utils_1.TrUtils.IsNull(row.value)) {
|
|
698
|
+
row.value = '';
|
|
699
|
+
}
|
|
700
|
+
var dataRow = [];
|
|
701
|
+
if (row.name === 'Labor' || row.name === 'Parts') {
|
|
702
|
+
dataRow.push({ text: [{ text: row.name, bold: 'true' }, ' Total(Before Tax)'] });
|
|
703
|
+
}
|
|
704
|
+
else {
|
|
705
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true });
|
|
706
|
+
}
|
|
707
|
+
dataRow.push(':');
|
|
708
|
+
if (row.name === 'Vehicle') {
|
|
709
|
+
dataRow.push({ text: (row.value).toString(), width: 'auto', lineHeight: 1 });
|
|
710
|
+
}
|
|
711
|
+
else {
|
|
712
|
+
if (istotal) {
|
|
713
|
+
dataRow.push({ text: (row.value).toString(), noWrap: true, alignment: 'right' });
|
|
714
|
+
}
|
|
715
|
+
else {
|
|
716
|
+
dataRow.push({ text: (row.value).toString(), noWrap: true, bold: row.bold });
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
body.push(dataRow);
|
|
720
|
+
// }
|
|
721
|
+
// else {
|
|
722
|
+
// var a: any = [];
|
|
723
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
724
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
725
|
+
// a.push({ text: '', lineHeight: 0.1 });
|
|
726
|
+
// body.push(a);
|
|
727
|
+
// }
|
|
728
|
+
});
|
|
729
|
+
return body;
|
|
730
|
+
}
|
|
731
|
+
static GetCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS) {
|
|
732
|
+
return {
|
|
733
|
+
style: 'textcust',
|
|
734
|
+
marginLeft: 5,
|
|
735
|
+
columns: [
|
|
736
|
+
this.GetCustomer(Customer, Type, For, Vehicle, Settings, 'Bill To', isOtherIndustry),
|
|
737
|
+
this.GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry),
|
|
738
|
+
this.GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)
|
|
739
|
+
],
|
|
740
|
+
};
|
|
741
|
+
}
|
|
742
|
+
static GetReceiptCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry) {
|
|
743
|
+
return {
|
|
744
|
+
style: 'textcust',
|
|
745
|
+
marginLeft: 5,
|
|
746
|
+
columns: [
|
|
747
|
+
this.GetReceiptCustomer(Customer, Type, For, Vehicle, Settings, 'Patient Name & Address', isOtherIndustry),
|
|
748
|
+
this.GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry),
|
|
749
|
+
this.GetReceiptVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry)
|
|
750
|
+
],
|
|
751
|
+
};
|
|
752
|
+
}
|
|
753
|
+
static GetSOCustomerAndOthDetails(Id, CrDate, PrDate, PrintType, For, SurName, SurPhone, Type, SurEmail, Shipment, PolNo, PolType, Customer, DoS, RefNo, IsPackage, PackId, PackedDate, ShipId, ShippedDate) {
|
|
754
|
+
return {
|
|
755
|
+
style: 'textcust',
|
|
756
|
+
marginLeft: 5,
|
|
757
|
+
stack: [{
|
|
758
|
+
columns: [{ text: 'SO# : ' + this.CheckAndSetString(Id) },
|
|
759
|
+
{ text: 'Date : ' + this.CheckAndSetString(CrDate) },
|
|
760
|
+
{ text: 'Place Of Supply : ' + this.GetStateName(DoS) }]
|
|
761
|
+
},
|
|
762
|
+
this.CustomerDetails(Customer, Type, For, null, null, Shipment)],
|
|
763
|
+
};
|
|
764
|
+
}
|
|
765
|
+
static CustomerDetails(Customer, Type, For, Vehicle, Settings, Shipment) {
|
|
766
|
+
return {
|
|
767
|
+
columns: [
|
|
768
|
+
this.GetCustomerSO(Customer, Type, For, null, null, 'Bill To'),
|
|
769
|
+
this.GetCustomerSO(Shipment, Type, For, null, null, 'Ship To'),
|
|
770
|
+
// this.GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType),
|
|
771
|
+
// this.GetOtherDtails(Type, Id, CrDate, PrDate, PrintType, Settings, RefNo, IsPackage, PackId, PackedDate, ShipId, ShippedDate)
|
|
772
|
+
], marginTop: 10
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
static GetCustomerSO(Customer, Type, For, Vehicle, Settings, Headding) {
|
|
776
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 300, marginLeft: 4 };
|
|
777
|
+
}
|
|
778
|
+
static GetOwnerDetails(Customer, Type, For) {
|
|
779
|
+
if (For === enums_1.PayTypeEnum.Insurance && Type === 'Invoice') {
|
|
780
|
+
return {
|
|
781
|
+
style: 'colum1',
|
|
782
|
+
stack: [this.GetUnderLine(),
|
|
783
|
+
{
|
|
784
|
+
columns: [{ text: 'Owner Details : ', style: 'hed', width: 70 },
|
|
785
|
+
{ text: Customer.Name },
|
|
786
|
+
{ text: this.GetAddress(Customer), },
|
|
787
|
+
this.GetCustPhoneNumber(Customer, Type), this.GetCustomerGSTIN(Customer)], margin: [0, 5, 0, 5],
|
|
788
|
+
}
|
|
789
|
+
]
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
else {
|
|
793
|
+
return this.emptyObject();
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
static GetReceiptCustomer(Customer, Type, For, Vehicle, Settings, Headding, isOtherIndustry) {
|
|
797
|
+
return { stack: [this.GetReceiptCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 170, marginLeft: 2 };
|
|
798
|
+
}
|
|
799
|
+
static GetReceiptCustomerDetails(Customer, Type, Vehicle, Settings, CustHeader) {
|
|
800
|
+
if (tr_utils_1.TrUtils.IsNull(Customer)) {
|
|
801
|
+
return this.emptyObject();
|
|
802
|
+
}
|
|
803
|
+
return {
|
|
804
|
+
style: 'colum1',
|
|
805
|
+
stack: [{ text: CustHeader + ':', style: 'hed' },
|
|
806
|
+
{ text: Customer.Name, marginTop: 2 },
|
|
807
|
+
{ text: this.GetAddress(Customer), marginTop: 3 },
|
|
808
|
+
this.GetCustPhoneNumber(Customer, Type), this.GetCustomerGSTIN(Customer),
|
|
809
|
+
{ text: 'Doctor : ' + Customer.Doctor, marginTop: 2 },]
|
|
810
|
+
};
|
|
811
|
+
}
|
|
812
|
+
static GetCustomer(Customer, Type, For, Vehicle, Settings, Headding, isOtherIndustry) {
|
|
813
|
+
if (For === enums_1.PayTypeEnum.Insurance || isOtherIndustry) {
|
|
814
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 170, marginLeft: 2 };
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 230, marginLeft: 4 };
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
static GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry) {
|
|
821
|
+
if (isOtherIndustry || ((For === enums_1.PayTypeEnum.Insurance) && Type !== 'Invoice')) {
|
|
822
|
+
return { stack: [this.GetInsurenceDetails(For, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType, Type, Location, isOtherIndustry)], width: 210, marginRight: 2 };
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
return { text: '', width: 70 };
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
static GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS) {
|
|
829
|
+
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
830
|
+
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: 200 };
|
|
831
|
+
}
|
|
832
|
+
else {
|
|
833
|
+
return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: 250 };
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
static GetReceiptVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry) {
|
|
837
|
+
// if (For === PayTypeEnum.Insurance) {
|
|
838
|
+
// return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry)], width: 200 };
|
|
839
|
+
// } else {
|
|
840
|
+
return { stack: [this.GetReceiptVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry)], width: 250 };
|
|
841
|
+
// }
|
|
842
|
+
}
|
|
843
|
+
static GetReceiptVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry) {
|
|
844
|
+
let id;
|
|
845
|
+
let vehicleData;
|
|
846
|
+
vehicleData = [
|
|
847
|
+
{ name: 'Bill#', value: this.CheckAndSetString(Id) },
|
|
848
|
+
{ name: 'Date', value: this.CheckAndSetString(CrDate) }
|
|
849
|
+
];
|
|
850
|
+
return this.GetVehicleDataTable(vehicleData);
|
|
851
|
+
}
|
|
852
|
+
static GetInsurenceDetails(For, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType, Type, Location, isOtherIndustry) {
|
|
853
|
+
let InsuranceFields = [
|
|
854
|
+
{ name: 'Name', value: SurName },
|
|
855
|
+
{ name: 'Phone', value: SurPhone },
|
|
856
|
+
{ name: 'Email', value: SurEmail }
|
|
857
|
+
];
|
|
858
|
+
if (!isOtherIndustry && For === enums_1.PayTypeEnum.Insurance) {
|
|
859
|
+
return {
|
|
860
|
+
columns: [
|
|
861
|
+
{
|
|
862
|
+
stack: [
|
|
863
|
+
this.GetInsuranceDetailsTable(InsuranceFields, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType),
|
|
864
|
+
// this.getServeyorEmail(RepairOrder),
|
|
865
|
+
]
|
|
866
|
+
}
|
|
867
|
+
]
|
|
868
|
+
};
|
|
869
|
+
}
|
|
870
|
+
else if (isOtherIndustry) {
|
|
871
|
+
let Head = (Type !== 'Invoice' && Type !== 'SalesReceipt') ? 'Service Location' : 'Ship To';
|
|
872
|
+
return {
|
|
873
|
+
columns: [
|
|
874
|
+
{
|
|
875
|
+
stack: [
|
|
876
|
+
this.GetCustomerDetails(Location, 'Sales Order', null, null, Head),
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
]
|
|
880
|
+
};
|
|
881
|
+
}
|
|
882
|
+
else {
|
|
883
|
+
return this.emptyObject();
|
|
884
|
+
}
|
|
885
|
+
}
|
|
886
|
+
static GetInsuranceDetailsTable(InsuranceFields, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType) {
|
|
887
|
+
var List = [];
|
|
888
|
+
if (tr_utils_1.TrUtils.CheckInvalidSelect(PolType)) {
|
|
889
|
+
PolType = null;
|
|
890
|
+
}
|
|
891
|
+
List.push(this.InsCompany(InsComp), { text: InsComp, marginTop: 5 }, this.GetPolicyInfo(PolNo, PolType), this.GetSurveyor(SurName, SurPhone, SurEmail), this.GetInsuranceDetails(InsuranceFields));
|
|
892
|
+
return List;
|
|
893
|
+
}
|
|
894
|
+
static GetPolicyInfo(PolNo, PolType) {
|
|
895
|
+
let isFieldThere = false;
|
|
896
|
+
let InsuranceFields = [
|
|
897
|
+
{ name: 'Policy No', value: PolNo },
|
|
898
|
+
{ name: 'Policy Type', value: PolType },
|
|
899
|
+
];
|
|
900
|
+
for (let i = 0; i < InsuranceFields.length; i++) {
|
|
901
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InsuranceFields[i].value)) {
|
|
902
|
+
isFieldThere = true;
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
if (isFieldThere) {
|
|
906
|
+
return {
|
|
907
|
+
fontSize: this.BodySize,
|
|
908
|
+
lineHeight: 0.7,
|
|
909
|
+
table: {
|
|
910
|
+
body: this.GetInsuranceTable(InsuranceFields)
|
|
911
|
+
},
|
|
912
|
+
layout: 'noBorders',
|
|
913
|
+
};
|
|
914
|
+
}
|
|
915
|
+
else {
|
|
916
|
+
return this.emptyObject();
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
static GetSurveyor(SurName, SurPhone, SurEmail) {
|
|
920
|
+
if (SurName || SurEmail || SurName) {
|
|
921
|
+
return { text: 'Surveyor :', bold: true, fontSize: this.SubHeaderSize, marginTop: 2 };
|
|
922
|
+
}
|
|
923
|
+
else {
|
|
924
|
+
return this.emptyObject();
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
static emptyObject() {
|
|
928
|
+
let a = {};
|
|
929
|
+
return a;
|
|
930
|
+
}
|
|
931
|
+
static InsCompany(InsComp) {
|
|
932
|
+
if (InsComp) {
|
|
933
|
+
return { text: 'Insurance Company :', bold: true, fontSize: this.SubHeaderSize };
|
|
934
|
+
}
|
|
935
|
+
else {
|
|
936
|
+
return this.emptyObject();
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
static GetInsuranceDetails(data) {
|
|
940
|
+
return {
|
|
941
|
+
fontSize: this.BodySize,
|
|
942
|
+
lineHeight: 0.7,
|
|
943
|
+
// widths:['*','*',10],
|
|
944
|
+
table: {
|
|
945
|
+
body: this.GetInsuranceTable(data)
|
|
946
|
+
},
|
|
947
|
+
layout: 'noBorders',
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
static GetInsuranceTable(data) {
|
|
951
|
+
var body = [];
|
|
952
|
+
data.forEach((row) => {
|
|
953
|
+
if (!tr_utils_1.TrUtils.IsEmpty(row.value)) {
|
|
954
|
+
var dataRow = [];
|
|
955
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true });
|
|
956
|
+
dataRow.push(':');
|
|
957
|
+
dataRow.push({ text: (row.value).toString(), lineHeight: 0.8 });
|
|
958
|
+
body.push(dataRow);
|
|
959
|
+
}
|
|
960
|
+
else {
|
|
961
|
+
var a = [];
|
|
962
|
+
a.push('');
|
|
963
|
+
a.push('');
|
|
964
|
+
a.push('');
|
|
965
|
+
body.push(a);
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
return body;
|
|
969
|
+
}
|
|
970
|
+
static GetCustomerDetails(Customer, Type, Vehicle, Settings, CustHeader) {
|
|
971
|
+
if (tr_utils_1.TrUtils.IsNull(Customer)) {
|
|
972
|
+
return this.emptyObject();
|
|
973
|
+
}
|
|
974
|
+
let Data = [{ text: CustHeader + ':', style: 'hed' },
|
|
975
|
+
{ text: Customer.Name, marginTop: 2 },
|
|
976
|
+
{ text: this.GetAddress(Customer), marginTop: 3 },
|
|
977
|
+
this.GetCustPhoneNumber(Customer, Type), this.GetCustomerGSTIN(Customer), this.GetCustomerDLNo(Customer),
|
|
978
|
+
,
|
|
979
|
+
this.GetCustomerName(Customer.CustName)];
|
|
980
|
+
// if(!TrUtils.IsNull(Customer.CustName)){
|
|
981
|
+
// Data.splice(1,0,{ text: Customer.CustName, marginTop: 2 });
|
|
982
|
+
// Data.splice(2,0,{ text: 'Bill To :', style: 'hed', marginTop: 2 });
|
|
983
|
+
// }
|
|
984
|
+
return {
|
|
985
|
+
style: 'colum1',
|
|
986
|
+
stack: Data
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
static GetNameAndAddress(RepairOrder) {
|
|
990
|
+
if (RepairOrder.Type === 'Invoice' || RepairOrder.Type === 'SalesReceipt') {
|
|
991
|
+
if (RepairOrder.AsInsuranceBilling) {
|
|
992
|
+
return 'Insurance Company Name & Address:';
|
|
993
|
+
}
|
|
994
|
+
else {
|
|
995
|
+
return 'Customer Name & Address:';
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
else {
|
|
999
|
+
if (RepairOrder.Type === 'Sales Order') {
|
|
1000
|
+
return 'Location:';
|
|
1001
|
+
}
|
|
1002
|
+
else {
|
|
1003
|
+
return 'Customer Name & Address:';
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
}
|
|
1007
|
+
static GetCustomerName(Customer) {
|
|
1008
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Customer)) {
|
|
1009
|
+
let GSTIN = { columns: [{ text: 'Customer Name :', width: 65, bold: true }, { text: Customer }] };
|
|
1010
|
+
return GSTIN;
|
|
1011
|
+
}
|
|
1012
|
+
else {
|
|
1013
|
+
return this.emptyObject();
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
static GetCustomerGSTIN(Customer) {
|
|
1017
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Customer.GSTIN)) {
|
|
1018
|
+
let GSTIN = { columns: [{ text: 'GSTIN :', width: 33, style: 'hed' }, { text: Customer.GSTIN, marginTop: 1.5 }] };
|
|
1019
|
+
return GSTIN;
|
|
1020
|
+
}
|
|
1021
|
+
else {
|
|
1022
|
+
return this.emptyObject();
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
static GetCustomerDLNo(Customer) {
|
|
1026
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Customer.DLNo)) {
|
|
1027
|
+
let GSTIN = { columns: [{ text: 'DL No :', width: 33, style: 'hed' }, { text: Customer.DLNo, marginTop: 1.5 }] };
|
|
1028
|
+
return GSTIN;
|
|
1029
|
+
}
|
|
1030
|
+
else {
|
|
1031
|
+
return this.emptyObject();
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
// static GetPlaceofSupply(Vehicle: any, Settings: any) {
|
|
1035
|
+
// if (!TrUtils.IsNull(Vehicle) && !TrUtils.IsNull(Settings) && Settings.Tax === 'TI' &&
|
|
1036
|
+
// !TrUtils.IsNull(Settings.PoS) && !TrUtils.IsEmpty(Settings.PoS.Name)) {
|
|
1037
|
+
// let PoS = { columns: [{ text: 'Place Of Supply :', width: 75, style: 'hed' }, { text: this.GetStateName(Settings.PoS), marginTop: 1.5 }] };
|
|
1038
|
+
// return PoS;
|
|
1039
|
+
// } else {
|
|
1040
|
+
// return this.emptyObject();
|
|
1041
|
+
// }
|
|
1042
|
+
// }
|
|
1043
|
+
static GetCustPhoneNumber(Customer, Type) {
|
|
1044
|
+
if (Type !== 'Technician Copy') {
|
|
1045
|
+
var contact = this.GetFormatContact(Customer);
|
|
1046
|
+
if (contact.length !== 0) {
|
|
1047
|
+
return { columns: [{ text: 'Phone', width: 27, style: 'hed' }, contact] };
|
|
1048
|
+
}
|
|
1049
|
+
else {
|
|
1050
|
+
return this.emptyObject();
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
return this.emptyObject();
|
|
1055
|
+
}
|
|
1056
|
+
}
|
|
1057
|
+
static GetAddress(Customer) {
|
|
1058
|
+
var Address = this.GetFormatAddress(Customer);
|
|
1059
|
+
if (Address.length !== 5) {
|
|
1060
|
+
return Address;
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
let a = '';
|
|
1064
|
+
return a;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
static GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS) {
|
|
1068
|
+
let id;
|
|
1069
|
+
let vehicleData;
|
|
1070
|
+
if (Type === 'Work Order' || Type === 'Technician Copy') {
|
|
1071
|
+
id = 'WO#';
|
|
1072
|
+
}
|
|
1073
|
+
else if (Type === 'SalesOrder') {
|
|
1074
|
+
id = 'SO#';
|
|
1075
|
+
}
|
|
1076
|
+
else if (Type === 'Sales Estimate') {
|
|
1077
|
+
id = 'Estimate#';
|
|
1078
|
+
}
|
|
1079
|
+
else if (Type === 'Debit Notes') {
|
|
1080
|
+
id = 'Debit Note#';
|
|
1081
|
+
}
|
|
1082
|
+
else if (Type === 'Credit Notes') {
|
|
1083
|
+
id = 'Credit Note#';
|
|
1084
|
+
}
|
|
1085
|
+
else if (Type === 'Delivery Challan') {
|
|
1086
|
+
id = 'Delivery Challan#';
|
|
1087
|
+
}
|
|
1088
|
+
else if (Type === 'Invoice' || Type === 'Tax Invoice' || Type === 'SalesReceipt') {
|
|
1089
|
+
id = 'Invoice#';
|
|
1090
|
+
}
|
|
1091
|
+
else {
|
|
1092
|
+
id = 'Estimate#';
|
|
1093
|
+
}
|
|
1094
|
+
if (PrintType === 'Parts Order' || tr_utils_1.TrUtils.IsNull(Vehicle)) {
|
|
1095
|
+
vehicleData = [
|
|
1096
|
+
{ name: id, value: this.CheckAndSetString(Id), bold: true },
|
|
1097
|
+
{ name: 'Date', value: this.CheckAndSetString(CrDate) }
|
|
1098
|
+
];
|
|
1099
|
+
if (!tr_utils_1.TrUtils.IsNull(AdmNo)) {
|
|
1100
|
+
vehicleData.push({ name: 'Admission No', value: AdmNo });
|
|
1101
|
+
}
|
|
1102
|
+
if (!tr_utils_1.TrUtils.IsNull(Settings) && Settings.Tax === 'TI' && !tr_utils_1.TrUtils.IsNull(DoS) && !tr_utils_1.TrUtils.IsEmpty(DoS.Name)) {
|
|
1103
|
+
vehicleData.push({ name: 'Place Of Supply', value: this.GetStateName(DoS) });
|
|
1104
|
+
}
|
|
1105
|
+
if (Type === 'Delivery Challan' || isOtherIndustry) {
|
|
1106
|
+
if (Type === 'Delivery Challan') {
|
|
1107
|
+
vehicleData.push({ name: 'Challan Type', value: '' });
|
|
1108
|
+
}
|
|
1109
|
+
else {
|
|
1110
|
+
vehicleData.push({ name: 'Ref. No', value: BL === null || BL === void 0 ? void 0 : BL.RefNo });
|
|
1111
|
+
}
|
|
1112
|
+
vehicleData.push({ name: 'Carrier Name/Agent', value: BL === null || BL === void 0 ? void 0 : BL.Cour });
|
|
1113
|
+
vehicleData.push({ name: 'Bill of Lading/LR-RR No', value: BL === null || BL === void 0 ? void 0 : BL.No });
|
|
1114
|
+
vehicleData.push({ name: 'Motor Vehicle No ', value: BL === null || BL === void 0 ? void 0 : BL.VNo });
|
|
1115
|
+
vehicleData.push({ name: 'E-Way Bill No', value: BL === null || BL === void 0 ? void 0 : BL.EWay });
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
else {
|
|
1119
|
+
vehicleData = [
|
|
1120
|
+
{ name: id, value: this.CheckAndSetString(Id) },
|
|
1121
|
+
{ name: 'Date', value: this.CheckAndSetString(CrDate) }
|
|
1122
|
+
];
|
|
1123
|
+
if (!tr_utils_1.TrUtils.IsNull(PrDate) && Type !== 'Invoice' && Type !== 'Estimate' && Type !== 'Supplementary Estimate' && Type !== 'Tax Invoice') {
|
|
1124
|
+
vehicleData.push({ name: 'Delivery Date', value: this.CheckAndSetString(PrDate) });
|
|
1125
|
+
}
|
|
1126
|
+
// if (!TrUtils.IsNull(Settings) && Settings.Tax === 'TI' && !TrUtils.IsNull(Settings.PoS) && !TrUtils.IsEmpty(Settings.PoS.Name)) {
|
|
1127
|
+
// vehicleData.push({ name: 'Place Of Supply', value: this.GetStateName(Settings.PoS) });
|
|
1128
|
+
// }
|
|
1129
|
+
if (isOtherIndustry) {
|
|
1130
|
+
vehicleData.push({ name: 'Serial No', value: this.CheckAndSetString(Vehicle.SNo) });
|
|
1131
|
+
}
|
|
1132
|
+
else {
|
|
1133
|
+
vehicleData.push({ name: 'Regn. No', value: this.CheckAndSetString(Vehicle.RegNo) });
|
|
1134
|
+
if (Type === 'Invoice' && !IsProforma) {
|
|
1135
|
+
vehicleData.push({ name: 'Mileage', value: this.CheckAndSetString(MOut) });
|
|
1136
|
+
}
|
|
1137
|
+
else {
|
|
1138
|
+
vehicleData.push({ name: 'Mileage', value: this.CheckAndSetString(MIn) });
|
|
1139
|
+
}
|
|
1140
|
+
if (Type === 'Invoice' && !tr_utils_1.TrUtils.IsNull(TypeName)) {
|
|
1141
|
+
vehicleData.push({ name: 'RO Type', value: TypeName });
|
|
1142
|
+
}
|
|
1143
|
+
if (Type === 'Invoice' && !tr_utils_1.TrUtils.IsNull(ROCode)) {
|
|
1144
|
+
vehicleData.push({ name: 'RO#', value: ROCode });
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
let Product;
|
|
1148
|
+
let ProdType = 'Equipment';
|
|
1149
|
+
Product = this.CheckAndSetString(Vehicle.Make) + ' ' + this.CheckAndSetString(Vehicle.Model);
|
|
1150
|
+
if (!isOtherIndustry) {
|
|
1151
|
+
ProdType = 'Vehicle';
|
|
1152
|
+
Product = Product + ' ' + this.CheckAndSetString(Vehicle.Var);
|
|
1153
|
+
}
|
|
1154
|
+
let a = [
|
|
1155
|
+
{ name: ProdType, value: Product },
|
|
1156
|
+
];
|
|
1157
|
+
if (!isOtherIndustry) {
|
|
1158
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Vehicle.VIN)) {
|
|
1159
|
+
a.push({ name: 'Chassis No', value: this.CheckAndSetString(Vehicle.VIN) });
|
|
1160
|
+
}
|
|
1161
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Vehicle.EngNo)) {
|
|
1162
|
+
a.push({ name: 'Engine No', value: this.CheckAndSetString(Vehicle.EngNo) });
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
for (let i = 0; i < a.length; i++) {
|
|
1166
|
+
vehicleData.push(a[i]);
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
return this.GetVehicleDataTable(vehicleData);
|
|
1170
|
+
}
|
|
1171
|
+
static GetStateName(PlaceofSupply) {
|
|
1172
|
+
if (tr_utils_1.TrUtils.IsNull(PlaceofSupply)) {
|
|
1173
|
+
return '';
|
|
1174
|
+
}
|
|
1175
|
+
let supplyName = PlaceofSupply.Name + ' (' + PlaceofSupply.GCode + ')';
|
|
1176
|
+
return supplyName;
|
|
1177
|
+
}
|
|
1178
|
+
static GetOtherDtails(Type, Id, CrDate, PrDate, PrintType, Settings, RefNo, IsPackage, PackId, PackedDate, ShipId, ShippedDate) {
|
|
1179
|
+
let id;
|
|
1180
|
+
let vehicleData;
|
|
1181
|
+
if (Type === 'SalesOrder') {
|
|
1182
|
+
id = 'SO#';
|
|
1183
|
+
}
|
|
1184
|
+
else {
|
|
1185
|
+
id = 'Estimate#';
|
|
1186
|
+
}
|
|
1187
|
+
if (PrintType === 'Parts Order') {
|
|
1188
|
+
vehicleData = [
|
|
1189
|
+
{ name: id, value: this.CheckAndSetString(Id) },
|
|
1190
|
+
{ name: 'Date', value: this.CheckAndSetString(CrDate) }
|
|
1191
|
+
];
|
|
1192
|
+
}
|
|
1193
|
+
else {
|
|
1194
|
+
vehicleData = [
|
|
1195
|
+
{ name: id, value: this.CheckAndSetString(Id) },
|
|
1196
|
+
{ name: 'Date', value: this.CheckAndSetString(CrDate) }
|
|
1197
|
+
];
|
|
1198
|
+
if (!tr_utils_1.TrUtils.IsNull(Settings) && Settings.Tax === 'TI' && !tr_utils_1.TrUtils.IsNull(Settings.PoS) && !tr_utils_1.TrUtils.IsEmpty(Settings.PoS.Name)) {
|
|
1199
|
+
vehicleData.push({ name: 'Place Of Supply', value: this.GetStateName(Settings.PoS) });
|
|
1200
|
+
}
|
|
1201
|
+
if (!tr_utils_1.TrUtils.IsNull(RefNo)) {
|
|
1202
|
+
vehicleData.push({ name: 'Reference#', value: RefNo });
|
|
1203
|
+
}
|
|
1204
|
+
if (IsPackage) {
|
|
1205
|
+
if (!tr_utils_1.TrUtils.IsNull(PackId)) {
|
|
1206
|
+
vehicleData.push({ name: 'Package#', value: PackId });
|
|
1207
|
+
}
|
|
1208
|
+
if (!tr_utils_1.TrUtils.IsNull(PackedDate)) {
|
|
1209
|
+
vehicleData.push({ name: 'Packed Date', value: this.CheckAndSetString(PackedDate) });
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
else {
|
|
1213
|
+
if (!tr_utils_1.TrUtils.IsNull(ShipId)) {
|
|
1214
|
+
vehicleData.push({ name: 'Shipment#', value: ShipId });
|
|
1215
|
+
}
|
|
1216
|
+
if (!tr_utils_1.TrUtils.IsNull(ShippedDate)) {
|
|
1217
|
+
vehicleData.push({ name: 'Shipped Date', value: this.CheckAndSetString(ShippedDate) });
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
// if (!TrUtils.IsNull(PrDate) && Type !== 'Invoice' && Type !== 'Tax Invoice') {
|
|
1221
|
+
// vehicleData.push({ name: 'Delivery Date', value: this.CheckAndSetString(PrDate) });
|
|
1222
|
+
// }
|
|
1223
|
+
}
|
|
1224
|
+
return this.GetVehicleDataTable(vehicleData);
|
|
1225
|
+
}
|
|
1226
|
+
static CheckAndSetString(Value) {
|
|
1227
|
+
if (tr_utils_1.TrUtils.IsNull(Value)) {
|
|
1228
|
+
Value = '';
|
|
1229
|
+
}
|
|
1230
|
+
return Value;
|
|
1231
|
+
}
|
|
1232
|
+
static GetVehicleDataTable(vehicleData) {
|
|
1233
|
+
return {
|
|
1234
|
+
lineHeight: 0.7,
|
|
1235
|
+
fontSize: this.BodySize,
|
|
1236
|
+
table: {
|
|
1237
|
+
body: this.GetDataTable(vehicleData, false)
|
|
1238
|
+
},
|
|
1239
|
+
layout: 'noBorders',
|
|
1240
|
+
};
|
|
1241
|
+
}
|
|
1242
|
+
static GetFormatContact(CustomerObj) {
|
|
1243
|
+
var contactnew = '';
|
|
1244
|
+
if (!tr_utils_1.TrUtils.IsNull(CustomerObj.Cons)) {
|
|
1245
|
+
CustomerObj.Cons.forEach((Contact) => {
|
|
1246
|
+
contactnew = contactnew + '(' + Contact.Type + '):' + Contact.No + '\n';
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
return contactnew;
|
|
1250
|
+
}
|
|
1251
|
+
static GetFormatAddress(CustomerObj) {
|
|
1252
|
+
var Addressnew = '';
|
|
1253
|
+
if (!tr_utils_1.TrUtils.IsNull(CustomerObj.Adrs)) {
|
|
1254
|
+
CustomerObj.Adrs.forEach((Adrs) => {
|
|
1255
|
+
Addressnew = Addressnew + Adrs + '\n';
|
|
1256
|
+
});
|
|
1257
|
+
}
|
|
1258
|
+
return Addressnew;
|
|
1259
|
+
}
|
|
1260
|
+
static GetDisplayTable() {
|
|
1261
|
+
return { text: '', fontSize: 10, bold: true, margin: [0, 0, 0, 5] };
|
|
1262
|
+
}
|
|
1263
|
+
static GetHeaders(PrintPartNumber) {
|
|
1264
|
+
let headersNames;
|
|
1265
|
+
if (PrintPartNumber) {
|
|
1266
|
+
headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
|
|
1267
|
+
{ text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
|
|
1268
|
+
{ text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
|
|
1269
|
+
{ text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
|
|
1270
|
+
{ text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'right', },
|
|
1271
|
+
{ text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 }, {},
|
|
1272
|
+
{ text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
|
|
1273
|
+
],
|
|
1274
|
+
[{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'MPN', lineHeight: 0.5 },
|
|
1275
|
+
{ text: '', Field: 'Desc', lineHeight: 0.5 },
|
|
1276
|
+
{ text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
|
|
1277
|
+
{ text: '%', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'percentage', lineHeight: 0.5 },
|
|
1278
|
+
{ text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 },
|
|
1279
|
+
{ text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
|
|
1280
|
+
]];
|
|
1281
|
+
}
|
|
1282
|
+
else {
|
|
1283
|
+
headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 },
|
|
1284
|
+
{ text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.6 },
|
|
1285
|
+
{ text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.6 },
|
|
1286
|
+
{ text: 'Unit Price', style: 'tableheader', rowSpan: 2, alignment: 'right', lineHeight: 0.6 },
|
|
1287
|
+
{ text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.6 }, {},
|
|
1288
|
+
{ text: 'Line Total', rowSpan: 2, style: 'tableheader', lineHeight: 0.6 }
|
|
1289
|
+
],
|
|
1290
|
+
[{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'Desc', lineHeight: 0.5 },
|
|
1291
|
+
{ text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
|
|
1292
|
+
{ text: '%', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'percentage', lineHeight: 0.5 },
|
|
1293
|
+
{ text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 },
|
|
1294
|
+
{ text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
|
|
1295
|
+
]];
|
|
1296
|
+
}
|
|
1297
|
+
return headersNames;
|
|
1298
|
+
}
|
|
1299
|
+
static PartsTaxAmounts1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1300
|
+
if (ShowTaxColumn) {
|
|
1301
|
+
return {
|
|
1302
|
+
stack: [this.AllHSNPartCGSTTaxListTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)]
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
else {
|
|
1306
|
+
return '';
|
|
1307
|
+
}
|
|
1308
|
+
}
|
|
1309
|
+
static PartsTaxAmounts(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1310
|
+
if (ShowTaxColumn) {
|
|
1311
|
+
return {
|
|
1312
|
+
stack: [this.AllHSNPartCGSTTaxListTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)]
|
|
1313
|
+
};
|
|
1314
|
+
}
|
|
1315
|
+
else {
|
|
1316
|
+
return '';
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
static AllHSNPartCGSTTaxListTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1320
|
+
if (ShowIGST) {
|
|
1321
|
+
return {
|
|
1322
|
+
style: 'tableExample',
|
|
1323
|
+
table: {
|
|
1324
|
+
widths: [40, 30, 45, 45],
|
|
1325
|
+
headerRows: 1,
|
|
1326
|
+
body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1327
|
+
},
|
|
1328
|
+
layout: this.HeaderLineStyle(),
|
|
1329
|
+
};
|
|
1330
|
+
}
|
|
1331
|
+
else {
|
|
1332
|
+
return {
|
|
1333
|
+
style: 'tableExample',
|
|
1334
|
+
table: {
|
|
1335
|
+
widths: [50, 25, 45, 25, 45, 50],
|
|
1336
|
+
headerRows: 1,
|
|
1337
|
+
body: this.CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1338
|
+
},
|
|
1339
|
+
layout: this.HeaderLineStyle(),
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
static AllHSNPartCGSTTaxListTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1344
|
+
if (ShowIGST) {
|
|
1345
|
+
return {
|
|
1346
|
+
style: 'tableExample',
|
|
1347
|
+
table: {
|
|
1348
|
+
widths: ['auto', 30, 45, 45],
|
|
1349
|
+
headerRows: 1,
|
|
1350
|
+
body: this.CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1351
|
+
},
|
|
1352
|
+
layout: this.HeaderLineStyle(),
|
|
1353
|
+
};
|
|
1354
|
+
}
|
|
1355
|
+
else {
|
|
1356
|
+
return {
|
|
1357
|
+
style: 'tableExample',
|
|
1358
|
+
table: {
|
|
1359
|
+
widths: ['auto', 20, 20, 45, 45],
|
|
1360
|
+
headerRows: 1,
|
|
1361
|
+
body: this.CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1362
|
+
},
|
|
1363
|
+
layout: this.HeaderLineStyle(),
|
|
1364
|
+
};
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
static AllPartCGSTTaxListTable(PartsTaxInfo, ShowAccParts, ShowTaxColumn) {
|
|
1368
|
+
return {
|
|
1369
|
+
style: 'tableExample',
|
|
1370
|
+
table: {
|
|
1371
|
+
widths: [20, 20, 40, 40],
|
|
1372
|
+
body: this.ALLPartsCGSTTaxListTable(PartsTaxInfo, ShowAccParts, ShowTaxColumn)
|
|
1373
|
+
},
|
|
1374
|
+
layout: this.HeaderLineStyle(),
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
static HeaderLineStyle() {
|
|
1378
|
+
return {
|
|
1379
|
+
hLineWidth: function (i, node) {
|
|
1380
|
+
return (i === 1) ? 0.1 : 0;
|
|
1381
|
+
},
|
|
1382
|
+
vLineWidth: function (i, node) {
|
|
1383
|
+
return (i === 0 || i === node.table.widths.length) ? 0 : 0;
|
|
1384
|
+
},
|
|
1385
|
+
hLineColor: function (i, node) {
|
|
1386
|
+
let color;
|
|
1387
|
+
if (i === 0 || i === node.table.body.length) {
|
|
1388
|
+
color = 'black';
|
|
1389
|
+
}
|
|
1390
|
+
else {
|
|
1391
|
+
if (i === 1) {
|
|
1392
|
+
color = 'lightgray';
|
|
1393
|
+
}
|
|
1394
|
+
else {
|
|
1395
|
+
color = 'lightgray';
|
|
1396
|
+
}
|
|
1397
|
+
}
|
|
1398
|
+
return color;
|
|
1399
|
+
},
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
static CreateHeadingAllPartCGSTTaxList() {
|
|
1403
|
+
let HeaderNames = [{ text: 'GST(%)', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CombinedTaxPercentage' },
|
|
1404
|
+
// { text: 'SGST', style: 'tableheader', fontSize: 6,lineHeight:0.3, Field: 'SGST' },
|
|
1405
|
+
{ text: 'Count', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'PartsCount' },
|
|
1406
|
+
{ text: 'Taxble Value', style: 'tableheader', alignment: 'right', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxableAmount' },
|
|
1407
|
+
{ text: 'Amount', style: 'tableheader', alignment: 'right', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
|
|
1408
|
+
];
|
|
1409
|
+
return HeaderNames;
|
|
1410
|
+
}
|
|
1411
|
+
static ALLPartsCGSTTaxListTable(PartsTaxInfo, ShowAccParts, ShowTaxColumn) {
|
|
1412
|
+
if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
|
|
1413
|
+
var body = [];
|
|
1414
|
+
let columns = this.CreateHeadingAllPartCGSTTaxList();
|
|
1415
|
+
body.push(columns);
|
|
1416
|
+
PartsTaxInfo.forEach((part) => {
|
|
1417
|
+
var dataRow = [];
|
|
1418
|
+
columns.forEach((column) => {
|
|
1419
|
+
if (!tr_utils_1.TrUtils.IsNull(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
1420
|
+
if (column.Field === 'TotalTaxAmount' || column.Field === 'TotalTaxableAmount') {
|
|
1421
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
1422
|
+
}
|
|
1423
|
+
else {
|
|
1424
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center', nowrap: true });
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
else {
|
|
1428
|
+
part[column.Field] = '';
|
|
1429
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
body.push(dataRow);
|
|
1433
|
+
});
|
|
1434
|
+
return body;
|
|
1435
|
+
}
|
|
1436
|
+
else {
|
|
1437
|
+
return [{}];
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
static CreateHeadingAllHSNTaxList(ShowIGST) {
|
|
1441
|
+
let HeaderNames = [{ text: 'HSN', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'HSN' },
|
|
1442
|
+
// { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
|
|
1443
|
+
// { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
|
|
1444
|
+
// { text: 'Count', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'PartsCount' },
|
|
1445
|
+
{ text: 'Taxable Value', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxableAmount' },
|
|
1446
|
+
{ text: 'Amount', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
|
|
1447
|
+
];
|
|
1448
|
+
if (ShowIGST) {
|
|
1449
|
+
HeaderNames.splice(1, 0, { text: 'IGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
|
|
1450
|
+
}
|
|
1451
|
+
else {
|
|
1452
|
+
HeaderNames.splice(1, 0, { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1453
|
+
HeaderNames.splice(2, 0, { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' });
|
|
1454
|
+
}
|
|
1455
|
+
return HeaderNames;
|
|
1456
|
+
}
|
|
1457
|
+
static CreateHeadingAllTaxList(ShowIGST) {
|
|
1458
|
+
let HeaderNames = [
|
|
1459
|
+
// { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
|
|
1460
|
+
// { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
|
|
1461
|
+
// { text: 'Count', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'PartsCount' },
|
|
1462
|
+
{ text: 'Taxable Value', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxableAmount' },
|
|
1463
|
+
{ text: 'Tax Amount', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'TotalTaxAmount' },
|
|
1464
|
+
];
|
|
1465
|
+
if (ShowIGST) {
|
|
1466
|
+
HeaderNames.splice(1, 0, { text: 'IGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
|
|
1467
|
+
HeaderNames.splice(2, 0, { text: 'IGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGSTAmt' });
|
|
1468
|
+
}
|
|
1469
|
+
else {
|
|
1470
|
+
HeaderNames.splice(1, 0, { text: 'CGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1471
|
+
HeaderNames.splice(2, 0, { text: 'CGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGSTAmt' });
|
|
1472
|
+
HeaderNames.splice(3, 0, { text: 'SGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1473
|
+
HeaderNames.splice(4, 0, { text: 'SGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'SGSTAmt' });
|
|
1474
|
+
}
|
|
1475
|
+
return HeaderNames;
|
|
1476
|
+
}
|
|
1477
|
+
static CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1478
|
+
if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
|
|
1479
|
+
var body = [];
|
|
1480
|
+
let columns = this.CreateHeadingAllTaxList(ShowIGST);
|
|
1481
|
+
body.push(columns);
|
|
1482
|
+
PartsTaxInfo.forEach((part) => {
|
|
1483
|
+
var dataRow = [];
|
|
1484
|
+
columns.forEach((column) => {
|
|
1485
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
|
|
1486
|
+
!tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt'
|
|
1487
|
+
|| column.Field === 'TotalTaxAmount') {
|
|
1488
|
+
if (column.Field === 'SGSTLaborAmt') {
|
|
1489
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', opacity: 0.7, nowrap: true, fontSize: 6 });
|
|
1490
|
+
}
|
|
1491
|
+
else {
|
|
1492
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center', opacity: 0.7, nowrap: true, fontSize: 6 });
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
else {
|
|
1496
|
+
part[column.Field] = '';
|
|
1497
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center', opacity: 0.7, fontSize: 6 });
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
body.push(dataRow);
|
|
1501
|
+
});
|
|
1502
|
+
return body;
|
|
1503
|
+
}
|
|
1504
|
+
else {
|
|
1505
|
+
return [{}];
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
static CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1509
|
+
if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
|
|
1510
|
+
var body = [];
|
|
1511
|
+
let columns = this.CreateHeadingAllHSNTaxList(ShowIGST);
|
|
1512
|
+
body.push(columns);
|
|
1513
|
+
PartsTaxInfo.forEach((part) => {
|
|
1514
|
+
var dataRow = [];
|
|
1515
|
+
columns.forEach((column) => {
|
|
1516
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
|
|
1517
|
+
!tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST'
|
|
1518
|
+
|| column.Field === 'TotalTaxAmount') {
|
|
1519
|
+
if (column.Field === 'SGSTLaborAmt') {
|
|
1520
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
1521
|
+
}
|
|
1522
|
+
else {
|
|
1523
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center', nowrap: true });
|
|
1524
|
+
}
|
|
1525
|
+
}
|
|
1526
|
+
else {
|
|
1527
|
+
part[column.Field] = '';
|
|
1528
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
1529
|
+
}
|
|
1530
|
+
});
|
|
1531
|
+
body.push(dataRow);
|
|
1532
|
+
});
|
|
1533
|
+
return body;
|
|
1534
|
+
}
|
|
1535
|
+
else {
|
|
1536
|
+
return [{}];
|
|
1537
|
+
}
|
|
1538
|
+
}
|
|
1539
|
+
static GetHCFinalTotalDetails(RecordData, BasicLaborTotal, OverAllMainLaborDiscount, LCGST, LSGST, LIGST, PIGST, ShowIGST, ShowTaxColumn, BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, PartsTaxInfo, ShowAccParts, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, For, OverAllRecordTotal, Rounded, GrandTotal, ShowDetailedLaborTaxInfo, ShowDetailedPartTaxInfo, istaxable, LaborTotalTax, PartTotalTax, Consolidate, From, Adj, STotal, moreDiscDetails) {
|
|
1540
|
+
let totalDisc;
|
|
1541
|
+
let totalTax;
|
|
1542
|
+
if (!Consolidate) {
|
|
1543
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(LaborTotalTax) + Number(PartTotalTax));
|
|
1544
|
+
if (istaxable) {
|
|
1545
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
|
|
1546
|
+
}
|
|
1547
|
+
else {
|
|
1548
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount) + Number(OverAllRecordDiscount));
|
|
1549
|
+
}
|
|
1550
|
+
}
|
|
1551
|
+
return {
|
|
1552
|
+
columns: [
|
|
1553
|
+
// this.GetTaxOnLabor(BasicLaborTotal, OverAllMainLaborDiscount, LCGST,
|
|
1554
|
+
// LSGST, LIGST, ShowIGST, ShowTaxColumn, ShowDetailedLaborTaxInfo),
|
|
1555
|
+
{ text: '', width: 225 },
|
|
1556
|
+
// {
|
|
1557
|
+
// stack: [
|
|
1558
|
+
// this.GetTaxOnParts(BasicPartsTotal, OverAllMainPartsDiscount, PCGST,
|
|
1559
|
+
// PSGST, ShowAccParts, PIGST, ShowIGST, ShowTaxColumn, ShowDetailedPartTaxInfo, From),
|
|
1560
|
+
// this.PartsTaxAmounts(PartsTaxInfo, ShowAccParts, ShowIGST,
|
|
1561
|
+
// ShowTaxColumn)
|
|
1562
|
+
// ]
|
|
1563
|
+
// },
|
|
1564
|
+
{ text: '', width: 230 },
|
|
1565
|
+
// this.GrandTotal(LaborAfterGST, PartsAfterGST, totalDisc, For, OverAllRecordTotal, Rounded, GrandTotal)
|
|
1566
|
+
this.GrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, STotal, moreDiscDetails)
|
|
1567
|
+
]
|
|
1568
|
+
// columnGap: 40
|
|
1569
|
+
,
|
|
1570
|
+
marginLeft: 10
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
static GetFinalTotalDetails1(RecordData, BasicLaborTotal, OverAllMainLaborDiscount, LCGST, LSGST, LIGST, PIGST, ShowIGST, ShowTaxColumn, BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, PartsTaxInfo, ShowAccParts, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, For, OverAllRecordTotal, Rounded, GrandTotal, ShowDetailedLaborTaxInfo, ShowDetailedPartTaxInfo, istaxable, LaborTotalTax, PartTotalTax, Consolidate, From, Adj, CustLaborTaxGroupDataByPerc, STotal, isAuto, moreDiscDetails) {
|
|
1574
|
+
let totalDisc;
|
|
1575
|
+
let totalTax;
|
|
1576
|
+
if (!Consolidate) {
|
|
1577
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(LaborTotalTax) + Number(PartTotalTax));
|
|
1578
|
+
if (istaxable) {
|
|
1579
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
|
|
1580
|
+
}
|
|
1581
|
+
else {
|
|
1582
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
let serviceName;
|
|
1586
|
+
let itemName;
|
|
1587
|
+
if (isAuto) {
|
|
1588
|
+
serviceName = 'Labor Tax';
|
|
1589
|
+
itemName = 'Parts Tax';
|
|
1590
|
+
}
|
|
1591
|
+
else {
|
|
1592
|
+
serviceName = 'Service Tax';
|
|
1593
|
+
itemName = 'Items Tax';
|
|
1594
|
+
}
|
|
1595
|
+
return {
|
|
1596
|
+
columns: [
|
|
1597
|
+
// this.GetTaxOnLabor(BasicLaborTotal, OverAllMainLaborDiscount, LCGST,
|
|
1598
|
+
// LSGST, LIGST, ShowIGST, ShowTaxColumn, ShowDetailedLaborTaxInfo),
|
|
1599
|
+
// { text: '', width: 10 },
|
|
1600
|
+
{
|
|
1601
|
+
stack: [
|
|
1602
|
+
// this.GetTaxOnParts(BasicPartsTotal, OverAllMainPartsDiscount, PCGST,
|
|
1603
|
+
// PSGST, ShowAccParts, PIGST, ShowIGST, ShowTaxColumn, ShowDetailedPartTaxInfo, From),
|
|
1604
|
+
{ text: (istaxable && CustLaborTaxGroupDataByPerc.length !== 0) ? serviceName : '', fontSize: 7, opacity: 0.8 },
|
|
1605
|
+
this.PartsTaxAmounts1(CustLaborTaxGroupDataByPerc, ShowAccParts, ShowIGST, ShowTaxColumn),
|
|
1606
|
+
{ text: (istaxable && PartsTaxInfo.length !== 0) ? itemName : '', fontSize: 7, opacity: 0.8 },
|
|
1607
|
+
this.PartsTaxAmounts1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1608
|
+
]
|
|
1609
|
+
},
|
|
1610
|
+
// { text: '', width: 60 },
|
|
1611
|
+
// this.GrandTotal(LaborAfterGST, PartsAfterGST, totalDisc, For, OverAllRecordTotal, Rounded, GrandTotal)
|
|
1612
|
+
this.GrandTotal1(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, STotal, moreDiscDetails)
|
|
1613
|
+
]
|
|
1614
|
+
// columnGap: 40
|
|
1615
|
+
,
|
|
1616
|
+
marginLeft: 10
|
|
1617
|
+
};
|
|
1618
|
+
}
|
|
1619
|
+
static GrandTotal1(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, STotal, moreDiscDetails) {
|
|
1620
|
+
let AccountFields = [
|
|
1621
|
+
// { name: 'Labor Total', value: LaborAfterGST },
|
|
1622
|
+
// { name: 'Part Total', value: PartsAfterGST },
|
|
1623
|
+
// { name: 'Total Disc.', value: OverAllRecordDiscount },
|
|
1624
|
+
];
|
|
1625
|
+
if (moreDiscDetails) {
|
|
1626
|
+
if (!tr_utils_1.TrUtils.IsZero(RecordData.PDisc)) {
|
|
1627
|
+
AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc) });
|
|
1628
|
+
}
|
|
1629
|
+
if (!tr_utils_1.TrUtils.IsZero(RecordData.LDisc)) {
|
|
1630
|
+
AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.LDisc) });
|
|
1631
|
+
}
|
|
1632
|
+
if (!tr_utils_1.TrUtils.IsZero(RecordData.Disc)) {
|
|
1633
|
+
AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
else {
|
|
1637
|
+
AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
|
|
1638
|
+
}
|
|
1639
|
+
if (!Consolidate) {
|
|
1640
|
+
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(STotal) });
|
|
1641
|
+
}
|
|
1642
|
+
if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
|
|
1643
|
+
AccountFields.push({ name: 'Total Tax', value: totalTax });
|
|
1644
|
+
}
|
|
1645
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
|
|
1646
|
+
if (Adj > 0) {
|
|
1647
|
+
Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
|
|
1648
|
+
}
|
|
1649
|
+
AccountFields.push({ name: 'Adjust', value: Adj });
|
|
1650
|
+
}
|
|
1651
|
+
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
1652
|
+
let total = {
|
|
1653
|
+
name: 'Total',
|
|
1654
|
+
value: OverAllRecordTotal
|
|
1655
|
+
};
|
|
1656
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
1657
|
+
if (Rounding.value > 0) {
|
|
1658
|
+
Rounding.value = '+' + Rounding.value;
|
|
1659
|
+
}
|
|
1660
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
1661
|
+
AccountFields.push(total);
|
|
1662
|
+
AccountFields.push(Rounding);
|
|
1663
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
1664
|
+
AccountFields.push(FinalTotal);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
else {
|
|
1668
|
+
let total = {
|
|
1669
|
+
name: 'Total',
|
|
1670
|
+
value: OverAllRecordTotal
|
|
1671
|
+
};
|
|
1672
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
1673
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
1674
|
+
if (Rounding.value > 0) {
|
|
1675
|
+
Rounding.value = '+' + Rounding.value;
|
|
1676
|
+
}
|
|
1677
|
+
AccountFields.push(total);
|
|
1678
|
+
AccountFields.push(Rounding);
|
|
1679
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
1680
|
+
AccountFields.push(FinalTotal);
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
return {
|
|
1684
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
1685
|
+
lineHeight: 0.7,
|
|
1686
|
+
marginBottom: 5,
|
|
1687
|
+
width: 'auto',
|
|
1688
|
+
table: {
|
|
1689
|
+
body: this.GrandTotalTable(AccountFields)
|
|
1690
|
+
},
|
|
1691
|
+
layout: 'noBorders'
|
|
1692
|
+
// layout: {
|
|
1693
|
+
// hLineWidth: function (i: any, node: any) {
|
|
1694
|
+
// return (i === 0) ? 1 : 0;
|
|
1695
|
+
// },
|
|
1696
|
+
// vLineWidth: function (i: any, node: any) {
|
|
1697
|
+
// return (i === 0 || i === node.table.body.length) ? 0 : 0;
|
|
1698
|
+
// }
|
|
1699
|
+
// },
|
|
1700
|
+
};
|
|
1701
|
+
}
|
|
1702
|
+
static GetFinalTotalDetails(RecordData, BasicLaborTotal, OverAllMainLaborDiscount, LCGST, LSGST, LIGST, PIGST, ShowIGST, ShowTaxColumn, BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, PartsTaxInfo, ShowAccParts, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, For, OverAllRecordTotal, Rounded, GrandTotal, ShowDetailedLaborTaxInfo, ShowDetailedPartTaxInfo, istaxable, LaborTotalTax, PartTotalTax, Consolidate, From, Adj, STotal, moreDiscDetails) {
|
|
1703
|
+
let totalDisc;
|
|
1704
|
+
let totalTax;
|
|
1705
|
+
if (!Consolidate) {
|
|
1706
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(LaborTotalTax) + Number(PartTotalTax));
|
|
1707
|
+
if (istaxable) {
|
|
1708
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
|
|
1709
|
+
}
|
|
1710
|
+
else {
|
|
1711
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
return {
|
|
1715
|
+
columns: [
|
|
1716
|
+
this.GetTaxOnLabor(BasicLaborTotal, OverAllMainLaborDiscount, LCGST, LSGST, LIGST, ShowIGST, ShowTaxColumn, ShowDetailedLaborTaxInfo, Consolidate),
|
|
1717
|
+
{ text: '', width: 10 },
|
|
1718
|
+
{
|
|
1719
|
+
stack: [
|
|
1720
|
+
this.GetTaxOnParts(BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, ShowAccParts, PIGST, ShowIGST, ShowTaxColumn, ShowDetailedPartTaxInfo, From, Consolidate),
|
|
1721
|
+
this.PartsTaxAmounts(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1722
|
+
]
|
|
1723
|
+
},
|
|
1724
|
+
{ text: '', width: moreDiscDetails ? 40 : 60 },
|
|
1725
|
+
// this.GrandTotal(LaborAfterGST, PartsAfterGST, totalDisc, For, OverAllRecordTotal, Rounded, GrandTotal)
|
|
1726
|
+
this.GrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, STotal, moreDiscDetails)
|
|
1727
|
+
]
|
|
1728
|
+
// columnGap: 40
|
|
1729
|
+
,
|
|
1730
|
+
marginLeft: 10
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
static GetDebitTotalDetails(RecordData, BasicLaborTotal, OverAllMainLaborDiscount, LCGST, LSGST, LIGST, PIGST, ShowIGST, ShowTaxColumn, BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, PartsTaxInfo, ShowAccParts, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, For, OverAllRecordTotal, Rounded, GrandTotal, ShowDetailedLaborTaxInfo, ShowDetailedPartTaxInfo, istaxable, LaborTotalTax, PartTotalTax, Consolidate, From, moreDiscDetails) {
|
|
1734
|
+
let totalDisc;
|
|
1735
|
+
let totalTax;
|
|
1736
|
+
if (!Consolidate) {
|
|
1737
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(PartTotalTax));
|
|
1738
|
+
if (istaxable) {
|
|
1739
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainPartsDiscount));
|
|
1740
|
+
}
|
|
1741
|
+
else {
|
|
1742
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainPartsDiscount));
|
|
1743
|
+
}
|
|
1744
|
+
}
|
|
1745
|
+
return {
|
|
1746
|
+
columns: [
|
|
1747
|
+
// this.GetTaxOnLabor(BasicLaborTotal, OverAllMainLaborDiscount, LCGST,
|
|
1748
|
+
// LSGST, LIGST, ShowIGST, ShowTaxColumn, ShowDetailedLaborTaxInfo),
|
|
1749
|
+
{ text: '', width: 100 },
|
|
1750
|
+
{
|
|
1751
|
+
stack: [
|
|
1752
|
+
this.GetTaxOnParts(BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, ShowAccParts, PIGST, ShowIGST, ShowTaxColumn, ShowDetailedPartTaxInfo, From, Consolidate),
|
|
1753
|
+
this.PartsTaxAmounts(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn)
|
|
1754
|
+
]
|
|
1755
|
+
},
|
|
1756
|
+
{ text: '', width: 100 },
|
|
1757
|
+
{ text: '', width: 80 },
|
|
1758
|
+
this.DebitGrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, moreDiscDetails)
|
|
1759
|
+
]
|
|
1760
|
+
// columnGap: 40
|
|
1761
|
+
,
|
|
1762
|
+
marginLeft: 10
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
static DebitGrandTotal(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, moreDiscDetails) {
|
|
1766
|
+
let AccountFields = [
|
|
1767
|
+
// { name: 'Labor Total', value: LaborAfterGST },
|
|
1768
|
+
// { name: 'Part Total', value: PartsAfterGST },
|
|
1769
|
+
{ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))) },
|
|
1770
|
+
];
|
|
1771
|
+
if (moreDiscDetails) {
|
|
1772
|
+
AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
|
|
1773
|
+
}
|
|
1774
|
+
else {
|
|
1775
|
+
AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
|
|
1776
|
+
}
|
|
1777
|
+
if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
|
|
1778
|
+
AccountFields.push({ name: 'Total Tax', value: totalTax });
|
|
1779
|
+
}
|
|
1780
|
+
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
1781
|
+
let total = {
|
|
1782
|
+
name: 'Total',
|
|
1783
|
+
value: OverAllRecordTotal
|
|
1784
|
+
};
|
|
1785
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
1786
|
+
if (Rounding.value > 0) {
|
|
1787
|
+
Rounding.value = '+' + Rounding.value;
|
|
1788
|
+
}
|
|
1789
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
1790
|
+
AccountFields.push(total);
|
|
1791
|
+
AccountFields.push(Rounding);
|
|
1792
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
1793
|
+
AccountFields.push(FinalTotal);
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
else {
|
|
1797
|
+
let total = {
|
|
1798
|
+
name: 'Total',
|
|
1799
|
+
value: OverAllRecordTotal
|
|
1800
|
+
};
|
|
1801
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
1802
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
1803
|
+
if (Rounding.value > 0) {
|
|
1804
|
+
Rounding.value = '+' + Rounding.value;
|
|
1805
|
+
}
|
|
1806
|
+
AccountFields.push(total);
|
|
1807
|
+
AccountFields.push(Rounding);
|
|
1808
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
1809
|
+
AccountFields.push(FinalTotal);
|
|
1810
|
+
}
|
|
1811
|
+
}
|
|
1812
|
+
return {
|
|
1813
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
1814
|
+
lineHeight: 0.7,
|
|
1815
|
+
marginBottom: 5,
|
|
1816
|
+
fontSize: 7,
|
|
1817
|
+
table: {
|
|
1818
|
+
body: this.GrandTotalTable(AccountFields)
|
|
1819
|
+
},
|
|
1820
|
+
layout: 'noBorders'
|
|
1821
|
+
// layout: {
|
|
1822
|
+
// hLineWidth: function (i: any, node: any) {
|
|
1823
|
+
// return (i === 0) ? 1 : 0;
|
|
1824
|
+
// },
|
|
1825
|
+
// vLineWidth: function (i: any, node: any) {
|
|
1826
|
+
// return (i === 0 || i === node.table.body.length) ? 0 : 0;
|
|
1827
|
+
// }
|
|
1828
|
+
// },
|
|
1829
|
+
};
|
|
1830
|
+
}
|
|
1831
|
+
static GetPOTotalDetails(ROPrintData, moreDiscDetails) {
|
|
1832
|
+
return {
|
|
1833
|
+
columns: [
|
|
1834
|
+
{
|
|
1835
|
+
stack: [
|
|
1836
|
+
this.GetTaxOnParts(ROPrintData.BasicPartsTotal, ROPrintData.OverAllMainPartsDiscount, ROPrintData.PCGST, ROPrintData.PSGST, ROPrintData.PIGST, ROPrintData.ShowIGST, ROPrintData.ShowAccParts, ROPrintData.ShowTaxColumn, ROPrintData.ShowDetailedPartTaxInfo, ROPrintData.Type, ROPrintData.Consolidate),
|
|
1837
|
+
this.PartsTaxAmounts(ROPrintData.PartsTaxInfo, ROPrintData.ShowAccParts, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn)
|
|
1838
|
+
]
|
|
1839
|
+
}, { text: '', width: 200 }, this.GrandTotal(ROPrintData, ROPrintData.LaborAfterGST, ROPrintData.PartsAfterGST, ROPrintData.OverAllRecordDiscount, null, ROPrintData.For, ROPrintData.OverAllRecordTotal, ROPrintData.Rounded, ROPrintData.GrandTotal, ROPrintData.Adj, ROPrintData.Consolidate, null, moreDiscDetails)
|
|
1840
|
+
]
|
|
1841
|
+
// columnGap: 40
|
|
1842
|
+
,
|
|
1843
|
+
marginLeft: 10
|
|
1844
|
+
};
|
|
1845
|
+
}
|
|
1846
|
+
static GetTaxOnParts(BasicPartsTotal, OverAllMainPartsDiscount, PCGST, PSGST, ShowAccParts, PIGST, ShowIGST, ShowTaxColumn, ShowDetailedPartTaxInfo, From, Consolidate) {
|
|
1847
|
+
let istheretax = false;
|
|
1848
|
+
let PartsTotal = [];
|
|
1849
|
+
// if (!TrUtils.IsFixedZero(OverAllMainPartsDiscount)) {
|
|
1850
|
+
// PartsTotal.push({ name: 'Discount On Parts', value: OverAllMainPartsDiscount });
|
|
1851
|
+
// }
|
|
1852
|
+
if (!Consolidate) {
|
|
1853
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(BasicPartsTotal) && (From !== 'Countersale')) {
|
|
1854
|
+
PartsTotal.unshift({ name: 'Parts Total', value: BasicPartsTotal });
|
|
1855
|
+
}
|
|
1856
|
+
}
|
|
1857
|
+
if (!ShowAccParts && ShowTaxColumn && ShowDetailedPartTaxInfo) {
|
|
1858
|
+
if (From === 'Sales' || From === 'Countersale') {
|
|
1859
|
+
if (ShowIGST) {
|
|
1860
|
+
PartsTotal.push({ name: 'IGST', value: PIGST });
|
|
1861
|
+
}
|
|
1862
|
+
else {
|
|
1863
|
+
PartsTotal.push({ name: 'CGST', value: PCGST });
|
|
1864
|
+
PartsTotal.push({ name: 'SGST', value: PSGST });
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
else {
|
|
1868
|
+
if (ShowIGST) {
|
|
1869
|
+
PartsTotal.push({ name: 'IGST On Parts', value: PIGST });
|
|
1870
|
+
}
|
|
1871
|
+
else {
|
|
1872
|
+
PartsTotal.push({ name: 'CGST On Parts', value: PCGST });
|
|
1873
|
+
PartsTotal.push({ name: 'SGST On Parts', value: PSGST });
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
}
|
|
1877
|
+
if (PartsTotal.length !== 0) {
|
|
1878
|
+
return {
|
|
1879
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
1880
|
+
lineHeight: 0.7,
|
|
1881
|
+
fontSize: 7,
|
|
1882
|
+
marginBottom: 5,
|
|
1883
|
+
table: {
|
|
1884
|
+
body: this.GetDataTable(PartsTotal, true)
|
|
1885
|
+
},
|
|
1886
|
+
layout: 'noBorders',
|
|
1887
|
+
};
|
|
1888
|
+
}
|
|
1889
|
+
else {
|
|
1890
|
+
return this.emptyObject();
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
static GetTaxOnLabor(BasicLaborTotal, OverAllMainLaborDiscount, LCGST, LSGST, LIGST, ShowIGST, ShowTaxColumn, ShowDetailedLaborTaxInfo, Consolidate) {
|
|
1894
|
+
let istheretax = false;
|
|
1895
|
+
let LaborTotal = [];
|
|
1896
|
+
// if (!TrUtils.IsFixedZero(OverAllMainLaborDiscount)) {
|
|
1897
|
+
// LaborTotal.push({ name: 'Discount On Labor', value: OverAllMainLaborDiscount });
|
|
1898
|
+
// }
|
|
1899
|
+
//consolidate and no-tax i want show labor discount
|
|
1900
|
+
if (!Consolidate) {
|
|
1901
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(BasicLaborTotal)) {
|
|
1902
|
+
LaborTotal.unshift({ name: 'Labor Total', value: BasicLaborTotal });
|
|
1903
|
+
}
|
|
1904
|
+
}
|
|
1905
|
+
if (ShowTaxColumn && ShowDetailedLaborTaxInfo
|
|
1906
|
+
&& (!tr_utils_1.TrUtils.IsFixedZero(LIGST) || (!tr_utils_1.TrUtils.IsFixedZero(LCGST) || !tr_utils_1.TrUtils.IsFixedZero(LSGST)))) {
|
|
1907
|
+
if (ShowIGST) {
|
|
1908
|
+
LaborTotal.push({ name: 'IGST On Labor', value: LIGST });
|
|
1909
|
+
}
|
|
1910
|
+
else {
|
|
1911
|
+
LaborTotal.push({ name: 'CGST On Labor', value: LCGST });
|
|
1912
|
+
LaborTotal.push({ name: 'SGST On Labor', value: LSGST });
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
if (LaborTotal.length !== 0) {
|
|
1916
|
+
return {
|
|
1917
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
1918
|
+
lineHeight: 0.7,
|
|
1919
|
+
fontSize: 7,
|
|
1920
|
+
marginBottom: 5,
|
|
1921
|
+
table: {
|
|
1922
|
+
body: this.GetDataTable(LaborTotal, true)
|
|
1923
|
+
},
|
|
1924
|
+
layout: 'noBorders',
|
|
1925
|
+
};
|
|
1926
|
+
}
|
|
1927
|
+
else {
|
|
1928
|
+
return this.emptyObject();
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
static GrandTotal(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, subTotal, moreDiscDetails) {
|
|
1932
|
+
let AccountFields = [
|
|
1933
|
+
// { name: 'Labor Total', value: LaborAfterGST },
|
|
1934
|
+
// { name: 'Part Total', value: PartsAfterGST },
|
|
1935
|
+
];
|
|
1936
|
+
if (moreDiscDetails) {
|
|
1937
|
+
if (!tr_utils_1.TrUtils.IsZero(RecordData.PDisc)) {
|
|
1938
|
+
AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc) });
|
|
1939
|
+
}
|
|
1940
|
+
if (!tr_utils_1.TrUtils.IsZero(RecordData.LDisc)) {
|
|
1941
|
+
AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.LDisc) });
|
|
1942
|
+
}
|
|
1943
|
+
if (!tr_utils_1.TrUtils.IsZero(RecordData.Disc)) {
|
|
1944
|
+
AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
|
|
1945
|
+
}
|
|
1946
|
+
}
|
|
1947
|
+
else {
|
|
1948
|
+
AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
|
|
1949
|
+
}
|
|
1950
|
+
if (!Consolidate && !tr_utils_1.TrUtils.IsNull(subTotal)) {
|
|
1951
|
+
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(subTotal))) });
|
|
1952
|
+
}
|
|
1953
|
+
else {
|
|
1954
|
+
if (!Consolidate) {
|
|
1955
|
+
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))) });
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
|
|
1959
|
+
AccountFields.push({ name: 'Total Tax', value: totalTax });
|
|
1960
|
+
}
|
|
1961
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
|
|
1962
|
+
if (Adj > 0) {
|
|
1963
|
+
Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
|
|
1964
|
+
}
|
|
1965
|
+
AccountFields.push({ name: 'Adjust', value: Adj });
|
|
1966
|
+
}
|
|
1967
|
+
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
1968
|
+
let total = {
|
|
1969
|
+
name: 'Total',
|
|
1970
|
+
value: OverAllRecordTotal
|
|
1971
|
+
};
|
|
1972
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
1973
|
+
if (Rounding.value > 0) {
|
|
1974
|
+
Rounding.value = '+' + Rounding.value;
|
|
1975
|
+
}
|
|
1976
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
1977
|
+
AccountFields.push(total);
|
|
1978
|
+
AccountFields.push(Rounding);
|
|
1979
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
1980
|
+
AccountFields.push(FinalTotal);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
else {
|
|
1984
|
+
let total = {
|
|
1985
|
+
name: 'Total',
|
|
1986
|
+
value: OverAllRecordTotal
|
|
1987
|
+
};
|
|
1988
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
1989
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
1990
|
+
if (Rounding.value > 0) {
|
|
1991
|
+
Rounding.value = '+' + Rounding.value;
|
|
1992
|
+
}
|
|
1993
|
+
AccountFields.push(total);
|
|
1994
|
+
AccountFields.push(Rounding);
|
|
1995
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
1996
|
+
AccountFields.push(FinalTotal);
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1999
|
+
return {
|
|
2000
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
2001
|
+
lineHeight: 0.7,
|
|
2002
|
+
marginBottom: 5,
|
|
2003
|
+
width: 'auto',
|
|
2004
|
+
table: {
|
|
2005
|
+
body: this.GrandTotalTable(AccountFields)
|
|
2006
|
+
},
|
|
2007
|
+
layout: 'noBorders'
|
|
2008
|
+
// layout: {
|
|
2009
|
+
// hLineWidth: function (i: any, node: any) {
|
|
2010
|
+
// return (i === 0) ? 1 : 0;
|
|
2011
|
+
// },
|
|
2012
|
+
// vLineWidth: function (i: any, node: any) {
|
|
2013
|
+
// return (i === 0 || i === node.table.body.length) ? 0 : 0;
|
|
2014
|
+
// }
|
|
2015
|
+
// },
|
|
2016
|
+
};
|
|
2017
|
+
}
|
|
2018
|
+
static SalesGrandTotal(LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, For, OverAllRecordTotal, Rounded, GrandTotal) {
|
|
2019
|
+
let AccountFields = [
|
|
2020
|
+
// { name: 'Labor Total', value: LaborAfterGST },
|
|
2021
|
+
// { name: 'Part Total', value: PartsAfterGST },
|
|
2022
|
+
{ name: 'Disc.', value: OverAllRecordDiscount }
|
|
2023
|
+
];
|
|
2024
|
+
if (For === enums_1.PayTypeEnum.Insurance) {
|
|
2025
|
+
let total = {
|
|
2026
|
+
name: 'Total',
|
|
2027
|
+
value: OverAllRecordTotal
|
|
2028
|
+
};
|
|
2029
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
2030
|
+
if (Rounding.value > 0) {
|
|
2031
|
+
Rounding.value = '+' + Rounding.value;
|
|
2032
|
+
}
|
|
2033
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
2034
|
+
AccountFields.push(total);
|
|
2035
|
+
AccountFields.push(Rounding);
|
|
2036
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
2037
|
+
AccountFields.push(FinalTotal);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
else {
|
|
2041
|
+
let total = {
|
|
2042
|
+
name: 'Total',
|
|
2043
|
+
value: OverAllRecordTotal
|
|
2044
|
+
};
|
|
2045
|
+
let Rounding = { name: 'Rounding', value: Rounded };
|
|
2046
|
+
let FinalTotal = { name: 'Final Total', value: GrandTotal };
|
|
2047
|
+
if (Rounding.value > 0) {
|
|
2048
|
+
Rounding.value = '+' + Rounding.value;
|
|
2049
|
+
}
|
|
2050
|
+
AccountFields.push(total);
|
|
2051
|
+
AccountFields.push(Rounding);
|
|
2052
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
2053
|
+
AccountFields.push(FinalTotal);
|
|
2054
|
+
}
|
|
2055
|
+
}
|
|
2056
|
+
return {
|
|
2057
|
+
style: ['columnheader', 'TotalsStyles'],
|
|
2058
|
+
lineHeight: 0.7,
|
|
2059
|
+
marginBottom: 5,
|
|
2060
|
+
table: {
|
|
2061
|
+
body: this.GrandTotalTable(AccountFields)
|
|
2062
|
+
},
|
|
2063
|
+
layout: 'noBorders'
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2066
|
+
static GrandTotalTable(data) {
|
|
2067
|
+
var body = [];
|
|
2068
|
+
data.forEach((row) => {
|
|
2069
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(row.value) || row.name === 'Total') {
|
|
2070
|
+
var dataRow = [];
|
|
2071
|
+
dataRow.push({ text: (row.name).toString(), noWrap: true });
|
|
2072
|
+
dataRow.push(':');
|
|
2073
|
+
if (!tr_utils_1.TrUtils.IsNull(row.value)) {
|
|
2074
|
+
dataRow.push({ text: (row.value).toString(), noWrap: true, alignment: 'right' });
|
|
2075
|
+
}
|
|
2076
|
+
else {
|
|
2077
|
+
dataRow.push({ text: '', noWrap: true, alignment: 'right' });
|
|
2078
|
+
}
|
|
2079
|
+
body.push(dataRow);
|
|
2080
|
+
}
|
|
2081
|
+
});
|
|
2082
|
+
return body;
|
|
2083
|
+
}
|
|
2084
|
+
static InvoiceDueStatus(Type, Paid, Due, Status, isCounter) {
|
|
2085
|
+
if (Type === 'Invoice' && !isCounter) {
|
|
2086
|
+
return {
|
|
2087
|
+
// lineHeight: 0.7,
|
|
2088
|
+
fontSize: this.TableHeaders,
|
|
2089
|
+
marginTop: 10,
|
|
2090
|
+
marginBottom: 5,
|
|
2091
|
+
table: {
|
|
2092
|
+
widths: [200, 174, 174],
|
|
2093
|
+
body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid) },
|
|
2094
|
+
{ text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due) },
|
|
2095
|
+
{ text: 'Status : ' + Status }]]
|
|
2096
|
+
},
|
|
2097
|
+
layout: this.LayOutStyle(),
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2100
|
+
else {
|
|
2101
|
+
return this.emptyObject();
|
|
2102
|
+
}
|
|
2103
|
+
}
|
|
2104
|
+
static DebitDueStatus(Type, Paid, Due, Status) {
|
|
2105
|
+
// if (Type === 'Invoice') {
|
|
2106
|
+
return {
|
|
2107
|
+
// lineHeight: 0.7,
|
|
2108
|
+
fontSize: this.TableHeaders,
|
|
2109
|
+
marginTop: 10,
|
|
2110
|
+
marginBottom: 5,
|
|
2111
|
+
table: {
|
|
2112
|
+
widths: [200, 174, 174],
|
|
2113
|
+
body: [[{ text: 'Paid : ' + Paid },
|
|
2114
|
+
{ text: 'Due : ' + Due },
|
|
2115
|
+
{ text: 'Status : ' + Status }]]
|
|
2116
|
+
},
|
|
2117
|
+
layout: this.LayOutStyle(),
|
|
2118
|
+
};
|
|
2119
|
+
// } else {
|
|
2120
|
+
// return this.emptyObject();
|
|
2121
|
+
// }
|
|
2122
|
+
}
|
|
2123
|
+
static LayOutStyle() {
|
|
2124
|
+
return {
|
|
2125
|
+
hLineColor: function (i, node) {
|
|
2126
|
+
return (i === 0 || i === 1 || i === 2 || i === node.table.body.length) ? 'gray' : 'white';
|
|
2127
|
+
},
|
|
2128
|
+
vLineColor: function (i, node) {
|
|
2129
|
+
return (i === 0 || i === node.table.widths.length) ? 'gray' : 'white';
|
|
2130
|
+
}
|
|
2131
|
+
};
|
|
2132
|
+
}
|
|
2133
|
+
//Not use this function any where
|
|
2134
|
+
static LayOutStyle1() {
|
|
2135
|
+
return {
|
|
2136
|
+
hLineColor: function (i, node) {
|
|
2137
|
+
return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'white';
|
|
2138
|
+
},
|
|
2139
|
+
vLineColor: function (i, node) {
|
|
2140
|
+
return (i === 0 || i === node.table.widths.length) ? 'gray' : 'white';
|
|
2141
|
+
}
|
|
2142
|
+
};
|
|
2143
|
+
}
|
|
2144
|
+
static GetImage(Image, PrLogo) {
|
|
2145
|
+
if (!tr_utils_1.TrUtils.IsNull(Image) && PrLogo) {
|
|
2146
|
+
return { image: Image, width: 120, height: 80 };
|
|
2147
|
+
}
|
|
2148
|
+
else {
|
|
2149
|
+
return { text: '', width: 150, height: 100 };
|
|
2150
|
+
}
|
|
2151
|
+
}
|
|
2152
|
+
static FooterContent(CnstData) {
|
|
2153
|
+
var _a, _b;
|
|
2154
|
+
if (CnstData.Entity.Header === 2) {
|
|
2155
|
+
if (!tr_utils_1.TrUtils.IsEmpty(CnstData.Entity.FootText)) {
|
|
2156
|
+
return {
|
|
2157
|
+
table: {
|
|
2158
|
+
widths: ['auto'],
|
|
2159
|
+
body: [
|
|
2160
|
+
[{
|
|
2161
|
+
text: CnstData.Entity.FootText, alignment: 'center', fontSize: 9
|
|
2162
|
+
}]
|
|
2163
|
+
]
|
|
2164
|
+
},
|
|
2165
|
+
margin: [35, 0, 15, 10]
|
|
2166
|
+
};
|
|
2167
|
+
}
|
|
2168
|
+
else {
|
|
2169
|
+
return this.emptyObject();
|
|
2170
|
+
}
|
|
2171
|
+
}
|
|
2172
|
+
else {
|
|
2173
|
+
return {
|
|
2174
|
+
stack: [{ text: ((_a = CnstData.Doc) === null || _a === void 0 ? void 0 : _a.Sltn) + ' ' + ((_b = CnstData.Doc) === null || _b === void 0 ? void 0 : _b.Name), bold: true, alignment: 'right', marginBottom: 10 }, SharedPDFService.HeaderAfterLine1(), { columns: [this.GetEntityAddress(CnstData.Entity)] }],
|
|
2175
|
+
margin: [35, 0, 15, 10]
|
|
2176
|
+
};
|
|
2177
|
+
}
|
|
2178
|
+
}
|
|
2179
|
+
static GetEntityAddress(Entity) {
|
|
2180
|
+
let Addres = Entity.CName + ', ' + Entity.Adrs1;
|
|
2181
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Entity.Adrs2)) {
|
|
2182
|
+
Addres = Addres + ',' + Entity.Adrs2;
|
|
2183
|
+
}
|
|
2184
|
+
Addres = Addres + ',' + Entity.City + SharedPDFService.getPinCode(Entity.PIN);
|
|
2185
|
+
return {
|
|
2186
|
+
style: 'tableExample',
|
|
2187
|
+
table: {
|
|
2188
|
+
widths: [80, '*'],
|
|
2189
|
+
body: [
|
|
2190
|
+
[{ text: 'Address -', bold: true }, { text: Addres, marginLeft: -45 }],
|
|
2191
|
+
[{ text: 'For Appointments' }, { text: 'Call: ' + Entity.Phone + ', ' + this.GetEmail(Entity.Email), marginLeft: -12 }],
|
|
2192
|
+
]
|
|
2193
|
+
}, layout: 'noBorders',
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
static GetSignatures(CName, For, Type) {
|
|
2197
|
+
return {
|
|
2198
|
+
columns: [{
|
|
2199
|
+
stack: [
|
|
2200
|
+
this.CompanyName(CName),
|
|
2201
|
+
{ columns: [this.Authorizedsignature(), this.SurveyorSignature(For, Type), this.CustomerSignature()] }
|
|
2202
|
+
]
|
|
2203
|
+
}],
|
|
2204
|
+
};
|
|
2205
|
+
}
|
|
2206
|
+
static GetInvSignatures(CName, isCounterSale) {
|
|
2207
|
+
return {
|
|
2208
|
+
columns: [{
|
|
2209
|
+
stack: [
|
|
2210
|
+
this.CompanyName(CName),
|
|
2211
|
+
{ columns: [this.Authorizedsignature(), this.SparesSignature(isCounterSale), this.CustomerSignature()] }
|
|
2212
|
+
]
|
|
2213
|
+
}],
|
|
2214
|
+
};
|
|
2215
|
+
}
|
|
2216
|
+
static GetHCInvSignatures(CName, isCounterSale) {
|
|
2217
|
+
return {
|
|
2218
|
+
columns: [{
|
|
2219
|
+
stack: [
|
|
2220
|
+
this.CompanyName(CName),
|
|
2221
|
+
{ columns: [this.Authorizedsignature(), this.SparesSignature(isCounterSale), this.PatientSignature()] }
|
|
2222
|
+
]
|
|
2223
|
+
}],
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
static SparesSignature(CounterSale) {
|
|
2227
|
+
if (CounterSale) {
|
|
2228
|
+
return {
|
|
2229
|
+
style: 'Sign',
|
|
2230
|
+
text: ['Parts Incharge Signature'], marginLeft: 90
|
|
2231
|
+
};
|
|
2232
|
+
}
|
|
2233
|
+
else {
|
|
2234
|
+
let Sur = [];
|
|
2235
|
+
return Sur;
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
static CompanyName(CName) {
|
|
2239
|
+
return {
|
|
2240
|
+
style: 'forCompany',
|
|
2241
|
+
text: ['For ', { text: CName, bold: 'true' }],
|
|
2242
|
+
};
|
|
2243
|
+
}
|
|
2244
|
+
static Authorizedsignature() {
|
|
2245
|
+
return {
|
|
2246
|
+
style: 'Sign',
|
|
2247
|
+
text: ['Authorized Signature'],
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
2250
|
+
static Accountantsignature() {
|
|
2251
|
+
return {
|
|
2252
|
+
style: 'Sign',
|
|
2253
|
+
text: ['Accountant Signature'],
|
|
2254
|
+
marginLeft: 90
|
|
2255
|
+
};
|
|
2256
|
+
}
|
|
2257
|
+
static CustomerSignature() {
|
|
2258
|
+
return {
|
|
2259
|
+
style: 'Sign',
|
|
2260
|
+
text: ['Customer Signature'], marginLeft: 90
|
|
2261
|
+
};
|
|
2262
|
+
}
|
|
2263
|
+
static PatientSignature() {
|
|
2264
|
+
return {
|
|
2265
|
+
style: 'Sign',
|
|
2266
|
+
text: ['Patient Signature'], marginLeft: 90
|
|
2267
|
+
};
|
|
2268
|
+
}
|
|
2269
|
+
static SurveyorSignature(For, Type) {
|
|
2270
|
+
if (For === enums_1.PayTypeEnum.Insurance && Type === 'Estimate') {
|
|
2271
|
+
return {
|
|
2272
|
+
style: 'Sign',
|
|
2273
|
+
text: ['Surveyor Signature'], marginLeft: 90
|
|
2274
|
+
};
|
|
2275
|
+
}
|
|
2276
|
+
else {
|
|
2277
|
+
let Sur = [];
|
|
2278
|
+
return Sur;
|
|
2279
|
+
}
|
|
2280
|
+
}
|
|
2281
|
+
//Not Use this function any where
|
|
2282
|
+
static GetHeadersWithDiffDisc(ROData, PrintPartNumber) {
|
|
2283
|
+
let headersNames;
|
|
2284
|
+
if (PrintPartNumber) {
|
|
2285
|
+
headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
|
|
2286
|
+
{ text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
|
|
2287
|
+
{ text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
|
|
2288
|
+
{ text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
|
|
2289
|
+
{ text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'right', },
|
|
2290
|
+
{ text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 }, {},
|
|
2291
|
+
{ text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
|
|
2292
|
+
],
|
|
2293
|
+
[{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'MPN', lineHeight: 0.5 },
|
|
2294
|
+
{ text: '', Field: 'Desc', lineHeight: 0.5 },
|
|
2295
|
+
{ text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
|
|
2296
|
+
{ text: '%', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'percentage', lineHeight: 0.5 },
|
|
2297
|
+
{ text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 },
|
|
2298
|
+
{ text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
|
|
2299
|
+
]];
|
|
2300
|
+
}
|
|
2301
|
+
else {
|
|
2302
|
+
headersNames = [[{ text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 },
|
|
2303
|
+
{ text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'center', lineHeight: 0.5 },
|
|
2304
|
+
{ text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
|
|
2305
|
+
{ text: 'Unit Price', style: 'tableheader', rowSpan: 2, alignment: 'right', lineHeight: 0.5 },
|
|
2306
|
+
{ text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 }, {},
|
|
2307
|
+
{ text: 'Line Total', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 }
|
|
2308
|
+
],
|
|
2309
|
+
[{ text: '', Field: 'SNo', lineHeight: 0.5 }, { text: '', Field: 'Desc', lineHeight: 0.5 },
|
|
2310
|
+
{ text: '', Field: 'QtyAndUoM', lineHeight: 0.5 }, { text: 'Unit Price', Field: 'UnPr', Field1: 'UnCo', lineHeight: 0.5 },
|
|
2311
|
+
{ text: '%', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'percentage', lineHeight: 0.5 },
|
|
2312
|
+
{ text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 },
|
|
2313
|
+
{ text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
|
|
2314
|
+
]];
|
|
2315
|
+
}
|
|
2316
|
+
return headersNames;
|
|
2317
|
+
}
|
|
2318
|
+
static GetStyles() {
|
|
2319
|
+
return {
|
|
2320
|
+
temp2header: {
|
|
2321
|
+
fontSize: 23,
|
|
2322
|
+
bold: true,
|
|
2323
|
+
alignment: 'left',
|
|
2324
|
+
// margin: [0, 10, 0, 0],
|
|
2325
|
+
},
|
|
2326
|
+
tableheader1: {
|
|
2327
|
+
bold: true,
|
|
2328
|
+
fontFamily: 'Calibri',
|
|
2329
|
+
margin: [0, 2, 0, 2],
|
|
2330
|
+
alignment: 'center'
|
|
2331
|
+
},
|
|
2332
|
+
header: {
|
|
2333
|
+
fontSize: 26,
|
|
2334
|
+
bold: true,
|
|
2335
|
+
alignment: 'center',
|
|
2336
|
+
// margin: [0, 10, 0, 0],
|
|
2337
|
+
},
|
|
2338
|
+
// header2: {
|
|
2339
|
+
// fontSize: 13,
|
|
2340
|
+
// bold: true,
|
|
2341
|
+
// alignment: 'center',
|
|
2342
|
+
// // margin: [0, 10, 0, 0],
|
|
2343
|
+
// },
|
|
2344
|
+
meetingHeader: {
|
|
2345
|
+
fontSize: 16,
|
|
2346
|
+
bold: true,
|
|
2347
|
+
// alignment: 'center',
|
|
2348
|
+
},
|
|
2349
|
+
Receiptheader: {
|
|
2350
|
+
fontSize: 26,
|
|
2351
|
+
bold: true,
|
|
2352
|
+
alignment: 'center',
|
|
2353
|
+
margin: [0, 10, 0, 0],
|
|
2354
|
+
},
|
|
2355
|
+
InlineHeader: {
|
|
2356
|
+
fontSize: this.TableHeaders,
|
|
2357
|
+
bold: true,
|
|
2358
|
+
alignment: 'center',
|
|
2359
|
+
// decoration: 'underline',
|
|
2360
|
+
margin: [100, 2, 0, 2],
|
|
2361
|
+
},
|
|
2362
|
+
TaskHeading: {
|
|
2363
|
+
fontSize: 10,
|
|
2364
|
+
bold: true,
|
|
2365
|
+
margin: [30, 10, 0, 0],
|
|
2366
|
+
},
|
|
2367
|
+
lettersSize: {
|
|
2368
|
+
fontSize: this.SubHeaderSize,
|
|
2369
|
+
margin: [30, 0, 0, 0],
|
|
2370
|
+
},
|
|
2371
|
+
tablexample: {
|
|
2372
|
+
margin: [0, 5, 0, 0]
|
|
2373
|
+
},
|
|
2374
|
+
hedstyl: {
|
|
2375
|
+
margin: [0, 0, 0, 0]
|
|
2376
|
+
},
|
|
2377
|
+
header2: {
|
|
2378
|
+
fontSize: 12,
|
|
2379
|
+
bold: true,
|
|
2380
|
+
alignment: 'center',
|
|
2381
|
+
margin: [0, 0, 0, 0],
|
|
2382
|
+
},
|
|
2383
|
+
header1: {
|
|
2384
|
+
fontSize: 18,
|
|
2385
|
+
bold: true,
|
|
2386
|
+
alignment: 'center',
|
|
2387
|
+
decoration: 'underline',
|
|
2388
|
+
margin: [0, 0, 0, 0]
|
|
2389
|
+
},
|
|
2390
|
+
ws_adrs_center: {
|
|
2391
|
+
fontSize: this.BodySize,
|
|
2392
|
+
alignment: 'center',
|
|
2393
|
+
},
|
|
2394
|
+
ws_adrs_center1: {
|
|
2395
|
+
fontSize: 10,
|
|
2396
|
+
alignment: 'center',
|
|
2397
|
+
},
|
|
2398
|
+
ws_adrs_left: {
|
|
2399
|
+
fontSize: this.BodySize,
|
|
2400
|
+
alignment: 'left',
|
|
2401
|
+
},
|
|
2402
|
+
ws_adrs_left1: {
|
|
2403
|
+
fontSize: 10,
|
|
2404
|
+
alignment: 'left',
|
|
2405
|
+
},
|
|
2406
|
+
columnheader: {
|
|
2407
|
+
margin: [0, 5, 0, 0],
|
|
2408
|
+
},
|
|
2409
|
+
tableExample: {
|
|
2410
|
+
margin: [0, 0.5, 0, 5],
|
|
2411
|
+
fontSize: this.BodySize
|
|
2412
|
+
},
|
|
2413
|
+
tableExamplemargin: {
|
|
2414
|
+
margin: [25, 10, 20, 0],
|
|
2415
|
+
fontSize: this.BodySize
|
|
2416
|
+
},
|
|
2417
|
+
textcust: {
|
|
2418
|
+
fontSize: this.BodySize,
|
|
2419
|
+
margin: [0, 5, 0, 5],
|
|
2420
|
+
},
|
|
2421
|
+
column: {
|
|
2422
|
+
margin: [15, 0, 0, 0]
|
|
2423
|
+
},
|
|
2424
|
+
tableheader: {
|
|
2425
|
+
bold: true,
|
|
2426
|
+
fontSize: this.TableHeaders,
|
|
2427
|
+
margin: [0, 1, 0, 5],
|
|
2428
|
+
alignment: 'center'
|
|
2429
|
+
},
|
|
2430
|
+
tableheader2: {
|
|
2431
|
+
fontSize: this.TableHeaders,
|
|
2432
|
+
margin: [0, 1, 0, 5],
|
|
2433
|
+
alignment: 'center',
|
|
2434
|
+
// color: 'grey'
|
|
2435
|
+
opacity: 0.7
|
|
2436
|
+
},
|
|
2437
|
+
hed: {
|
|
2438
|
+
fontSize: this.SubHeaderSize,
|
|
2439
|
+
bold: true
|
|
2440
|
+
},
|
|
2441
|
+
hed2: {
|
|
2442
|
+
fontSize: this.SubHeaderSize,
|
|
2443
|
+
// bold: true
|
|
2444
|
+
},
|
|
2445
|
+
TotalsStyles: {
|
|
2446
|
+
marginTop: 15,
|
|
2447
|
+
lineHeight: 1.4,
|
|
2448
|
+
fontSize: this.BodySize,
|
|
2449
|
+
margin: [15, 0, 0, 0],
|
|
2450
|
+
},
|
|
2451
|
+
colum1: {
|
|
2452
|
+
fontSize: this.BodySize,
|
|
2453
|
+
lineHeight: 1.2,
|
|
2454
|
+
},
|
|
2455
|
+
colum2: {
|
|
2456
|
+
fontSize: this.BodySize,
|
|
2457
|
+
lineHeight: 1.4,
|
|
2458
|
+
margin: [10, 0, 0, 0],
|
|
2459
|
+
},
|
|
2460
|
+
colum3: {
|
|
2461
|
+
lineHeight: 0.7
|
|
2462
|
+
},
|
|
2463
|
+
Receiptheader1: {
|
|
2464
|
+
fontSize: 10,
|
|
2465
|
+
bold: true,
|
|
2466
|
+
alignment: 'center',
|
|
2467
|
+
margin: [0, 0, 0, 3]
|
|
2468
|
+
},
|
|
2469
|
+
Row1: {
|
|
2470
|
+
fontSize: this.TableHeaders,
|
|
2471
|
+
margin: [0, 5, 0, 5],
|
|
2472
|
+
},
|
|
2473
|
+
rowdata: {
|
|
2474
|
+
margin: [0, 10, 0, 0],
|
|
2475
|
+
fontSize: this.TableHeaders
|
|
2476
|
+
},
|
|
2477
|
+
forCompany: {
|
|
2478
|
+
margin: [0, 10, 30, 0],
|
|
2479
|
+
fontSize: '9'
|
|
2480
|
+
},
|
|
2481
|
+
forCompany1: {
|
|
2482
|
+
margin: [0, 5, 15, 0],
|
|
2483
|
+
fontSize: '9'
|
|
2484
|
+
},
|
|
2485
|
+
Rupees: {
|
|
2486
|
+
margin: [0, 40, 0, 0],
|
|
2487
|
+
fontSize: '10',
|
|
2488
|
+
},
|
|
2489
|
+
Signature: {
|
|
2490
|
+
margin: [0, 40, 50, 0],
|
|
2491
|
+
alignment: 'right',
|
|
2492
|
+
fontSize: '10'
|
|
2493
|
+
},
|
|
2494
|
+
withApp: {
|
|
2495
|
+
alignment: 'center',
|
|
2496
|
+
lineHeight: 0.7
|
|
2497
|
+
},
|
|
2498
|
+
withOutApp: {
|
|
2499
|
+
alignment: 'center',
|
|
2500
|
+
lineHeight: 0.5
|
|
2501
|
+
},
|
|
2502
|
+
Sign: {
|
|
2503
|
+
fontSize: this.BodySize,
|
|
2504
|
+
margin: [0, 30, 0, 5]
|
|
2505
|
+
},
|
|
2506
|
+
Sign1: {
|
|
2507
|
+
fontSize: this.BodySize,
|
|
2508
|
+
margin: [0, 15, 0, 5]
|
|
2509
|
+
},
|
|
2510
|
+
// 'html-font': {
|
|
2511
|
+
// fontSize: this.TermsandCond,
|
|
2512
|
+
// },
|
|
2513
|
+
// 'html-ol': {
|
|
2514
|
+
// fontSize: this.TermsandCond,
|
|
2515
|
+
// },
|
|
2516
|
+
'margin-all': {
|
|
2517
|
+
margin: [0, 5, 0, 5],
|
|
2518
|
+
},
|
|
2519
|
+
'margin-top': {
|
|
2520
|
+
margin: [0, 5, 0, 0],
|
|
2521
|
+
},
|
|
2522
|
+
'margin-bottom': {
|
|
2523
|
+
margin: [0, 0, 0, 5],
|
|
2524
|
+
},
|
|
2525
|
+
'fontSize': {
|
|
2526
|
+
fontSize: this.TermsandCond,
|
|
2527
|
+
},
|
|
2528
|
+
// 'html-u': {
|
|
2529
|
+
// fontSize: 16,
|
|
2530
|
+
// },
|
|
2531
|
+
// 'html-b': {
|
|
2532
|
+
// },
|
|
2533
|
+
// 'html-li': {
|
|
2534
|
+
// },
|
|
2535
|
+
// 'html-span': {
|
|
2536
|
+
// fontSize: this.TermsandCond,
|
|
2537
|
+
// }
|
|
2538
|
+
};
|
|
2539
|
+
}
|
|
2540
|
+
static convertNumberToWords(value) {
|
|
2541
|
+
var fraction = Math.round(this.frac(value) * 100);
|
|
2542
|
+
let f_text = '';
|
|
2543
|
+
if (fraction > 0) {
|
|
2544
|
+
let paisa = (this.convert_number(fraction) === 'ONE') ? 'PAISA' : ' PAISE';
|
|
2545
|
+
f_text = 'AND ' + this.convert_number(fraction) + paisa;
|
|
2546
|
+
}
|
|
2547
|
+
return this.convert_number(value) + ' RUPEE(S) ' + f_text + ' ONLY';
|
|
2548
|
+
}
|
|
2549
|
+
static frac(f) {
|
|
2550
|
+
return f % 1;
|
|
2551
|
+
}
|
|
2552
|
+
static convert_number(number) {
|
|
2553
|
+
if ((number < 0) || (number > 999999999)) {
|
|
2554
|
+
return 'NUMBER OUT OF RANGE!';
|
|
2555
|
+
}
|
|
2556
|
+
var Gn = Math.floor(number / 10000000); /* Crore */
|
|
2557
|
+
number -= Gn * 10000000;
|
|
2558
|
+
var kn = Math.floor(number / 100000); /* lakhs */
|
|
2559
|
+
number -= kn * 100000;
|
|
2560
|
+
var Hn = Math.floor(number / 1000); /* thousand */
|
|
2561
|
+
number -= Hn * 1000;
|
|
2562
|
+
var Dn = Math.floor(number / 100); /* Tens (deca) */
|
|
2563
|
+
number = number % 100; /* Ones */
|
|
2564
|
+
var tn = Math.floor(number / 10);
|
|
2565
|
+
var one = Math.floor(number % 10);
|
|
2566
|
+
var res = '';
|
|
2567
|
+
if (Gn > 0) {
|
|
2568
|
+
res += (this.convert_number(Gn) + ' CRORE');
|
|
2569
|
+
}
|
|
2570
|
+
if (kn > 0) {
|
|
2571
|
+
res += (((res === '') ? '' : ' ') +
|
|
2572
|
+
this.convert_number(kn) + ' LAKH');
|
|
2573
|
+
}
|
|
2574
|
+
if (Hn > 0) {
|
|
2575
|
+
res += (((res === '') ? '' : ' ') +
|
|
2576
|
+
this.convert_number(Hn) + ' THOUSAND');
|
|
2577
|
+
}
|
|
2578
|
+
if (Dn) {
|
|
2579
|
+
res += (((res === '') ? '' : ' ') +
|
|
2580
|
+
this.convert_number(Dn) + ' HUNDRED');
|
|
2581
|
+
}
|
|
2582
|
+
var ones = Array('', 'ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE', 'TEN', 'ELEVEN', 'TWELVE', 'THIRTEEN', 'FOURTEEN', 'FIFTEEN', 'SIXTEEN', 'SEVENTEEN', 'EIGHTEEN', 'NINETEEN');
|
|
2583
|
+
var tens = Array('', '', 'TWENTY', 'THIRTY', 'FOURTY', 'FIFTY', 'SIXTY', 'SEVENTY', 'EIGHTY', 'NINETY');
|
|
2584
|
+
if (tn > 0 || one > 0) {
|
|
2585
|
+
if (!(res === '')) {
|
|
2586
|
+
res += ' AND ';
|
|
2587
|
+
}
|
|
2588
|
+
if (tn < 2) {
|
|
2589
|
+
res += ones[tn * 10 + one];
|
|
2590
|
+
}
|
|
2591
|
+
else {
|
|
2592
|
+
res += tens[tn];
|
|
2593
|
+
if (one > 0) {
|
|
2594
|
+
res += ('-' + ones[one]);
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
}
|
|
2598
|
+
if (res === '') {
|
|
2599
|
+
res = 'ZERO';
|
|
2600
|
+
}
|
|
2601
|
+
return res;
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
exports.SharedPDFService = SharedPDFService;
|
|
2605
|
+
SharedPDFService.BodySize = 8;
|
|
2606
|
+
SharedPDFService.TableHeaders = 9;
|
|
2607
|
+
SharedPDFService.SubHeaderSize = 9;
|
|
2608
|
+
SharedPDFService.TermsandCond = 6;
|