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,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SalesReceiptpdfService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
5
5
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
6
|
const shared_print_service_1 = require("./shared-print.service");
|
|
7
7
|
class SalesReceiptpdfService {
|
|
@@ -10,7 +10,7 @@ class SalesReceiptpdfService {
|
|
|
10
10
|
}
|
|
11
11
|
static GetInvoicePrint(ROPrintData, numberofCopies, isotherIndustry, moreDiscDetails) {
|
|
12
12
|
var contents = [];
|
|
13
|
-
if (
|
|
13
|
+
if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
|
|
14
14
|
contents.push(this.CommonHeaderDetails(ROPrintData, null, isotherIndustry), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies, moreDiscDetails));
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
@@ -36,7 +36,7 @@ class SalesReceiptpdfService {
|
|
|
36
36
|
}
|
|
37
37
|
static GetFileName(ROPrintData) {
|
|
38
38
|
let fileName = ROPrintData.HeaderName;
|
|
39
|
-
if (!
|
|
39
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
40
40
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
41
41
|
}
|
|
42
42
|
return fileName;
|
|
@@ -62,19 +62,19 @@ class SalesReceiptpdfService {
|
|
|
62
62
|
// console.log('PreparesparePartsTable', ROPrintData.Entity.Body);
|
|
63
63
|
if (ROPrintData.Entity.Body === 1) {
|
|
64
64
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
65
|
-
if (
|
|
65
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
66
66
|
ROPrintData.PrintInfo[i].Text = '';
|
|
67
67
|
}
|
|
68
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetLaborPartsTableForView(
|
|
68
|
+
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));
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
72
|
if (ROPrintData.Entity.Body === 2) {
|
|
73
73
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
74
|
-
if (
|
|
74
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
75
75
|
ROPrintData.PrintInfo[i].Text = '';
|
|
76
76
|
}
|
|
77
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
77
|
+
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));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
@@ -83,10 +83,10 @@ class SalesReceiptpdfService {
|
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
85
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
86
|
-
if (
|
|
86
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
87
87
|
ROPrintData.PrintInfo[i].Text = '';
|
|
88
88
|
}
|
|
89
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
89
|
+
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));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -182,14 +182,14 @@ class SalesReceiptpdfService {
|
|
|
182
182
|
Parts.forEach((part) => {
|
|
183
183
|
var dataRow = [];
|
|
184
184
|
columns.forEach((column) => {
|
|
185
|
-
if ((!
|
|
185
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
186
186
|
|| (column.text === 'Line Total')) {
|
|
187
187
|
if (part[column.Field] === 'Spare Parts') {
|
|
188
188
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 10, style: 'InlineHeader' });
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
191
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
192
|
-
&&
|
|
192
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
193
193
|
part[column.Field] = '';
|
|
194
194
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
195
195
|
}
|
|
@@ -199,7 +199,7 @@ class SalesReceiptpdfService {
|
|
|
199
199
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
200
200
|
if (column.Field === 'Disc') {
|
|
201
201
|
if (column.type === 'percentage') {
|
|
202
|
-
if (!
|
|
202
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
203
203
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
@@ -207,7 +207,7 @@ class SalesReceiptpdfService {
|
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
else {
|
|
210
|
-
if (!
|
|
210
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
211
211
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
212
212
|
}
|
|
213
213
|
else {
|
|
@@ -216,7 +216,7 @@ class SalesReceiptpdfService {
|
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
else {
|
|
219
|
-
if (!
|
|
219
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
220
220
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
@@ -229,7 +229,7 @@ class SalesReceiptpdfService {
|
|
|
229
229
|
if (column.Field === 'Desc') {
|
|
230
230
|
let DescData = [];
|
|
231
231
|
DescData.push(part[column.Field].toString());
|
|
232
|
-
if (!
|
|
232
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
233
233
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
234
234
|
}
|
|
235
235
|
dataRow.push({ stack: DescData });
|
|
@@ -272,14 +272,14 @@ class SalesReceiptpdfService {
|
|
|
272
272
|
Labor.forEach((Ops) => {
|
|
273
273
|
var dataRow = [];
|
|
274
274
|
columns.forEach((column) => {
|
|
275
|
-
if ((!
|
|
275
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(Ops[column.Field]) && !tr_utils_1.TrUtils.IsNull(Ops[column.Field]))
|
|
276
276
|
|| (column.text === 'Line Total')) {
|
|
277
277
|
if (Ops[column.Field] === 'Labor') {
|
|
278
278
|
dataRow.push({ text: Ops[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
279
279
|
}
|
|
280
280
|
else {
|
|
281
281
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
282
|
-
&&
|
|
282
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(Ops.TCode))) {
|
|
283
283
|
Ops[column.Field] = '';
|
|
284
284
|
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'center' });
|
|
285
285
|
}
|
|
@@ -289,7 +289,7 @@ class SalesReceiptpdfService {
|
|
|
289
289
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
290
290
|
if (column.Field === 'Disc') {
|
|
291
291
|
if (column.type === 'percentage') {
|
|
292
|
-
if (Ops.Perc && !
|
|
292
|
+
if (Ops.Perc && !tr_utils_1.TrUtils.IsZero(Ops[column.Field])) {
|
|
293
293
|
dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
294
294
|
}
|
|
295
295
|
else {
|
|
@@ -297,7 +297,7 @@ class SalesReceiptpdfService {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
else {
|
|
300
|
-
if (!Ops.Perc && !
|
|
300
|
+
if (!Ops.Perc && !tr_utils_1.TrUtils.IsZero(Ops[column.Field])) {
|
|
301
301
|
dataRow.push({ text: Ops[column.Field].toString(), noWrap: true });
|
|
302
302
|
}
|
|
303
303
|
else {
|
|
@@ -306,7 +306,7 @@ class SalesReceiptpdfService {
|
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
else {
|
|
309
|
-
if (!
|
|
309
|
+
if (!tr_utils_1.TrUtils.IsZero(Ops[column.Field])) {
|
|
310
310
|
dataRow.push({ text: Ops[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
311
311
|
}
|
|
312
312
|
else {
|
|
@@ -475,7 +475,7 @@ class SalesReceiptpdfService {
|
|
|
475
475
|
Parts.forEach((part) => {
|
|
476
476
|
var dataRow = [];
|
|
477
477
|
columns.forEach((column) => {
|
|
478
|
-
if (!
|
|
478
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
|
|
479
479
|
|| column.text === 'Line Total') {
|
|
480
480
|
if (part[column.Field] === 'Spare Parts') {
|
|
481
481
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 10, style: 'InlineHeader' });
|
|
@@ -495,7 +495,7 @@ class SalesReceiptpdfService {
|
|
|
495
495
|
if (column.Field === 'Desc') {
|
|
496
496
|
let DescData = [];
|
|
497
497
|
DescData.push(part[column.Field].toString());
|
|
498
|
-
if (!
|
|
498
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
499
499
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
500
500
|
}
|
|
501
501
|
dataRow.push({ stack: DescData });
|
|
@@ -535,7 +535,7 @@ class SalesReceiptpdfService {
|
|
|
535
535
|
Ops.forEach((labor) => {
|
|
536
536
|
var dataRow = [];
|
|
537
537
|
columns.forEach((column) => {
|
|
538
|
-
if (!
|
|
538
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(labor[column.Field]) && !tr_utils_1.TrUtils.IsNull(labor[column.Field])
|
|
539
539
|
|| column.text === 'Line Total') {
|
|
540
540
|
if (labor[column.Field] === 'Labor') {
|
|
541
541
|
dataRow.push({ text: labor[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -593,7 +593,7 @@ class SalesReceiptpdfService {
|
|
|
593
593
|
}
|
|
594
594
|
static CommonTotalDetails(ROPrintData, index, numberofCopies, moreDiscDetails) {
|
|
595
595
|
let CommonDetails = [
|
|
596
|
-
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
596
|
+
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, 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, null, moreDiscDetails),
|
|
597
597
|
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
|
|
598
598
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
599
599
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
@@ -602,7 +602,7 @@ class SalesReceiptpdfService {
|
|
|
602
602
|
if (ROPrintData.Type !== 'Invoice') {
|
|
603
603
|
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
604
604
|
}
|
|
605
|
-
if (!
|
|
605
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
606
606
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
607
607
|
}
|
|
608
608
|
return CommonDetails;
|
|
@@ -3,34 +3,34 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SaleReceiptPrintService = void 0;
|
|
4
4
|
const shared_print_service_1 = require("./shared-print.service");
|
|
5
5
|
const invoice_total_service_1 = require("./invoice-total.service");
|
|
6
|
-
const
|
|
6
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
7
|
const code_enums_1 = require("../enums/code-enums");
|
|
8
8
|
const enums_1 = require("../enums/enums");
|
|
9
|
-
const my_date_1 = require("../
|
|
9
|
+
const my_date_1 = require("../utils/my-date");
|
|
10
10
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
11
11
|
class SaleReceiptPrintService {
|
|
12
12
|
static GetSaleReceiptPrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, OBN) {
|
|
13
13
|
var _a, _b, _c, _d;
|
|
14
|
-
let ForInsurance = !
|
|
14
|
+
let ForInsurance = !tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo) && !tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.InsId);
|
|
15
15
|
let InvoicePrintData = {};
|
|
16
|
-
let argInvoiceData =
|
|
16
|
+
let argInvoiceData = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData);
|
|
17
17
|
if (!IncludeGST) {
|
|
18
18
|
if (argInvoiceData.Settings.Tax === 'TI') {
|
|
19
19
|
argInvoiceData.Settings.Tax = 'NO';
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
InvoicePrintData.IsProforma = IsProforma;
|
|
23
|
-
InvoicePrintData.Settings =
|
|
23
|
+
InvoicePrintData.Settings = tr_utils_1.TrUtils.Stringify(argInvoiceData.Settings);
|
|
24
24
|
let SType;
|
|
25
|
-
if (!
|
|
25
|
+
if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.SType)) {
|
|
26
26
|
SType = argInvoiceData.SType;
|
|
27
27
|
}
|
|
28
28
|
InvoicePrintData = this.GetPrintConditionsBasedOnInput(InvoicePrintData, IncludeGST, ConsolidateGST, ForInsurance, SType, argInvoiceData, IsProforma);
|
|
29
29
|
InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalInvoiceData);
|
|
30
30
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
31
31
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
32
|
-
let IsTaxable = (IncludeGST &&
|
|
33
|
-
if (
|
|
32
|
+
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
33
|
+
if (tr_utils_1.TrUtils.IsNull(argInvoiceData.Ops)) {
|
|
34
34
|
argInvoiceData.Ops = [];
|
|
35
35
|
}
|
|
36
36
|
let finalTotalsData = invoice_total_service_1.InvoiceTotalsService.GetTotalsValue(argInvoiceData.Ops, argInvoiceData.Items, IsTaxable, true, argInvoiceData.LDisc, argInvoiceData.LPerc, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, InvoicePrintData.Entity.Round);
|
|
@@ -38,7 +38,7 @@ class SaleReceiptPrintService {
|
|
|
38
38
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
39
39
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
40
40
|
}
|
|
41
|
-
InvoicePrintData =
|
|
41
|
+
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
42
42
|
InvoicePrintData.Ops = this.GetLaborPrintInfo(InvoicePrintData.Ops, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
43
43
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, OBN, (_d = (_c = OriginalEntityData.Entity.Settings) === null || _c === void 0 ? void 0 : _c.Acc) === null || _d === void 0 ? void 0 : _d.LTot);
|
|
44
44
|
// InvoicePrintData.Items = InvoicePrintData.Items.filter((item: any) => {
|
|
@@ -52,9 +52,9 @@ class SaleReceiptPrintService {
|
|
|
52
52
|
// if (argInvoiceData.Settings.DiscLvl !== 'REC') {
|
|
53
53
|
// InvoicePrintData.FixedDisc = null;
|
|
54
54
|
// }
|
|
55
|
-
InvoicePrintData.Due =
|
|
55
|
+
InvoicePrintData.Due = tr_utils_1.TrUtils.FixPriceValue(argInvoiceData.Due);
|
|
56
56
|
InvoicePrintData.Paid = argInvoiceData.Receipt ? argInvoiceData.Total : PaymentData.Paid;
|
|
57
|
-
if (!
|
|
57
|
+
if (!tr_utils_1.TrUtils.IsNull(PaymentData.Sts)) {
|
|
58
58
|
InvoicePrintData.Sts = PaymentData.Sts;
|
|
59
59
|
}
|
|
60
60
|
InvoicePrintData.Consolidate = ConsolidateGST;
|
|
@@ -76,11 +76,11 @@ class SaleReceiptPrintService {
|
|
|
76
76
|
InvoicePrintData.IncludeGST = IncludeGST;
|
|
77
77
|
InvoicePrintData.ConsolidateGST = ConsolidateGST;
|
|
78
78
|
InvoicePrintData.ShowAccParts = false;
|
|
79
|
-
InvoicePrintData.ShowIGST = (
|
|
79
|
+
InvoicePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
80
80
|
InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
81
81
|
// InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
82
82
|
InvoicePrintData = this.GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma);
|
|
83
|
-
InvoicePrintData.PrDate =
|
|
83
|
+
InvoicePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
|
|
84
84
|
return InvoicePrintData;
|
|
85
85
|
}
|
|
86
86
|
static GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma) {
|
|
@@ -150,22 +150,22 @@ class SaleReceiptPrintService {
|
|
|
150
150
|
LaborList.forEach((Labor) => {
|
|
151
151
|
Labor.HSN = Labor.SAC;
|
|
152
152
|
if (Consolidate) {
|
|
153
|
-
Labor.UnPr =
|
|
153
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.AfterLaborTax);
|
|
154
154
|
}
|
|
155
155
|
else {
|
|
156
|
-
Labor.UnPr =
|
|
156
|
+
Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
|
|
157
157
|
}
|
|
158
|
-
Labor.CGSTAmt =
|
|
159
|
-
Labor.SGSTAmt =
|
|
160
|
-
Labor.IGSTAmt =
|
|
158
|
+
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST);
|
|
159
|
+
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST);
|
|
160
|
+
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST);
|
|
161
161
|
Labor.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
162
162
|
Labor.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
163
163
|
Labor.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Labor.TCode, TaxCodes);
|
|
164
164
|
if (LineTotal === 'AT') {
|
|
165
|
-
Labor.LineTotal =
|
|
165
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax);
|
|
166
166
|
}
|
|
167
167
|
else {
|
|
168
|
-
Labor.LineTotal =
|
|
168
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Labor.Amt, Labor.Disc));
|
|
169
169
|
}
|
|
170
170
|
});
|
|
171
171
|
return LaborList;
|
|
@@ -178,34 +178,34 @@ class SaleReceiptPrintService {
|
|
|
178
178
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
179
179
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
180
180
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
181
|
-
Item.UnPr =
|
|
181
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo(AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem);
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
|
-
Item.UnPr =
|
|
184
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
185
185
|
}
|
|
186
186
|
Item.ExDt = this.GetExpiryDate(Item);
|
|
187
187
|
Item.Batch = this.GetBatchesData(Item, OBN);
|
|
188
|
-
Item.CGSTAmt =
|
|
189
|
-
if (
|
|
188
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.CGST);
|
|
189
|
+
if (tr_utils_1.TrUtils.IsNull(Item.ConUt)) {
|
|
190
190
|
Item.ConUt = 1;
|
|
191
191
|
}
|
|
192
|
-
if (!
|
|
192
|
+
if (!tr_utils_1.TrUtils.IsNull(Item.Make)) {
|
|
193
193
|
Item.Make = (_a = Item.Make) === null || _a === void 0 ? void 0 : _a.slice(0, 4).toUpperCase();
|
|
194
194
|
}
|
|
195
|
-
Item.Qty =
|
|
196
|
-
Item.SGSTAmt =
|
|
197
|
-
Item.IGSTAmt =
|
|
195
|
+
Item.Qty = tr_utils_1.TrUtils.FixedTo(Item.Qty * Item.ConUt);
|
|
196
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.SGST);
|
|
197
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(Item.IGST);
|
|
198
198
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
199
199
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
200
200
|
Item.TaxName = this.getTaxName(Item.TCode, TaxCodes);
|
|
201
201
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
202
202
|
if (LineTotal === 'AT') {
|
|
203
|
-
Item.LineTotal =
|
|
203
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
|
-
Item.LineTotal =
|
|
206
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
207
207
|
}
|
|
208
|
-
if (!
|
|
208
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
209
209
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
210
210
|
}
|
|
211
211
|
});
|
|
@@ -218,12 +218,12 @@ class SaleReceiptPrintService {
|
|
|
218
218
|
return (Index !== -1) ? TaxCodes[Index].Name : '';
|
|
219
219
|
}
|
|
220
220
|
static GetBatchesData(Item, OBN) {
|
|
221
|
-
if (!
|
|
221
|
+
if (!tr_utils_1.TrUtils.IsNull(Item.Batches)) {
|
|
222
222
|
let batchdata;
|
|
223
223
|
Item.Batches.forEach((batch) => {
|
|
224
224
|
if (OBN) {
|
|
225
|
-
let BN =
|
|
226
|
-
if (!
|
|
225
|
+
let BN = tr_utils_1.TrUtils.IsNull(batch.MBN) ? batch.BN : batch.MBN;
|
|
226
|
+
if (!tr_utils_1.TrUtils.IsNull(batchdata)) {
|
|
227
227
|
batchdata = batchdata + ',' + BN;
|
|
228
228
|
}
|
|
229
229
|
else {
|
|
@@ -231,7 +231,7 @@ class SaleReceiptPrintService {
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
|
-
if (!
|
|
234
|
+
if (!tr_utils_1.TrUtils.IsNull(batchdata)) {
|
|
235
235
|
batchdata = batchdata + ',' + batch.BN;
|
|
236
236
|
}
|
|
237
237
|
else {
|
|
@@ -241,9 +241,9 @@ class SaleReceiptPrintService {
|
|
|
241
241
|
});
|
|
242
242
|
return batchdata;
|
|
243
243
|
}
|
|
244
|
-
else if (!
|
|
244
|
+
else if (!tr_utils_1.TrUtils.IsNull(Item.Batch)) {
|
|
245
245
|
if (OBN) {
|
|
246
|
-
let BN =
|
|
246
|
+
let BN = tr_utils_1.TrUtils.IsNull(Item.Batch.MBN) ? Item.Batch.BN : Item.Batch.MBN;
|
|
247
247
|
return BN;
|
|
248
248
|
}
|
|
249
249
|
else {
|
|
@@ -255,10 +255,10 @@ class SaleReceiptPrintService {
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
static GetExpiryDate(Item) {
|
|
258
|
-
if (!
|
|
258
|
+
if (!tr_utils_1.TrUtils.IsNull(Item.Batches)) {
|
|
259
259
|
let batchdata;
|
|
260
260
|
Item.Batches.forEach((batch) => {
|
|
261
|
-
if (!
|
|
261
|
+
if (!tr_utils_1.TrUtils.IsNull(batchdata)) {
|
|
262
262
|
batchdata = batchdata + ',' + my_date_1.MyDate.ConvertUTCDateToReadableExDate(batch.ExDt);
|
|
263
263
|
}
|
|
264
264
|
else {
|
|
@@ -267,7 +267,7 @@ class SaleReceiptPrintService {
|
|
|
267
267
|
});
|
|
268
268
|
return batchdata;
|
|
269
269
|
}
|
|
270
|
-
else if (!
|
|
270
|
+
else if (!tr_utils_1.TrUtils.IsNull(Item.Batch)) {
|
|
271
271
|
return my_date_1.MyDate.ConvertUTCDateToReadableExDate(Item.Batch.ExDt);
|
|
272
272
|
}
|
|
273
273
|
else {
|
|
@@ -290,15 +290,15 @@ class SaleReceiptPrintService {
|
|
|
290
290
|
return PrintInfo;
|
|
291
291
|
}
|
|
292
292
|
static GetFormattedProductDataForPrint(OriginalInvoiceData, InvoicePrintData) {
|
|
293
|
-
if (!
|
|
293
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Prod)) {
|
|
294
294
|
InvoicePrintData.Product = OriginalInvoiceData.Prod;
|
|
295
|
-
if (
|
|
295
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.VIN)) {
|
|
296
296
|
InvoicePrintData.Product.VIN = '';
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
298
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.RegNo)) {
|
|
299
299
|
InvoicePrintData.Product.RegNo = '';
|
|
300
300
|
}
|
|
301
|
-
if (
|
|
301
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.EngNo)) {
|
|
302
302
|
InvoicePrintData.Product.EngNo = '';
|
|
303
303
|
}
|
|
304
304
|
InvoicePrintData.MIn = OriginalInvoiceData.Prod.MIn;
|
|
@@ -308,22 +308,22 @@ class SaleReceiptPrintService {
|
|
|
308
308
|
}
|
|
309
309
|
static GetBillNameForInvoicePrint(OriginalInvoiceData, InvoicePrintData) {
|
|
310
310
|
let Customer = {};
|
|
311
|
-
if (!
|
|
311
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo)) {
|
|
312
312
|
Customer.Name = OriginalInvoiceData.BillTo.Name;
|
|
313
|
-
Customer.Doctor =
|
|
313
|
+
Customer.Doctor = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Name) ? '' : OriginalInvoiceData.Name;
|
|
314
314
|
Customer.Adrs = [];
|
|
315
315
|
Customer.Cons = [];
|
|
316
|
-
if (!
|
|
316
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.Adrs)) {
|
|
317
317
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A1);
|
|
318
|
-
if (!
|
|
318
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.A2)) {
|
|
319
319
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A2);
|
|
320
320
|
}
|
|
321
|
-
if (!
|
|
321
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.Ct)) {
|
|
322
322
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.Ct);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
325
325
|
Customer.GSTIN = OriginalInvoiceData.BillTo.GSTIN;
|
|
326
|
-
if (!
|
|
326
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Ph)) {
|
|
327
327
|
Customer.Cons = [
|
|
328
328
|
{
|
|
329
329
|
Type: 'M',
|
|
@@ -333,7 +333,7 @@ class SaleReceiptPrintService {
|
|
|
333
333
|
}
|
|
334
334
|
InvoicePrintData.Customer = Customer;
|
|
335
335
|
}
|
|
336
|
-
else if (!
|
|
336
|
+
else if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo)) {
|
|
337
337
|
Customer.Name = OriginalInvoiceData.BillTo.Name;
|
|
338
338
|
Customer.Adrs = [];
|
|
339
339
|
Customer.Cons = [];
|
|
@@ -342,21 +342,21 @@ class SaleReceiptPrintService {
|
|
|
342
342
|
else {
|
|
343
343
|
InvoicePrintData.Customer = {};
|
|
344
344
|
}
|
|
345
|
-
if (!
|
|
345
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo)) {
|
|
346
346
|
let location = {};
|
|
347
347
|
location.Adrs = shared_print_service_1.PrintSharedService.GetAddress(OriginalInvoiceData.ShipTo.Adrs);
|
|
348
348
|
let Name;
|
|
349
|
-
if (
|
|
349
|
+
if (tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.Name)) {
|
|
350
350
|
Name = OriginalInvoiceData.ShipTo.ConName;
|
|
351
351
|
}
|
|
352
352
|
else {
|
|
353
353
|
Name = OriginalInvoiceData.ShipTo.Name;
|
|
354
354
|
}
|
|
355
|
-
if (
|
|
355
|
+
if (tr_utils_1.TrUtils.IsNull(Name)) {
|
|
356
356
|
Name = '';
|
|
357
357
|
}
|
|
358
358
|
location.Name = Name;
|
|
359
|
-
if (!
|
|
359
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.ConPh)) {
|
|
360
360
|
location.Cons = [
|
|
361
361
|
{
|
|
362
362
|
Type: 'M',
|
|
@@ -372,7 +372,7 @@ class SaleReceiptPrintService {
|
|
|
372
372
|
let Customer = {};
|
|
373
373
|
Customer.Name = this.GetBillToName(OriginalInvoiceData.BillTo.Title, OriginalInvoiceData.BillTo.Name);
|
|
374
374
|
Customer.Cons = [];
|
|
375
|
-
if (!
|
|
375
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Ph)) {
|
|
376
376
|
Customer.Cons = [
|
|
377
377
|
{
|
|
378
378
|
Type: 'M',
|
|
@@ -382,9 +382,9 @@ class SaleReceiptPrintService {
|
|
|
382
382
|
}
|
|
383
383
|
Customer.GSTIN = OriginalInvoiceData.BillTo.GSTIN;
|
|
384
384
|
Customer.Adrs = [];
|
|
385
|
-
if (!
|
|
385
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.Adrs)) {
|
|
386
386
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A1);
|
|
387
|
-
if (!
|
|
387
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.A2)) {
|
|
388
388
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A2);
|
|
389
389
|
}
|
|
390
390
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.Ct);
|
|
@@ -394,10 +394,10 @@ class SaleReceiptPrintService {
|
|
|
394
394
|
return Customer;
|
|
395
395
|
}
|
|
396
396
|
static GetBillToName(Title, Name) {
|
|
397
|
-
return
|
|
397
|
+
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
398
398
|
}
|
|
399
399
|
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
400
|
-
if (
|
|
400
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePayments)) {
|
|
401
401
|
InvoicePayments = [];
|
|
402
402
|
}
|
|
403
403
|
var i = 0;
|
|
@@ -410,7 +410,7 @@ class SaleReceiptPrintService {
|
|
|
410
410
|
Data.Due = 0;
|
|
411
411
|
}
|
|
412
412
|
else {
|
|
413
|
-
Data.Due =
|
|
413
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
414
414
|
}
|
|
415
415
|
if (Data.Due < 0) {
|
|
416
416
|
Data.Due = 0;
|
|
@@ -418,7 +418,7 @@ class SaleReceiptPrintService {
|
|
|
418
418
|
if (Data.Due === 0) {
|
|
419
419
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
420
420
|
}
|
|
421
|
-
Data.Paid =
|
|
421
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
422
422
|
return Data;
|
|
423
423
|
}
|
|
424
424
|
}
|