shareneus 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/aggregation/aggregation.js +60 -0
- package/dist/enums/cache-enums.js +37 -0
- package/dist/enums/code-enums.js +288 -0
- package/dist/enums/enums.js +362 -0
- package/dist/enums/industry-enums.js +24 -0
- package/dist/excel-files/GSTR-RO-excel.service.js +935 -0
- package/dist/excel-files/GSTR1-excel.service.js +295 -0
- package/dist/excel-files/GSTR2-excel.service.js +295 -0
- package/dist/excel-files/analysis-excel.service.js +297 -0
- package/dist/excel-files/category-wise-item-excel.service.js +274 -0
- package/dist/excel-files/cust-balance-excel.service.js +287 -0
- package/dist/excel-files/cust-wise-sales-details.js +320 -0
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +302 -0
- package/dist/excel-files/expiring-drugs-excel.service.js +292 -0
- package/dist/excel-files/insurance-expire-excel.service.js +301 -0
- package/dist/excel-files/invoice-wise-excel.service.js +857 -0
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +258 -0
- package/dist/excel-files/item-wise-mout-details.js +292 -0
- package/dist/excel-files/item-wise-mout-summary.js +286 -0
- package/dist/excel-files/items-wise-sales-excel.service.js +314 -0
- package/dist/excel-files/manf-wise-sales-excel.service.js +276 -0
- package/dist/excel-files/operator-wise-details.js +265 -0
- package/dist/excel-files/operator-wise-summary.js +266 -0
- package/dist/excel-files/payment-receive-excel.service.js +225 -0
- package/dist/excel-files/payments-made-excel.service.js +302 -0
- package/dist/excel-files/repair-orders-excel.service.js +255 -0
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +232 -0
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +232 -0
- package/dist/excel-files/sale-summary-excel.service.js +326 -0
- package/dist/excel-files/sales-by-service-details-excel.service.js +1 -0
- package/dist/excel-files/sales-by-service-summary-excel.service.js +422 -0
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +367 -0
- package/dist/excel-files/scheduled-drugs-excel.service.js +366 -0
- package/dist/excel-files/spares-issue-excel.service.js +492 -0
- package/dist/excel-files/stock-excel.service.js +283 -0
- package/dist/excel-files/tally-sales-import.service.js +765 -0
- package/dist/excel-files/ven-balance-excel.service.js +293 -0
- package/dist/index.js +237 -0
- package/dist/services/analysis-pdf.service.js +105 -0
- package/dist/services/appointment-total.service.js +253 -0
- package/dist/services/auto-sales-receipt-pdf.service.js +539 -0
- package/dist/services/category-wise-item-pdf.service.js +98 -0
- package/dist/services/checklist-pdf.js +140 -0
- package/dist/services/checklists-pdf.js +124 -0
- package/dist/services/cn-print.service.js +211 -0
- package/dist/services/consultation-fee-receipt.service.js +378 -0
- package/dist/services/consultation-full-pdf.service.js +220 -0
- package/dist/services/consultation-pdf.service.js +360 -0
- package/dist/services/credit-note-pdf.service.js +578 -0
- package/dist/services/credit-note-totals.service.js +328 -0
- package/dist/services/cust-wise-sales-details-pdf.service.js +118 -0
- package/dist/services/cust-wise-sales-summary-pdf.service.js +111 -0
- package/dist/services/customer-balances-pdf.service.js +169 -0
- package/dist/services/dc-landscape-pdf.service.js +903 -0
- package/dist/services/dc-landscape-without-price-pdf.service.js +853 -0
- package/dist/services/dc-without-price-pdf.service.js +489 -0
- package/dist/services/debit-note-pdf.service.js +673 -0
- package/dist/services/debit-note-print.service.js +234 -0
- package/dist/services/debit-note-totals.service.js +293 -0
- package/dist/services/delivery-challan-pdf.service.js +434 -0
- package/dist/services/delivery-challan-print.service.js +177 -0
- package/dist/services/delivery-challan-totals.js +339 -0
- package/dist/services/equipment-design-pdf.service.js +144 -0
- package/dist/services/est.print-service.js +1053 -0
- package/dist/services/expiring-drugs-pdf.service.js +156 -0
- package/dist/services/hc-inv-pdf.service.js +837 -0
- package/dist/services/insurance-expire-pdf.service.js +99 -0
- package/dist/services/inv-pdf.service.js +785 -0
- package/dist/services/inv-print.service.js +415 -0
- package/dist/services/invoice-landscape-pdf.service.js +909 -0
- package/dist/services/invoice-total.service.js +659 -0
- package/dist/services/issue-parts-pdf.service.js +763 -0
- package/dist/services/item-detais-pdf.js +136 -0
- package/dist/services/item-wise-doctor-sale-pdf.service.js +164 -0
- package/dist/services/item-wise-mout-details-pdf.js +107 -0
- package/dist/services/item-wise-mout-summary-pdf.js +99 -0
- package/dist/services/item-wise-sales-pdf.service.js +178 -0
- package/dist/services/manf-wise-sales-pdf.service.js +173 -0
- package/dist/services/meeting-pdf.js +369 -0
- package/dist/services/mout-pdf.service.js +503 -0
- package/dist/services/operator-wise-details-pdf.service.js +103 -0
- package/dist/services/operator-wise-summary-pdf.js +101 -0
- package/dist/services/pack-ship-pdf.service.js +105 -0
- package/dist/services/pack-ship-print.service.js +167 -0
- package/dist/services/payment-pdf.service.js +373 -0
- package/dist/services/payment-report-pdf.service.js +106 -0
- package/dist/services/po-totals.service.js +279 -0
- package/dist/services/pos-receipt-pdf.js +438 -0
- package/dist/services/purchase-order-pdf.service.js +924 -0
- package/dist/services/purchase-order-print.service.js +150 -0
- package/dist/services/purchase-order-totals.service.js +280 -0
- package/dist/services/receipt-print.service.js +50 -0
- package/dist/services/reorder-point-pdf.service.js +151 -0
- package/dist/services/repair-orders-pdf.service.js +172 -0
- package/dist/services/ro-pdf.service.js +1764 -0
- package/dist/services/ro-print-service.js +737 -0
- package/dist/services/ro-totals.service.js +1241 -0
- package/dist/services/sales-by-service-pdf.service.js +116 -0
- package/dist/services/sales-pdf.service.js +630 -0
- package/dist/services/sales-print.service.js +305 -0
- package/dist/services/sales-receipt-pdf.service.js +611 -0
- package/dist/services/sales-receipt-print.service.js +425 -0
- package/dist/services/sales-totals.service.js +339 -0
- package/dist/services/scheduled-drug-pdf.service.js +176 -0
- package/dist/services/scheduled-drug-summary-pdf.service.js +188 -0
- package/dist/services/separate-wo-print.service.js +351 -0
- package/dist/services/shared-inv-pdf.service.js +763 -0
- package/dist/services/shared-pdf.service.js +2569 -0
- package/dist/services/shared-print.service.js +885 -0
- package/dist/services/task-pdf.service.js +220 -0
- package/dist/services/task-reports-pdf.service.js +296 -0
- package/dist/services/technician-pdf.service.js +238 -0
- package/dist/services/technician-print.service.js +87 -0
- package/dist/services/transfer-order-pdf.service.js +139 -0
- package/dist/services/vendor-balances-pdf.service.js +101 -0
- package/dist/services/vendor-credit-note-pdf.service.js +1007 -0
- package/dist/services/vendor-credit-note-print.service.js +104 -0
- package/dist/services/vendor-credit-note-totals.service.js +327 -0
- package/dist/services/vendor-debit-note-pdf.service.js +561 -0
- package/dist/services/vendor-debit-note-print.service.js +245 -0
- package/dist/services/vendor-debit-note-totals.service.js +305 -0
- package/dist/utils/my-date.js +652 -0
- package/dist/utils/tr-utils.js +354 -0
- package/package.json +24 -0
- package/tsconfig.json +109 -0
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DCWithoutPricePdfService = void 0;
|
|
4
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
5
|
+
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
|
+
const shared_print_service_1 = require("./shared-print.service");
|
|
7
|
+
class DCWithoutPricePdfService {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.FontSize = 8;
|
|
10
|
+
}
|
|
11
|
+
static GetDeliveryChallanPrint(ROPrintData, numberofCopies) {
|
|
12
|
+
var contents = [];
|
|
13
|
+
if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
|
|
14
|
+
contents.push(this.CommonHeaderDetails(ROPrintData, null), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies));
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
numberofCopies.forEach((text, index) => {
|
|
18
|
+
contents.push(this.CommonHeaderDetails(ROPrintData, text), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, index, numberofCopies));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
var dd = {
|
|
22
|
+
info: {
|
|
23
|
+
title: this.GetFileName(ROPrintData),
|
|
24
|
+
},
|
|
25
|
+
background: function (currentPage, pageSize) {
|
|
26
|
+
return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
|
|
27
|
+
},
|
|
28
|
+
header: function (currentPage, pageCount) {
|
|
29
|
+
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
30
|
+
},
|
|
31
|
+
pageMargins: [10, 15, 10, 15],
|
|
32
|
+
content: contents,
|
|
33
|
+
styles: shared_pdf_service_1.SharedPDFService.GetStyles()
|
|
34
|
+
};
|
|
35
|
+
return dd;
|
|
36
|
+
}
|
|
37
|
+
static GetFileName(ROPrintData) {
|
|
38
|
+
let fileName = ROPrintData.HeaderName;
|
|
39
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
40
|
+
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
41
|
+
}
|
|
42
|
+
return fileName;
|
|
43
|
+
}
|
|
44
|
+
static CommonHeaderDetails(ROPrintData, text) {
|
|
45
|
+
return [
|
|
46
|
+
this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
|
|
47
|
+
shared_pdf_service_1.SharedPDFService.GetCustomerAndVehicleDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate, ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Product, ROPrintData.PrintType, ROPrintData.For, ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.InsComp, ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, ROPrintData.IsProforma, ROPrintData.Settings, null, false, ROPrintData.BL, null, null, null),
|
|
48
|
+
shared_pdf_service_1.SharedPDFService.GetOwnerDetails(ROPrintData.Cust, ROPrintData.Type, ROPrintData.For),
|
|
49
|
+
shared_pdf_service_1.SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
|
|
50
|
+
shared_pdf_service_1.SharedPDFService.GetDisplayTable(),
|
|
51
|
+
];
|
|
52
|
+
}
|
|
53
|
+
static GetMainHeaderDetails(Entity, HeaderName, Image, HColor, AColor, text) {
|
|
54
|
+
return [
|
|
55
|
+
// SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
|
|
56
|
+
shared_pdf_service_1.SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
|
|
57
|
+
shared_pdf_service_1.SharedPDFService.GetPrintType(HeaderName),
|
|
58
|
+
shared_pdf_service_1.SharedPDFService.HeaderAfterLine()
|
|
59
|
+
];
|
|
60
|
+
}
|
|
61
|
+
static PreparesparePartsTable(ROPrintData) {
|
|
62
|
+
let List = [];
|
|
63
|
+
if (ROPrintData.Entity.Body === 1) {
|
|
64
|
+
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
65
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
66
|
+
ROPrintData.PrintInfo[i].Text = '';
|
|
67
|
+
}
|
|
68
|
+
// List.push(ROPrintData.PrintInfo[i].Text,
|
|
69
|
+
// this.GetLaborPartsTableForView(ROPrintData.PrintInfo[i].Items)
|
|
70
|
+
// );
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
if (ROPrintData.Entity.Body === 2) {
|
|
75
|
+
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
76
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
77
|
+
ROPrintData.PrintInfo[i].Text = '';
|
|
78
|
+
}
|
|
79
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
if (ROPrintData.Summary) {
|
|
84
|
+
// List.push('',
|
|
85
|
+
// this.GetLaborPartsTableForView(ROPrintData.Items)
|
|
86
|
+
// );
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
90
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
91
|
+
ROPrintData.PrintInfo[i].Text = '';
|
|
92
|
+
}
|
|
93
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return List;
|
|
99
|
+
}
|
|
100
|
+
static WithOutDiscountFieldTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
101
|
+
if (Parts.length !== 0) {
|
|
102
|
+
if (PrintPartNo) {
|
|
103
|
+
return {
|
|
104
|
+
style: 'tableExample',
|
|
105
|
+
marginLeft: 20,
|
|
106
|
+
table: {
|
|
107
|
+
widths: [15, 67, 160, 25, 50, 60, 30, 53],
|
|
108
|
+
headerRows: 1,
|
|
109
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
110
|
+
},
|
|
111
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
return {
|
|
116
|
+
style: 'tableExample',
|
|
117
|
+
marginLeft: 20,
|
|
118
|
+
table: {
|
|
119
|
+
widths: [15, 215, 25, 50, 60, 45, 60],
|
|
120
|
+
headerRows: 1,
|
|
121
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
122
|
+
},
|
|
123
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
let a = '';
|
|
129
|
+
return a;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
static GetWithOutDiscountFieldHeader2(permission, Body, ShowDiscountColumn) {
|
|
133
|
+
let headersNames = [[
|
|
134
|
+
{ text: 'Description', rowSpan: 2, style: 'tableheader', alignment: 'left', lineHeight: 0.5 },
|
|
135
|
+
{ text: 'Qty', style: 'tableheader', rowSpan: 2, lineHeight: 0.5 },
|
|
136
|
+
// { text: 'Unit Price', style: 'tableheader', rowSpan: 2, lineHeight: 0.5, alignment: 'right', },
|
|
137
|
+
// { text: 'Line Total', rowSpan: 2, lineHeight: 0.5, style: 'tableheader' }
|
|
138
|
+
],
|
|
139
|
+
[
|
|
140
|
+
{ text: '', Field: 'Desc', lineHeight: 0.5 },
|
|
141
|
+
{ text: '', Field: 'QtyAndUoM', lineHeight: 0.5 },
|
|
142
|
+
// { text: '', Field: 'UnPr', lineHeight: 0.5 },
|
|
143
|
+
// { text: 'Line Total', Field: 'LineTotal', lineHeight: 0.5 }
|
|
144
|
+
]];
|
|
145
|
+
if (permission) {
|
|
146
|
+
let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
|
|
147
|
+
let MPN = { text: 'Part No', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
|
|
148
|
+
let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
|
|
149
|
+
let MPN1 = { text: '', Field: 'MPN', lineHeight: 0.5 };
|
|
150
|
+
headersNames[0].unshift(sno, MPN);
|
|
151
|
+
headersNames[1].unshift(sno1, MPN1);
|
|
152
|
+
// if (ShowDiscountColumn) {
|
|
153
|
+
// headersNames[0].splice(5, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
|
|
154
|
+
// headersNames[0].splice(6, 0, {});
|
|
155
|
+
// headersNames[1].splice(5, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
|
|
156
|
+
// headersNames[1].splice(6, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
|
|
157
|
+
// }
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
let sno = { text: 'S.No.', rowSpan: 2, style: 'tableheader', lineHeight: 0.5 };
|
|
161
|
+
let sno1 = { text: '', Field: 'SNo', lineHeight: 0.5 };
|
|
162
|
+
headersNames[0].unshift(sno);
|
|
163
|
+
headersNames[1].unshift(sno1);
|
|
164
|
+
// if (ShowDiscountColumn) {
|
|
165
|
+
// headersNames[0].splice(4, 0, { text: 'Discount', style: 'tableheader', colSpan: 2, alignment: 'center', lineHeight: 0.5 });
|
|
166
|
+
// headersNames[0].splice(5, 0, {});
|
|
167
|
+
// headersNames[1].splice(4, 0, { text: '%', alignment: 'center', style: 'tableheader', Field: 'Perc', type: 'percentage', lineHeight: 0.5 });
|
|
168
|
+
// headersNames[1].splice(5, 0, { text: 'Rs', alignment: 'center', style: 'tableheader', Field: 'Disc', type: 'amount', lineHeight: 0.5 });
|
|
169
|
+
// }
|
|
170
|
+
}
|
|
171
|
+
return headersNames;
|
|
172
|
+
}
|
|
173
|
+
static BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
174
|
+
var body = [];
|
|
175
|
+
let columns = this.GetWithOutDiscountFieldHeader2(PrintPartNo, Body, ShowDiscountColumn);
|
|
176
|
+
// if (ShowTaxColumn) {
|
|
177
|
+
for (let i = 0; i < columns.length; i++) {
|
|
178
|
+
body.push(columns[i]);
|
|
179
|
+
}
|
|
180
|
+
columns = columns[1];
|
|
181
|
+
// } else {
|
|
182
|
+
// body.push(columns);
|
|
183
|
+
// }
|
|
184
|
+
let DummyOps = [];
|
|
185
|
+
if (Parts.length !== 0) {
|
|
186
|
+
let dummypartadding1 = {};
|
|
187
|
+
dummypartadding1.SNo = '';
|
|
188
|
+
dummypartadding1.Desc = 'Spare Parts';
|
|
189
|
+
dummypartadding1.Qty = '';
|
|
190
|
+
dummypartadding1.UnPr = '';
|
|
191
|
+
dummypartadding1.LineTotal = '';
|
|
192
|
+
Parts.unshift(dummypartadding1);
|
|
193
|
+
}
|
|
194
|
+
let SNo = 1;
|
|
195
|
+
Parts.forEach((part) => {
|
|
196
|
+
var dataRow = [];
|
|
197
|
+
columns.forEach((column) => {
|
|
198
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
199
|
+
|| (column.text === 'Line Total')) {
|
|
200
|
+
if (part[column.Field] === 'Spare Parts') {
|
|
201
|
+
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader', alignment: 'left' });
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
205
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
206
|
+
part[column.Field] = '';
|
|
207
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
if (column.text === 'Line Total' || column.Field === 'UnPr' || column.Field === 'QtyAndUoM'
|
|
211
|
+
|| column.text === 'Tax' || column.Field === 'Disc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
|
|
212
|
+
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
213
|
+
if (column.Field === 'Disc') {
|
|
214
|
+
if (column.type === 'percentage') {
|
|
215
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
216
|
+
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
dataRow.push({ text: '', noWrap: true });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
224
|
+
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
dataRow.push({ text: '', noWrap: true });
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
else {
|
|
232
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
233
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center', nowrap: true });
|
|
234
|
+
}
|
|
235
|
+
else {
|
|
236
|
+
dataRow.push({ text: '', noWrap: true });
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
// dataRow.push(part[column.Field].toString());
|
|
242
|
+
if (column.Field === 'Desc') {
|
|
243
|
+
let DescData = [];
|
|
244
|
+
DescData.push(part[column.Field].toString());
|
|
245
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
246
|
+
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
247
|
+
}
|
|
248
|
+
dataRow.push({ stack: DescData });
|
|
249
|
+
}
|
|
250
|
+
else {
|
|
251
|
+
dataRow.push({ text: part[column.Field].toString() });
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
if (column.Field === 'SNo') {
|
|
259
|
+
part[column.Field] = SNo;
|
|
260
|
+
SNo = SNo + 1;
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
part[column.Field] = '';
|
|
264
|
+
}
|
|
265
|
+
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
body.push(dataRow);
|
|
269
|
+
});
|
|
270
|
+
// if (Labor.length !== 0) {
|
|
271
|
+
// let dummypartadding1: any = {};
|
|
272
|
+
// dummypartadding1.SNo = '';
|
|
273
|
+
// dummypartadding1.Desc = 'Labor';
|
|
274
|
+
// dummypartadding1.Qty = '';
|
|
275
|
+
// dummypartadding1.UnPr = '';
|
|
276
|
+
// dummypartadding1.LineTotal = '';
|
|
277
|
+
// Labor.unshift(dummypartadding1);
|
|
278
|
+
// // DummyOps.unshift(dummypartadding1);
|
|
279
|
+
// }
|
|
280
|
+
// if (Body === 2) {
|
|
281
|
+
// for (let i = 0; i < Labor.length; i++) {
|
|
282
|
+
// Labor[i].UnPr = '';
|
|
283
|
+
// }
|
|
284
|
+
// }
|
|
285
|
+
// Labor.forEach((Ops: any) => {
|
|
286
|
+
// var dataRow: any = [];
|
|
287
|
+
// columns.forEach((column: any) => {
|
|
288
|
+
// if ((!TrUtils.IsFixedZero(Ops[column.Field]) && !TrUtils.IsNull(Ops[column.Field]))
|
|
289
|
+
// || (column.text === 'Line Total')) {
|
|
290
|
+
// if (Ops[column.Field] === 'Labor') {
|
|
291
|
+
// dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
292
|
+
// } else {
|
|
293
|
+
// if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
294
|
+
// && TrUtils.CheckInvalidSelect(Ops.TCode))) {
|
|
295
|
+
// Ops[column.Field] = '';
|
|
296
|
+
// dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
|
|
297
|
+
// } else {
|
|
298
|
+
// if (column.text === 'Line Total' || column.Field === 'Price' || column.text === 'Tax' || column.Field === 'UnPr'
|
|
299
|
+
// || column.Field === 'QtyAndUoM' || column.Field === 'Disc' || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt'
|
|
300
|
+
// || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
301
|
+
// if (column.Field === 'Disc') {
|
|
302
|
+
// if (column.type === 'percentage') {
|
|
303
|
+
// if (Ops.Perc && !TrUtils.IsZero(Ops[column.Field])) {
|
|
304
|
+
// dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
305
|
+
// } else {
|
|
306
|
+
// dataRow.push({ text: '', noWrap: true });
|
|
307
|
+
// }
|
|
308
|
+
// } else {
|
|
309
|
+
// if (!Ops.Perc && !TrUtils.IsZero(Ops[column.Field])) {
|
|
310
|
+
// dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
311
|
+
// } else {
|
|
312
|
+
// dataRow.push({ text: '', noWrap: true });
|
|
313
|
+
// }
|
|
314
|
+
// }
|
|
315
|
+
// } else {
|
|
316
|
+
// if (!TrUtils.IsZero(Ops[column.Field])) {
|
|
317
|
+
// dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
318
|
+
// } else {
|
|
319
|
+
// dataRow.push({ text: '', noWrap: true });
|
|
320
|
+
// }
|
|
321
|
+
// }
|
|
322
|
+
// } else {
|
|
323
|
+
// dataRow.push(Ops[column.Field].toString());
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
326
|
+
// }
|
|
327
|
+
// } else {
|
|
328
|
+
// if (column.Field === 'SNo') {
|
|
329
|
+
// Ops[column.Field] = SNo;
|
|
330
|
+
// SNo = SNo + 1;
|
|
331
|
+
// } else {
|
|
332
|
+
// Ops[column.Field] = '';
|
|
333
|
+
// }
|
|
334
|
+
// dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
|
|
335
|
+
// }
|
|
336
|
+
// });
|
|
337
|
+
// body.push(dataRow);
|
|
338
|
+
// });
|
|
339
|
+
return body;
|
|
340
|
+
}
|
|
341
|
+
static GetWithOutDiscAndTaxFieldHeader(Parts, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
342
|
+
if (Parts.length !== 0) {
|
|
343
|
+
if (ShowTaxColumn) {
|
|
344
|
+
return this.TaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
if (ConsolidateGST) {
|
|
348
|
+
return this.ConsolidateDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
|
|
349
|
+
}
|
|
350
|
+
else {
|
|
351
|
+
return this.NoTaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn);
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
else {
|
|
356
|
+
let a = '';
|
|
357
|
+
return a;
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
static TaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
361
|
+
if (PrintPartNo) {
|
|
362
|
+
if (ShowIGST) {
|
|
363
|
+
return {
|
|
364
|
+
style: 'tableExample',
|
|
365
|
+
table: {
|
|
366
|
+
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
367
|
+
// headerRows: 2,
|
|
368
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
369
|
+
},
|
|
370
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
return {
|
|
375
|
+
style: 'tableExample',
|
|
376
|
+
table: {
|
|
377
|
+
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
378
|
+
// headerRows: 2,
|
|
379
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
380
|
+
},
|
|
381
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
else {
|
|
386
|
+
if (ShowIGST) {
|
|
387
|
+
return {
|
|
388
|
+
style: 'tableExample',
|
|
389
|
+
table: {
|
|
390
|
+
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
391
|
+
// headerRows: 2,
|
|
392
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
393
|
+
},
|
|
394
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
else {
|
|
398
|
+
return {
|
|
399
|
+
style: 'tableExample',
|
|
400
|
+
table: {
|
|
401
|
+
widths: shared_print_service_1.PrintSharedService.TaxTableWidths(PrintPartNo, ShowIGST, ShowDiscountColumn),
|
|
402
|
+
// headerRows: 2,
|
|
403
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
404
|
+
},
|
|
405
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
static ConsolidateDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
411
|
+
if (PrintPartNo) {
|
|
412
|
+
return {
|
|
413
|
+
style: 'tableExample',
|
|
414
|
+
table: {
|
|
415
|
+
widths: [15, 70, 273, 25, 60, 80, 10, 40],
|
|
416
|
+
// headerRows: 1,
|
|
417
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
418
|
+
},
|
|
419
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
else {
|
|
423
|
+
return {
|
|
424
|
+
style: 'tableExample',
|
|
425
|
+
table: {
|
|
426
|
+
widths: [20, 300, 50, 80, 80, 10, 40],
|
|
427
|
+
// headerRows: 1,
|
|
428
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
429
|
+
},
|
|
430
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
static NoTaxDataTable(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn) {
|
|
435
|
+
if (PrintPartNo) {
|
|
436
|
+
return {
|
|
437
|
+
style: 'tableExample',
|
|
438
|
+
table: {
|
|
439
|
+
widths: this.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
|
|
440
|
+
// headerRows: 1,
|
|
441
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
442
|
+
},
|
|
443
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
return {
|
|
448
|
+
style: 'tableExample',
|
|
449
|
+
table: {
|
|
450
|
+
widths: this.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
|
|
451
|
+
// headerRows: 1,
|
|
452
|
+
body: this.BuildTableBodyForLaborAndParts(Parts, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn)
|
|
453
|
+
},
|
|
454
|
+
layout: shared_print_service_1.PrintSharedService.LayOutStyle()
|
|
455
|
+
};
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
static WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo) {
|
|
459
|
+
if (PrintPartNo) {
|
|
460
|
+
// if (ShowDiscountColumn) {
|
|
461
|
+
// return [24, 70, 200, 25, 60, 38, 38, 50];
|
|
462
|
+
// } else {
|
|
463
|
+
return [25, '*', 250, 80];
|
|
464
|
+
// }
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
// if (ShowDiscountColumn) {
|
|
468
|
+
// return [25, 230, 40, 70, 40, 40, 70];
|
|
469
|
+
// } else {
|
|
470
|
+
return [25, '*', 80];
|
|
471
|
+
// }
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
static CommonTotalDetails(ROPrintData, index, numberofCopies) {
|
|
475
|
+
let CommonDetails = [
|
|
476
|
+
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
477
|
+
// SharedPDFService.GetUnderLine(),
|
|
478
|
+
shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
|
|
479
|
+
];
|
|
480
|
+
if (ROPrintData.Type !== 'Invoice') {
|
|
481
|
+
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
482
|
+
}
|
|
483
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
484
|
+
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
485
|
+
}
|
|
486
|
+
return CommonDetails;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
exports.DCWithoutPricePdfService = DCWithoutPricePdfService;
|