shareneus 1.4.35 → 1.4.36
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 +13 -13
- package/dist/excel-files/GSTR-RO-excel.service.js +3 -3
- package/dist/excel-files/GSTR1-excel.service.js +7 -7
- package/dist/excel-files/GSTR2-excel.service.js +6 -6
- package/dist/excel-files/analysis-excel.service.js +4 -4
- package/dist/excel-files/category-wise-item-excel.service.js +10 -10
- package/dist/excel-files/cust-balance-excel.service.js +5 -5
- package/dist/excel-files/cust-wise-sales-details.js +5 -5
- package/dist/excel-files/cust-wise-sales-summary-excel.service.js +5 -5
- package/dist/excel-files/expiring-drugs-excel.service.js +7 -7
- package/dist/excel-files/insurance-expire-excel.service.js +4 -4
- package/dist/excel-files/invoice-wise-excel.service.js +3 -3
- package/dist/excel-files/item-wise-doctor-sale-excel.service.js +7 -7
- package/dist/excel-files/item-wise-mout-details.js +4 -4
- package/dist/excel-files/item-wise-mout-summary.js +4 -4
- package/dist/excel-files/items-wise-sales-excel.service.js +10 -10
- package/dist/excel-files/manf-wise-sales-excel.service.js +4 -4
- package/dist/excel-files/next-service-date-excel.service.js +5 -5
- package/dist/excel-files/operator-wise-details.js +4 -4
- package/dist/excel-files/operator-wise-summary.js +4 -4
- package/dist/excel-files/payment-receive-excel.service.js +6 -6
- package/dist/excel-files/payments-made-excel.service.js +6 -6
- package/dist/excel-files/repair-orders-excel.service.js +10 -10
- package/dist/excel-files/sa-wise-labor-sales-excel.service.js +6 -6
- package/dist/excel-files/sa-wise-part-sales-excel.service.js +6 -6
- package/dist/excel-files/sale-summary-excel.service.js +3 -3
- package/dist/excel-files/sales-by-service-summary-excel.service.js +14 -14
- package/dist/excel-files/scheduled-drug-summary-excel.service.js +8 -8
- package/dist/excel-files/scheduled-drugs-excel.service.js +10 -10
- package/dist/excel-files/spares-issue-excel.service.js +14 -14
- package/dist/excel-files/stock-excel.service.js +3 -3
- package/dist/excel-files/tally-sales-import.service.js +3 -3
- package/dist/excel-files/ven-balance-excel.service.js +3 -3
- package/dist/index.js +6 -6
- package/dist/services/analysis-pdf.service.js +8 -8
- package/dist/services/appointment-total.service.js +37 -37
- package/dist/services/auto-sales-receipt-pdf.service.js +24 -24
- package/dist/services/category-wise-item-pdf.service.js +6 -6
- package/dist/services/checklist-pdf.js +3 -3
- package/dist/services/cn-print.service.js +33 -33
- package/dist/services/consultation-fee-receipt.service.js +16 -16
- package/dist/services/consultation-full-pdf.service.js +10 -10
- package/dist/services/consultation-letterhead-pdf.service.js +15 -15
- package/dist/services/consultation-pdf.service.js +15 -15
- package/dist/services/credit-note-pdf.service.js +16 -16
- package/dist/services/credit-note-totals.service.js +31 -31
- package/dist/services/cust-wise-sales-details-pdf.service.js +8 -8
- package/dist/services/cust-wise-sales-summary-pdf.service.js +7 -7
- package/dist/services/customer-balances-pdf.service.js +7 -7
- package/dist/services/dc-landscape-pdf.service.js +28 -28
- package/dist/services/dc-landscape-without-price-pdf.service.js +24 -24
- package/dist/services/dc-without-price-pdf.service.js +15 -15
- package/dist/services/debit-note-pdf.service.js +14 -14
- package/dist/services/debit-note-print.service.js +33 -33
- package/dist/services/debit-note-totals.service.js +28 -28
- package/dist/services/delivery-challan-pdf.service.js +16 -16
- package/dist/services/delivery-challan-print.service.js +26 -26
- package/dist/services/delivery-challan-totals.js +32 -32
- package/dist/services/equipment-design-pdf.service.js +10 -10
- package/dist/services/est.print-service.js +150 -150
- package/dist/services/expiring-drugs-pdf.service.js +6 -6
- package/dist/services/hc-inv-pdf.service.js +42 -42
- package/dist/services/insurance-expire-pdf.service.js +1 -1
- package/dist/services/inv-pdf.service.js +54 -54
- package/dist/services/inv-print.service.js +59 -59
- package/dist/services/invoice-landscape-pdf.service.js +29 -29
- package/dist/services/invoice-letterhead-pdf.service.js +54 -54
- package/dist/services/invoice-portrait-pdf.js +51 -51
- package/dist/services/invoice-total.service.js +78 -78
- package/dist/services/issue-parts-pdf.service.js +43 -43
- package/dist/services/item-bar-code-label-pdf.js +2 -2
- package/dist/services/item-price-for-pricelist.js +29 -46
- package/dist/services/item-wise-doctor-sale-pdf.service.js +3 -3
- package/dist/services/item-wise-mout-details-pdf.js +3 -3
- package/dist/services/item-wise-mout-summary-pdf.js +2 -2
- package/dist/services/item-wise-sales-pdf.service.js +6 -6
- package/dist/services/manf-wise-sales-pdf.service.js +5 -5
- package/dist/services/meeting-pdf.js +14 -14
- package/dist/services/mout-pdf.service.js +17 -17
- package/dist/services/next-service-date-pdf.service.js +1 -1
- package/dist/services/operator-wise-details-pdf.service.js +8 -8
- package/dist/services/operator-wise-summary-pdf.js +7 -7
- package/dist/services/pack-ship-pdf.service.js +3 -3
- package/dist/services/pack-ship-print.service.js +26 -26
- package/dist/services/payment-pdf.service.js +4 -4
- package/dist/services/payment-report-pdf.service.js +3 -3
- package/dist/services/po-totals.service.js +28 -28
- package/dist/services/pos-receipt-pdf.js +19 -19
- package/dist/services/purchase-order-pdf.service.js +40 -40
- package/dist/services/purchase-order-print.service.js +43 -43
- package/dist/services/purchase-order-totals.service.js +53 -53
- package/dist/services/receipt-print.service.js +5 -5
- package/dist/services/reorder-point-pdf.service.js +3 -3
- package/dist/services/repair-orders-pdf.service.js +3 -3
- package/dist/services/ro-pdf.service.js +80 -80
- package/dist/services/ro-print-service.js +87 -87
- package/dist/services/ro-totals.service.js +123 -123
- package/dist/services/sales-by-service-pdf.service.js +6 -6
- package/dist/services/sales-pdf.service.js +23 -23
- package/dist/services/sales-print.service.js +54 -54
- package/dist/services/sales-receipt-pdf.service.js +25 -25
- package/dist/services/sales-receipt-print.service.js +62 -62
- package/dist/services/sales-totals.service.js +33 -33
- package/dist/services/scheduled-drug-pdf.service.js +7 -7
- package/dist/services/scheduled-drug-summary-pdf.service.js +4 -4
- package/dist/services/separate-wo-print.service.js +9 -9
- package/dist/services/shared-inv-pdf.service.js +44 -44
- package/dist/services/shared-pdf.service.js +119 -119
- package/dist/services/shared-print.service.js +68 -68
- package/dist/services/task-pdf.service.js +10 -10
- package/dist/services/task-reports-pdf.service.js +9 -9
- package/dist/services/technician-pdf.service.js +10 -10
- package/dist/services/technician-print.service.js +9 -9
- package/dist/services/vendor-balances-pdf.service.js +6 -6
- package/dist/services/vendor-credit-note-pdf.service.js +27 -27
- package/dist/services/vendor-credit-note-print.service.js +29 -29
- package/dist/services/vendor-credit-note-totals.service.js +37 -37
- package/dist/services/vendor-debit-note-pdf.service.js +16 -16
- package/dist/services/vendor-debit-note-print.service.js +29 -29
- package/dist/services/vendor-debit-note-totals.service.js +30 -30
- package/dist/shared/math-operations.js +184 -0
- package/dist/shared/util.js +15 -0
- package/dist/{shared → utils}/my-date.js +31 -31
- package/dist/{shared/utils.js → utils/tr-utils.js} +0 -8
- package/package.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvoiceLetterheadPdfService = void 0;
|
|
4
|
-
const my_date_1 = require("../
|
|
5
|
-
const
|
|
4
|
+
const my_date_1 = require("../utils/my-date");
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
7
7
|
const shared_print_service_1 = require("./shared-print.service");
|
|
8
8
|
class InvoiceLetterheadPdfService {
|
|
@@ -11,7 +11,7 @@ class InvoiceLetterheadPdfService {
|
|
|
11
11
|
}
|
|
12
12
|
static GetInvoiceLetterheadPrint(ROPrintData, numberofCopies, isotherIndustry, withPass, isAuto, LetterHead, moreDiscDetails) {
|
|
13
13
|
var contents = [];
|
|
14
|
-
if (
|
|
14
|
+
if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
|
|
15
15
|
contents.push(this.CommonHeaderDetails(ROPrintData, null, isotherIndustry), this.PreparesparePartsTable(ROPrintData, isAuto), this.CommonTotalDetails(ROPrintData, null, numberofCopies, withPass, isAuto, moreDiscDetails));
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
@@ -31,7 +31,7 @@ class InvoiceLetterheadPdfService {
|
|
|
31
31
|
return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
|
|
32
32
|
},
|
|
33
33
|
pageBreakBefore: function (currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) {
|
|
34
|
-
return currentNode.startPosition.top >= 700 && !
|
|
34
|
+
return currentNode.startPosition.top >= 700 && !tr_utils_1.TrUtils.IsNull(currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) && (currentNode === null || currentNode === void 0 ? void 0 : currentNode.id) === '567';
|
|
35
35
|
},
|
|
36
36
|
pageMargins: [10, LetterHead.Top, 10, LetterHead.Bottom],
|
|
37
37
|
content: contents,
|
|
@@ -49,7 +49,7 @@ class InvoiceLetterheadPdfService {
|
|
|
49
49
|
}
|
|
50
50
|
static GetFileName(ROPrintData) {
|
|
51
51
|
let fileName = ROPrintData.HeaderName;
|
|
52
|
-
if (!
|
|
52
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
53
53
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
54
54
|
}
|
|
55
55
|
return fileName;
|
|
@@ -75,19 +75,19 @@ class InvoiceLetterheadPdfService {
|
|
|
75
75
|
let List = [];
|
|
76
76
|
if (ROPrintData.Entity.Body === 1) {
|
|
77
77
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
78
|
-
if (
|
|
78
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
79
79
|
ROPrintData.PrintInfo[i].Text = '';
|
|
80
80
|
}
|
|
81
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(
|
|
81
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.Entity.MPN));
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
85
|
if (ROPrintData.Entity.Body === 2) {
|
|
86
86
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
87
|
-
if (
|
|
87
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
88
88
|
ROPrintData.PrintInfo[i].Text = '';
|
|
89
89
|
}
|
|
90
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
90
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto));
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
else {
|
|
@@ -96,10 +96,10 @@ class InvoiceLetterheadPdfService {
|
|
|
96
96
|
}
|
|
97
97
|
else {
|
|
98
98
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
99
|
-
if (
|
|
99
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
100
100
|
ROPrintData.PrintInfo[i].Text = '';
|
|
101
101
|
}
|
|
102
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
102
|
+
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto));
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -193,24 +193,24 @@ class InvoiceLetterheadPdfService {
|
|
|
193
193
|
let FinalTotal = 0;
|
|
194
194
|
Parts.forEach((part) => {
|
|
195
195
|
// console.log('part', part);
|
|
196
|
-
Qty = Qty +
|
|
197
|
-
CGSTAMT = CGSTAMT +
|
|
198
|
-
SGSTAMT = SGSTAMT +
|
|
199
|
-
IGSTAMT = IGSTAMT +
|
|
200
|
-
Taxable = Taxable +
|
|
201
|
-
FinalTotal = FinalTotal +
|
|
196
|
+
Qty = Qty + tr_utils_1.TrUtils.FixedTo(part.Qty);
|
|
197
|
+
CGSTAMT = CGSTAMT + tr_utils_1.TrUtils.FixedTo(part.CGSTAmt);
|
|
198
|
+
SGSTAMT = SGSTAMT + tr_utils_1.TrUtils.FixedTo(part.SGSTAmt);
|
|
199
|
+
IGSTAMT = IGSTAMT + tr_utils_1.TrUtils.FixedTo(part.IGSTAmt);
|
|
200
|
+
Taxable = Taxable + tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc);
|
|
201
|
+
FinalTotal = FinalTotal + tr_utils_1.TrUtils.FixedTo(part.AfterPartTax);
|
|
202
202
|
});
|
|
203
203
|
let dpartadding1 = {};
|
|
204
204
|
dpartadding1.SNo = '';
|
|
205
205
|
dpartadding1.Desc = 'Spare Total';
|
|
206
|
-
dpartadding1.QtyAndUoM =
|
|
206
|
+
dpartadding1.QtyAndUoM = tr_utils_1.TrUtils.FixedTo(Qty);
|
|
207
207
|
dpartadding1.bold = true;
|
|
208
|
-
dpartadding1.UnPr =
|
|
209
|
-
dpartadding1.SGSTAmt =
|
|
210
|
-
dpartadding1.IGSTAmt =
|
|
211
|
-
dpartadding1.CGSTAmt =
|
|
208
|
+
dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable);
|
|
209
|
+
dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT);
|
|
210
|
+
dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT);
|
|
211
|
+
dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT);
|
|
212
212
|
dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
|
|
213
|
-
dpartadding1.LineTotal =
|
|
213
|
+
dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal);
|
|
214
214
|
Parts.push({ SNo: '' });
|
|
215
215
|
Parts.push(dpartadding1);
|
|
216
216
|
}
|
|
@@ -226,14 +226,14 @@ class InvoiceLetterheadPdfService {
|
|
|
226
226
|
Parts.forEach((part) => {
|
|
227
227
|
var dataRow = [];
|
|
228
228
|
columns.forEach((column) => {
|
|
229
|
-
if ((!
|
|
229
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
230
230
|
|| (column.text === 'Line Total')) {
|
|
231
231
|
if (part[column.Field] === 'Spare Parts') {
|
|
232
232
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
233
233
|
}
|
|
234
234
|
else {
|
|
235
235
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
236
|
-
&&
|
|
236
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
237
237
|
part[column.Field] = '';
|
|
238
238
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
239
239
|
}
|
|
@@ -243,7 +243,7 @@ class InvoiceLetterheadPdfService {
|
|
|
243
243
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
244
244
|
if (column.Field === 'Disc') {
|
|
245
245
|
if (column.type === 'percentage') {
|
|
246
|
-
if (!
|
|
246
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
247
247
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
@@ -251,7 +251,7 @@ class InvoiceLetterheadPdfService {
|
|
|
251
251
|
}
|
|
252
252
|
}
|
|
253
253
|
else {
|
|
254
|
-
if (!
|
|
254
|
+
if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
255
255
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
256
256
|
}
|
|
257
257
|
else {
|
|
@@ -260,7 +260,7 @@ class InvoiceLetterheadPdfService {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
else {
|
|
263
|
-
if (!
|
|
263
|
+
if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
264
264
|
dataRow.push({ text: part[column.Field].toString(), bold: part.bold, alignment: 'right', nowrap: true });
|
|
265
265
|
}
|
|
266
266
|
else {
|
|
@@ -273,7 +273,7 @@ class InvoiceLetterheadPdfService {
|
|
|
273
273
|
if (column.Field === 'Desc') {
|
|
274
274
|
let DescData = [];
|
|
275
275
|
DescData.push({ text: part[column.Field].toString(), bold: part.bold });
|
|
276
|
-
if (!
|
|
276
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
277
277
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
278
278
|
}
|
|
279
279
|
dataRow.push({ stack: DescData });
|
|
@@ -291,7 +291,7 @@ class InvoiceLetterheadPdfService {
|
|
|
291
291
|
SNo = SNo + 1;
|
|
292
292
|
}
|
|
293
293
|
else {
|
|
294
|
-
if (
|
|
294
|
+
if (tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
295
295
|
part[column.Field] = '';
|
|
296
296
|
}
|
|
297
297
|
}
|
|
@@ -312,23 +312,23 @@ class InvoiceLetterheadPdfService {
|
|
|
312
312
|
Labor.forEach((operation) => {
|
|
313
313
|
// console.log('operation', operation);
|
|
314
314
|
// Qty = Qty + operation.Qty;
|
|
315
|
-
CGSTAMT = CGSTAMT +
|
|
316
|
-
SGSTAMT = SGSTAMT +
|
|
317
|
-
IGSTAMT = IGSTAMT +
|
|
318
|
-
Taxable = Taxable +
|
|
319
|
-
FinalTotal = FinalTotal +
|
|
315
|
+
CGSTAMT = CGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt);
|
|
316
|
+
SGSTAMT = SGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt);
|
|
317
|
+
IGSTAMT = IGSTAMT + tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt);
|
|
318
|
+
Taxable = Taxable + tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc);
|
|
319
|
+
FinalTotal = FinalTotal + tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax);
|
|
320
320
|
});
|
|
321
321
|
let dpartadding1 = {};
|
|
322
322
|
dpartadding1.SNo = '';
|
|
323
323
|
dpartadding1.Desc = 'Labor Total';
|
|
324
324
|
// dpartadding1.QtyAndUoM = Qty;
|
|
325
|
-
dpartadding1.UnPr =
|
|
326
|
-
dpartadding1.SGSTAmt =
|
|
327
|
-
dpartadding1.IGSTAmt =
|
|
328
|
-
dpartadding1.CGSTAmt =
|
|
325
|
+
dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable);
|
|
326
|
+
dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT);
|
|
327
|
+
dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT);
|
|
328
|
+
dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT);
|
|
329
329
|
dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
|
|
330
330
|
dpartadding1.bold = true;
|
|
331
|
-
dpartadding1.LineTotal =
|
|
331
|
+
dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal);
|
|
332
332
|
Labor.push({ SNo: '' });
|
|
333
333
|
Labor.push(dpartadding1);
|
|
334
334
|
}
|
|
@@ -349,14 +349,14 @@ class InvoiceLetterheadPdfService {
|
|
|
349
349
|
Labor.forEach((Ops) => {
|
|
350
350
|
var dataRow = [];
|
|
351
351
|
columns.forEach((column) => {
|
|
352
|
-
if ((!
|
|
352
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(Ops[column.Field]) && !tr_utils_1.TrUtils.IsNull(Ops[column.Field]))
|
|
353
353
|
|| (column.text === 'Line Total')) {
|
|
354
354
|
if (Ops[column.Field] === 'Labor') {
|
|
355
355
|
dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
356
356
|
}
|
|
357
357
|
else {
|
|
358
358
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
359
|
-
&&
|
|
359
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(Ops.TCode))) {
|
|
360
360
|
Ops[column.Field] = '';
|
|
361
361
|
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
|
|
362
362
|
}
|
|
@@ -366,7 +366,7 @@ class InvoiceLetterheadPdfService {
|
|
|
366
366
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
367
367
|
if (column.Field === 'Disc') {
|
|
368
368
|
if (column.type === 'percentage') {
|
|
369
|
-
if (!
|
|
369
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Ops[column.Field])) {
|
|
370
370
|
dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
371
371
|
}
|
|
372
372
|
else {
|
|
@@ -374,7 +374,7 @@ class InvoiceLetterheadPdfService {
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
else {
|
|
377
|
-
if (!
|
|
377
|
+
if (!tr_utils_1.TrUtils.IsNull(Ops[column.Field])) {
|
|
378
378
|
dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
379
379
|
}
|
|
380
380
|
else {
|
|
@@ -383,7 +383,7 @@ class InvoiceLetterheadPdfService {
|
|
|
383
383
|
}
|
|
384
384
|
}
|
|
385
385
|
else {
|
|
386
|
-
if (!
|
|
386
|
+
if (!tr_utils_1.TrUtils.IsNull(Ops[column.Field])) {
|
|
387
387
|
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true, bold: Ops.bold });
|
|
388
388
|
}
|
|
389
389
|
else {
|
|
@@ -403,7 +403,7 @@ class InvoiceLetterheadPdfService {
|
|
|
403
403
|
SNo = SNo + 1;
|
|
404
404
|
}
|
|
405
405
|
else {
|
|
406
|
-
if (
|
|
406
|
+
if (tr_utils_1.TrUtils.IsNull(Ops[column.Field])) {
|
|
407
407
|
Ops[column.Field] = '';
|
|
408
408
|
}
|
|
409
409
|
}
|
|
@@ -554,7 +554,7 @@ class InvoiceLetterheadPdfService {
|
|
|
554
554
|
Parts.forEach((part) => {
|
|
555
555
|
var dataRow = [];
|
|
556
556
|
columns.forEach((column) => {
|
|
557
|
-
if (!
|
|
557
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
|
|
558
558
|
|| column.text === 'Line Total') {
|
|
559
559
|
if (part[column.Field] === 'Spare Parts') {
|
|
560
560
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -574,7 +574,7 @@ class InvoiceLetterheadPdfService {
|
|
|
574
574
|
if (column.Field === 'Desc') {
|
|
575
575
|
let DescData = [];
|
|
576
576
|
DescData.push(part[column.Field].toString());
|
|
577
|
-
if (!
|
|
577
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
578
578
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
579
579
|
}
|
|
580
580
|
dataRow.push({ stack: DescData });
|
|
@@ -591,7 +591,7 @@ class InvoiceLetterheadPdfService {
|
|
|
591
591
|
SNo = SNo + 1;
|
|
592
592
|
}
|
|
593
593
|
else {
|
|
594
|
-
if (
|
|
594
|
+
if (tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
595
595
|
part[column.Field] = '';
|
|
596
596
|
}
|
|
597
597
|
}
|
|
@@ -617,7 +617,7 @@ class InvoiceLetterheadPdfService {
|
|
|
617
617
|
Ops.forEach((labor) => {
|
|
618
618
|
var dataRow = [];
|
|
619
619
|
columns.forEach((column) => {
|
|
620
|
-
if (!
|
|
620
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(labor[column.Field]) && !tr_utils_1.TrUtils.IsNull(labor[column.Field])
|
|
621
621
|
|| column.text === 'Line Total') {
|
|
622
622
|
if (labor[column.Field] === 'Labor') {
|
|
623
623
|
dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -643,7 +643,7 @@ class InvoiceLetterheadPdfService {
|
|
|
643
643
|
SNo = SNo + 1;
|
|
644
644
|
}
|
|
645
645
|
else {
|
|
646
|
-
if (
|
|
646
|
+
if (tr_utils_1.TrUtils.IsNull(labor[column.Field])) {
|
|
647
647
|
labor[column.Field] = '';
|
|
648
648
|
}
|
|
649
649
|
}
|
|
@@ -687,7 +687,7 @@ class InvoiceLetterheadPdfService {
|
|
|
687
687
|
// ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
688
688
|
// TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax,
|
|
689
689
|
// ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj,ROPrintData.STotal),
|
|
690
|
-
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails1(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupDataByPerc, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
690
|
+
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails1(ROPrintData, ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalAfterDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupDataByPerc, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, ROPrintData.Adj, ROPrintData.CustLaborTaxGroupDataByPerc, ROPrintData.STotal, isAuto, moreDiscDetails),
|
|
691
691
|
this.GetNumberInWords(ROPrintData.CustRoundedTotal),
|
|
692
692
|
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, ROPrintData.isCountersale),
|
|
693
693
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
@@ -701,7 +701,7 @@ class InvoiceLetterheadPdfService {
|
|
|
701
701
|
if (ROPrintData.Type !== 'Invoice') {
|
|
702
702
|
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
703
703
|
}
|
|
704
|
-
if (!
|
|
704
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
705
705
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
706
706
|
}
|
|
707
707
|
return CommonDetails;
|
|
@@ -772,7 +772,7 @@ class InvoiceLetterheadPdfService {
|
|
|
772
772
|
];
|
|
773
773
|
if (!isOtherIndustry) {
|
|
774
774
|
a.unshift({ name: 'Regn. No', value: shared_pdf_service_1.SharedPDFService.CheckAndSetString(Vehicle.RegNo) });
|
|
775
|
-
if (!
|
|
775
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Vehicle.VIN)) {
|
|
776
776
|
a.unshift({ name: 'Chassis No', value: shared_pdf_service_1.SharedPDFService.CheckAndSetString(Vehicle.VIN) });
|
|
777
777
|
}
|
|
778
778
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvoicePortraitPrintService = void 0;
|
|
4
4
|
const enums_1 = require("../enums/enums");
|
|
5
|
-
const my_date_1 = require("../
|
|
6
|
-
const
|
|
5
|
+
const my_date_1 = require("../utils/my-date");
|
|
6
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
7
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
8
8
|
class InvoicePortraitPrintService {
|
|
9
9
|
static GetPrint(InvoicePDFData, size, printOptions, moreDiscDetails) {
|
|
10
10
|
// console.log('InvoicePDFData', InvoicePDFData);
|
|
11
|
-
if (
|
|
11
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePDFData.Name)) {
|
|
12
12
|
InvoicePDFData.Name = '';
|
|
13
13
|
}
|
|
14
14
|
let dd = {
|
|
@@ -123,7 +123,7 @@ class InvoicePortraitPrintService {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
static GetMainHeaderInfo(InvoicePDFData) {
|
|
126
|
-
if (!
|
|
126
|
+
if (!tr_utils_1.TrUtils.IsNull(InvoicePDFData.Image)) {
|
|
127
127
|
return {
|
|
128
128
|
columns: [{ image: InvoicePDFData.Image, width: 60, height: 60, marginBottom: 5 },
|
|
129
129
|
{
|
|
@@ -187,7 +187,7 @@ class InvoicePortraitPrintService {
|
|
|
187
187
|
}
|
|
188
188
|
static GetFormatAddress(CustomerObj) {
|
|
189
189
|
var Addressnew = '';
|
|
190
|
-
if (!
|
|
190
|
+
if (!tr_utils_1.TrUtils.IsNull(CustomerObj.Adrs)) {
|
|
191
191
|
CustomerObj.Adrs.forEach((Adrs, index) => {
|
|
192
192
|
Addressnew = Addressnew + Adrs;
|
|
193
193
|
if (CustomerObj.Adrs.length > (index + 1)) {
|
|
@@ -198,7 +198,7 @@ class InvoicePortraitPrintService {
|
|
|
198
198
|
return Addressnew;
|
|
199
199
|
}
|
|
200
200
|
static GetCustomerDetails(Customer, Type, Vehicle, Settings, CustHeader) {
|
|
201
|
-
if (
|
|
201
|
+
if (tr_utils_1.TrUtils.IsNull(Customer)) {
|
|
202
202
|
return this.emptyObject();
|
|
203
203
|
}
|
|
204
204
|
let Data = [{ text: CustHeader + ':', style: 'hed', bold: true },
|
|
@@ -213,7 +213,7 @@ class InvoicePortraitPrintService {
|
|
|
213
213
|
}
|
|
214
214
|
static GetFormatContact(CustomerObj) {
|
|
215
215
|
var contactnew = '';
|
|
216
|
-
if (!
|
|
216
|
+
if (!tr_utils_1.TrUtils.IsNull(CustomerObj.Cons)) {
|
|
217
217
|
CustomerObj.Cons.forEach((Contact) => {
|
|
218
218
|
contactnew = contactnew + '(' + Contact.Type + '):' + Contact.No + '\n';
|
|
219
219
|
});
|
|
@@ -239,7 +239,7 @@ class InvoicePortraitPrintService {
|
|
|
239
239
|
return a;
|
|
240
240
|
}
|
|
241
241
|
static GetCustomerName(Customer) {
|
|
242
|
-
if (!
|
|
242
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Customer)) {
|
|
243
243
|
let GSTIN = { columns: [{ text: 'Customer Name :', width: 65, bold: true }, { text: Customer }] };
|
|
244
244
|
return GSTIN;
|
|
245
245
|
}
|
|
@@ -248,7 +248,7 @@ class InvoicePortraitPrintService {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
static GetCustomerGSTIN(Customer) {
|
|
251
|
-
if (!
|
|
251
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Customer.GSTIN)) {
|
|
252
252
|
let GSTIN = { columns: [{ text: 'GSTIN :', width: 33, style: 'hed' }, { text: Customer.GSTIN, marginTop: 1.5 }] };
|
|
253
253
|
return GSTIN;
|
|
254
254
|
}
|
|
@@ -257,7 +257,7 @@ class InvoicePortraitPrintService {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
static GetCustomerDLNo(Customer) {
|
|
260
|
-
if (!
|
|
260
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Customer.DLNo)) {
|
|
261
261
|
let GSTIN = { columns: [{ text: 'DL No :', width: 33, style: 'hed' }, { text: Customer.DLNo, marginTop: 1.5 }] };
|
|
262
262
|
return GSTIN;
|
|
263
263
|
}
|
|
@@ -283,10 +283,10 @@ class InvoicePortraitPrintService {
|
|
|
283
283
|
}
|
|
284
284
|
static GetHeaderInfo(InvoicePDFData, marginleft) {
|
|
285
285
|
let TaxInfo = [];
|
|
286
|
-
if (!
|
|
286
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
|
|
287
287
|
TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: marginleft, alignment: 'left', fontSize: 9, width: 'auto' });
|
|
288
288
|
}
|
|
289
|
-
if (!
|
|
289
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
|
|
290
290
|
TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
|
|
291
291
|
}
|
|
292
292
|
TaxInfo.push(this.GetBillofSupplyName(InvoicePDFData.Settings));
|
|
@@ -303,14 +303,14 @@ class InvoicePortraitPrintService {
|
|
|
303
303
|
static GrandTotalTable(data) {
|
|
304
304
|
var body = [];
|
|
305
305
|
data.forEach((row) => {
|
|
306
|
-
if (!
|
|
306
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(row.value) || row.name === 'Total') {
|
|
307
307
|
var dataRow = [];
|
|
308
308
|
dataRow.push({ text: (row.name).toString(), noWrap: true });
|
|
309
309
|
dataRow.push(':');
|
|
310
310
|
if (row.name === 'Final Total') {
|
|
311
311
|
dataRow.push({ text: (row.value).toString(), noWrap: true, bold: true, fontSize: 12, alignment: 'right' });
|
|
312
312
|
}
|
|
313
|
-
else if (!
|
|
313
|
+
else if (!tr_utils_1.TrUtils.IsNull(row.value)) {
|
|
314
314
|
dataRow.push({ text: (row.value).toString(), noWrap: true, alignment: 'right' });
|
|
315
315
|
}
|
|
316
316
|
else {
|
|
@@ -325,7 +325,7 @@ class InvoicePortraitPrintService {
|
|
|
325
325
|
return { text: Settings.Tax === 'BS' ? ' Bill of Supply' : null, alignment: 'center', marginLeft: 15, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
|
|
326
326
|
}
|
|
327
327
|
static GetDiscountOverall(InvoicePDFData) {
|
|
328
|
-
return
|
|
328
|
+
return tr_utils_1.TrUtils.FixPriceValue(Number(InvoicePDFData.FixedDisc));
|
|
329
329
|
}
|
|
330
330
|
static CustomerAndVehicleDetailsAfterLine(size) {
|
|
331
331
|
let length = 575;
|
|
@@ -429,7 +429,7 @@ class InvoicePortraitPrintService {
|
|
|
429
429
|
static BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size) {
|
|
430
430
|
let body = this.GetHeaderNames(ShowTaxColumn, SType, printOptions);
|
|
431
431
|
let j = 1;
|
|
432
|
-
if (!
|
|
432
|
+
if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
|
|
433
433
|
Services.forEach((item, index) => {
|
|
434
434
|
var _a;
|
|
435
435
|
let dataRow = [];
|
|
@@ -443,20 +443,20 @@ class InvoicePortraitPrintService {
|
|
|
443
443
|
dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
|
|
444
444
|
dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
|
|
445
445
|
dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
|
|
446
|
-
dataRow.push({ text:
|
|
446
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Pr), alignment: 'right', style: ['headerstyle'], });
|
|
447
447
|
if (printOptions.Disc !== 'NO') {
|
|
448
448
|
if (printOptions.Disc === 'PERC') {
|
|
449
|
-
dataRow.push({ text:
|
|
449
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
|
|
450
450
|
}
|
|
451
451
|
else {
|
|
452
|
-
dataRow.push({ text:
|
|
452
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
|
|
456
456
|
let Tax = (_a = item.TaxName) === null || _a === void 0 ? void 0 : _a.split('%');
|
|
457
|
-
dataRow.push({ text:
|
|
457
|
+
dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
|
|
458
458
|
}
|
|
459
|
-
dataRow.push({ text: item.Ret ? '-' +
|
|
459
|
+
dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
|
|
460
460
|
body.push(dataRow);
|
|
461
461
|
if (index + 1 === j * 9) {
|
|
462
462
|
j++;
|
|
@@ -471,8 +471,8 @@ class InvoicePortraitPrintService {
|
|
|
471
471
|
}
|
|
472
472
|
});
|
|
473
473
|
}
|
|
474
|
-
if (!
|
|
475
|
-
if (!
|
|
474
|
+
if (!tr_utils_1.TrUtils.IsNull(Items) && Items.length !== 0) {
|
|
475
|
+
if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
|
|
476
476
|
let dataRow = [];
|
|
477
477
|
dataRow.push({ text: '', });
|
|
478
478
|
dataRow.push({ text: '', });
|
|
@@ -511,21 +511,21 @@ class InvoicePortraitPrintService {
|
|
|
511
511
|
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate((_b = item['Batch']) === null || _b === void 0 ? void 0 : _b.ExDt), alignment: 'center', style: ['headerstyle'], });
|
|
512
512
|
dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
|
|
513
513
|
dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
|
|
514
|
-
dataRow.push({ text:
|
|
515
|
-
dataRow.push({ text:
|
|
514
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
|
|
515
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
|
|
516
516
|
if (printOptions.Disc !== 'NO') {
|
|
517
517
|
if (printOptions.Disc === 'PERC') {
|
|
518
|
-
dataRow.push({ text:
|
|
518
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
|
|
519
519
|
}
|
|
520
520
|
else {
|
|
521
|
-
dataRow.push({ text:
|
|
521
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
|
|
522
522
|
}
|
|
523
523
|
}
|
|
524
524
|
if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
|
|
525
525
|
let Tax = (_c = item.TaxName) === null || _c === void 0 ? void 0 : _c.split('%');
|
|
526
|
-
dataRow.push({ text:
|
|
526
|
+
dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
|
|
527
527
|
}
|
|
528
|
-
dataRow.push({ text: item.Ret ? '-' +
|
|
528
|
+
dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
|
|
529
529
|
body.push(dataRow);
|
|
530
530
|
if (index + 1 === j * 9) {
|
|
531
531
|
j++;
|
|
@@ -583,12 +583,12 @@ class InvoicePortraitPrintService {
|
|
|
583
583
|
let totalDisc;
|
|
584
584
|
let totalTax;
|
|
585
585
|
if (!ROPrintData.Consolidate) {
|
|
586
|
-
totalTax =
|
|
587
|
-
if (
|
|
588
|
-
totalDisc =
|
|
586
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborITax) + Number(ROPrintData.CustPartITax));
|
|
587
|
+
if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
|
|
588
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborDiscTotal) + Number(ROPrintData.CustPartsDiscTotal));
|
|
589
589
|
}
|
|
590
590
|
else {
|
|
591
|
-
totalDisc =
|
|
591
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(ROPrintData.CustLaborDiscTotal) + Number(ROPrintData.CustPartsDiscTotal));
|
|
592
592
|
}
|
|
593
593
|
}
|
|
594
594
|
return [
|
|
@@ -623,33 +623,33 @@ class InvoicePortraitPrintService {
|
|
|
623
623
|
static GrandTotal(InvoiceData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, subTotal, moreDiscDetails) {
|
|
624
624
|
let AccountFields = [];
|
|
625
625
|
if (moreDiscDetails) {
|
|
626
|
-
if (!
|
|
627
|
-
AccountFields.push({ name: 'Items Discount', value:
|
|
626
|
+
if (!tr_utils_1.TrUtils.IsZero(InvoiceData.PDisc)) {
|
|
627
|
+
AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.PDisc) });
|
|
628
628
|
}
|
|
629
|
-
if (!
|
|
630
|
-
AccountFields.push({ name: 'Services Discount', value:
|
|
629
|
+
if (!tr_utils_1.TrUtils.IsZero(InvoiceData.LDisc)) {
|
|
630
|
+
AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.LDisc) });
|
|
631
631
|
}
|
|
632
|
-
if (!
|
|
633
|
-
AccountFields.push({ name: 'Overall Discount', value:
|
|
632
|
+
if (!tr_utils_1.TrUtils.IsZero(InvoiceData.Disc)) {
|
|
633
|
+
AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(InvoiceData.Disc) });
|
|
634
634
|
}
|
|
635
635
|
}
|
|
636
636
|
else {
|
|
637
637
|
AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
|
|
638
638
|
}
|
|
639
|
-
if (!Consolidate && !
|
|
640
|
-
AccountFields.unshift({ name: 'SubTotal', value:
|
|
639
|
+
if (!Consolidate && !tr_utils_1.TrUtils.IsNull(subTotal)) {
|
|
640
|
+
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(subTotal))) });
|
|
641
641
|
}
|
|
642
642
|
else {
|
|
643
643
|
if (!Consolidate) {
|
|
644
|
-
AccountFields.unshift({ name: 'SubTotal', value:
|
|
644
|
+
AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))) });
|
|
645
645
|
}
|
|
646
646
|
}
|
|
647
|
-
if (!
|
|
647
|
+
if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
|
|
648
648
|
AccountFields.push({ name: 'Total Tax', value: totalTax });
|
|
649
649
|
}
|
|
650
|
-
if (!
|
|
650
|
+
if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
|
|
651
651
|
if (Adj > 0) {
|
|
652
|
-
Adj = '+' +
|
|
652
|
+
Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
|
|
653
653
|
}
|
|
654
654
|
AccountFields.push({ name: 'Adjust', value: Adj });
|
|
655
655
|
}
|
|
@@ -665,7 +665,7 @@ class InvoicePortraitPrintService {
|
|
|
665
665
|
let FinalTotal = { name: 'Final Total', value: GrandTotal, bold: true, fontSize: 12 };
|
|
666
666
|
AccountFields.push(total);
|
|
667
667
|
AccountFields.push(Rounding);
|
|
668
|
-
if (!
|
|
668
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
669
669
|
AccountFields.push(FinalTotal);
|
|
670
670
|
}
|
|
671
671
|
}
|
|
@@ -681,7 +681,7 @@ class InvoicePortraitPrintService {
|
|
|
681
681
|
}
|
|
682
682
|
// AccountFields.push(total);
|
|
683
683
|
AccountFields.push(Rounding);
|
|
684
|
-
if (!
|
|
684
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(Rounded)) {
|
|
685
685
|
AccountFields.push(FinalTotal);
|
|
686
686
|
}
|
|
687
687
|
}
|
|
@@ -736,21 +736,21 @@ class InvoicePortraitPrintService {
|
|
|
736
736
|
return HeaderNames;
|
|
737
737
|
}
|
|
738
738
|
static CreateHSNTaxTable(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
739
|
-
if (!
|
|
739
|
+
if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
|
|
740
740
|
var body = [];
|
|
741
741
|
let columns = this.CreateHeadingAllHSNTaxList(ShowIGST);
|
|
742
742
|
body.push(columns);
|
|
743
743
|
PartsTaxInfo.forEach((part) => {
|
|
744
744
|
var dataRow = [];
|
|
745
745
|
columns.forEach((column) => {
|
|
746
|
-
if (!
|
|
747
|
-
!
|
|
746
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
|
|
747
|
+
!tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST'
|
|
748
748
|
|| column.Field === 'TotalTaxAmount') {
|
|
749
749
|
if (column.Field === 'HSN') {
|
|
750
750
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
751
751
|
}
|
|
752
752
|
else {
|
|
753
|
-
dataRow.push({ text:
|
|
753
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(part[column.Field]).toString(), alignment: 'right', nowrap: true });
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
else {
|