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.DCLandscapeWithoutPricePdfService = 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 DCLandscapeWithoutPricePdfService {
|
|
@@ -11,7 +11,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
11
11
|
}
|
|
12
12
|
static GetDeliveryChallanPrint(ROPrintData, numberofCopies) {
|
|
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), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies));
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
@@ -42,7 +42,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
42
42
|
}
|
|
43
43
|
static GetFileName(ROPrintData) {
|
|
44
44
|
let fileName = ROPrintData.HeaderName;
|
|
45
|
-
if (!
|
|
45
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
46
46
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
47
47
|
}
|
|
48
48
|
return fileName;
|
|
@@ -52,14 +52,14 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
52
52
|
}
|
|
53
53
|
static GetHeaderInfo(InvoicePDFData) {
|
|
54
54
|
let TaxInfo = [];
|
|
55
|
-
if (!
|
|
55
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
|
|
56
56
|
TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 7, width: 'auto' });
|
|
57
57
|
}
|
|
58
58
|
// if (!TrUtils.IsEmpty(InvoicePDFData.Entity.PAN)) {
|
|
59
59
|
// TaxInfo.push({ text: 'PAN : ' + InvoicePDFData.Entity.PAN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
|
|
60
60
|
// );
|
|
61
61
|
// }
|
|
62
|
-
if (!
|
|
62
|
+
if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
|
|
63
63
|
TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 7, width: '*' });
|
|
64
64
|
}
|
|
65
65
|
TaxInfo.push(this.GetBillofSupplyName(InvoicePDFData.Settings));
|
|
@@ -133,19 +133,19 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
133
133
|
]
|
|
134
134
|
}
|
|
135
135
|
];
|
|
136
|
-
if (!
|
|
136
|
+
if (!tr_utils_1.TrUtils.IsNull(Image)) {
|
|
137
137
|
// Details.unshift({ text: '', width: 120 });
|
|
138
138
|
if (Entity.CName.length < 28) {
|
|
139
139
|
Details[0].stack[0].columns.push({ text: '', width: 140 });
|
|
140
140
|
}
|
|
141
|
-
if (!
|
|
141
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
142
142
|
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
143
143
|
}
|
|
144
144
|
Details.unshift({ image: Image, width: 120, height: 80 });
|
|
145
145
|
}
|
|
146
146
|
else {
|
|
147
147
|
Details[0].stack[1].columns.unshift({ text: '', width: 130 });
|
|
148
|
-
if (!
|
|
148
|
+
if (!tr_utils_1.TrUtils.IsNull(text)) {
|
|
149
149
|
Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 10 });
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -163,7 +163,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
163
163
|
let List = [];
|
|
164
164
|
if (ROPrintData.Entity.Body === 1) {
|
|
165
165
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
166
|
-
if (
|
|
166
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
167
167
|
ROPrintData.PrintInfo[i].Text = '';
|
|
168
168
|
}
|
|
169
169
|
// List.push(ROPrintData.PrintInfo[i].Text,
|
|
@@ -174,10 +174,10 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
174
174
|
else {
|
|
175
175
|
if (ROPrintData.Entity.Body === 2) {
|
|
176
176
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
177
|
-
if (
|
|
177
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
178
178
|
ROPrintData.PrintInfo[i].Text = '';
|
|
179
179
|
}
|
|
180
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
180
|
+
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));
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
@@ -188,10 +188,10 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
188
188
|
}
|
|
189
189
|
else {
|
|
190
190
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
191
|
-
if (
|
|
191
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
192
192
|
ROPrintData.PrintInfo[i].Text = '';
|
|
193
193
|
}
|
|
194
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
194
|
+
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));
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -430,14 +430,14 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
430
430
|
Parts.forEach((part) => {
|
|
431
431
|
var dataRow = [];
|
|
432
432
|
columns.forEach((column) => {
|
|
433
|
-
if ((!
|
|
433
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
434
434
|
|| (column.text === 'Line Total' || column.text === 'Expiry')) {
|
|
435
435
|
if (part[column.Field] === 'Spare Parts') {
|
|
436
436
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
437
437
|
}
|
|
438
438
|
else {
|
|
439
439
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
440
|
-
&&
|
|
440
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
441
441
|
part[column.Field] = '';
|
|
442
442
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
443
443
|
}
|
|
@@ -447,7 +447,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
447
447
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
448
448
|
if (column.Field === 'Disc') {
|
|
449
449
|
if (column.type === 'percentage') {
|
|
450
|
-
if (!
|
|
450
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
451
451
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
452
452
|
}
|
|
453
453
|
else {
|
|
@@ -455,7 +455,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
457
|
else {
|
|
458
|
-
if (!
|
|
458
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
459
459
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
460
460
|
}
|
|
461
461
|
else {
|
|
@@ -465,7 +465,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
465
465
|
}
|
|
466
466
|
else {
|
|
467
467
|
if (column.Field === 'Batch') {
|
|
468
|
-
if (!
|
|
468
|
+
if (!tr_utils_1.TrUtils.IsNull(part[column.Field])) {
|
|
469
469
|
dataRow.push({ text: part[column.Field].BN, nowrap: true });
|
|
470
470
|
}
|
|
471
471
|
else {
|
|
@@ -473,7 +473,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
475
|
else if (column.Field === 'ExDate') {
|
|
476
|
-
if (!
|
|
476
|
+
if (!tr_utils_1.TrUtils.IsNull(part['Batch'])) {
|
|
477
477
|
dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(part['Batch'].ExDt), nowrap: true });
|
|
478
478
|
}
|
|
479
479
|
else {
|
|
@@ -481,7 +481,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
481
481
|
}
|
|
482
482
|
}
|
|
483
483
|
else {
|
|
484
|
-
if (!
|
|
484
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
485
485
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
486
486
|
}
|
|
487
487
|
else {
|
|
@@ -495,7 +495,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
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 });
|
|
@@ -508,7 +508,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
508
508
|
}
|
|
509
509
|
}
|
|
510
510
|
else {
|
|
511
|
-
if (column.Field === 'SNo' && !
|
|
511
|
+
if (column.Field === 'SNo' && !tr_utils_1.TrUtils.IsNull(part.Desc)) {
|
|
512
512
|
part[column.Field] = SNo;
|
|
513
513
|
SNo = SNo + 1;
|
|
514
514
|
}
|
|
@@ -816,7 +816,7 @@ class DCLandscapeWithoutPricePdfService {
|
|
|
816
816
|
// if (ROPrintData.Type !== 'Invoice') {
|
|
817
817
|
// CommonDetails.splice(2, 0, SharedPDFService.GetUnderLine());
|
|
818
818
|
// }
|
|
819
|
-
if (!
|
|
819
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
820
820
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
821
821
|
}
|
|
822
822
|
return CommonDetails;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DCWithoutPricePdfService = 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 DCWithoutPricePdfService {
|
|
@@ -10,7 +10,7 @@ class DCWithoutPricePdfService {
|
|
|
10
10
|
}
|
|
11
11
|
static GetDeliveryChallanPrint(ROPrintData, numberofCopies) {
|
|
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), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies));
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
@@ -36,7 +36,7 @@ class DCWithoutPricePdfService {
|
|
|
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,7 +62,7 @@ class DCWithoutPricePdfService {
|
|
|
62
62
|
let List = [];
|
|
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
68
|
// List.push(ROPrintData.PrintInfo[i].Text,
|
|
@@ -73,10 +73,10 @@ class DCWithoutPricePdfService {
|
|
|
73
73
|
else {
|
|
74
74
|
if (ROPrintData.Entity.Body === 2) {
|
|
75
75
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
76
|
-
if (
|
|
76
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
77
77
|
ROPrintData.PrintInfo[i].Text = '';
|
|
78
78
|
}
|
|
79
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
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
80
|
}
|
|
81
81
|
}
|
|
82
82
|
else {
|
|
@@ -87,10 +87,10 @@ class DCWithoutPricePdfService {
|
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
90
|
-
if (
|
|
90
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
91
91
|
ROPrintData.PrintInfo[i].Text = '';
|
|
92
92
|
}
|
|
93
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
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
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -195,14 +195,14 @@ class DCWithoutPricePdfService {
|
|
|
195
195
|
Parts.forEach((part) => {
|
|
196
196
|
var dataRow = [];
|
|
197
197
|
columns.forEach((column) => {
|
|
198
|
-
if ((!
|
|
198
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
199
199
|
|| (column.text === 'Line Total')) {
|
|
200
200
|
if (part[column.Field] === 'Spare Parts') {
|
|
201
201
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader', alignment: 'left' });
|
|
202
202
|
}
|
|
203
203
|
else {
|
|
204
204
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
205
|
-
&&
|
|
205
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
206
206
|
part[column.Field] = '';
|
|
207
207
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
208
208
|
}
|
|
@@ -212,7 +212,7 @@ class DCWithoutPricePdfService {
|
|
|
212
212
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
213
213
|
if (column.Field === 'Disc') {
|
|
214
214
|
if (column.type === 'percentage') {
|
|
215
|
-
if (!
|
|
215
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
216
216
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
217
217
|
}
|
|
218
218
|
else {
|
|
@@ -220,7 +220,7 @@ class DCWithoutPricePdfService {
|
|
|
220
220
|
}
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
223
|
-
if (!
|
|
223
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
224
224
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
225
225
|
}
|
|
226
226
|
else {
|
|
@@ -229,7 +229,7 @@ class DCWithoutPricePdfService {
|
|
|
229
229
|
}
|
|
230
230
|
}
|
|
231
231
|
else {
|
|
232
|
-
if (!
|
|
232
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
233
233
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center', nowrap: true });
|
|
234
234
|
}
|
|
235
235
|
else {
|
|
@@ -242,7 +242,7 @@ class DCWithoutPricePdfService {
|
|
|
242
242
|
if (column.Field === 'Desc') {
|
|
243
243
|
let DescData = [];
|
|
244
244
|
DescData.push(part[column.Field].toString());
|
|
245
|
-
if (!
|
|
245
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
246
246
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
247
247
|
}
|
|
248
248
|
dataRow.push({ stack: DescData });
|
|
@@ -480,7 +480,7 @@ class DCWithoutPricePdfService {
|
|
|
480
480
|
if (ROPrintData.Type !== 'Invoice') {
|
|
481
481
|
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
482
482
|
}
|
|
483
|
-
if (!
|
|
483
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
484
484
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
485
485
|
}
|
|
486
486
|
return CommonDetails;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DebitNotePdfService = 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 DebitNotePdfService {
|
|
@@ -31,7 +31,7 @@ class DebitNotePdfService {
|
|
|
31
31
|
}
|
|
32
32
|
static GetFileName(ROPrintData) {
|
|
33
33
|
let fileName = ROPrintData.HeaderName;
|
|
34
|
-
if (!
|
|
34
|
+
if (!tr_utils_1.TrUtils.IsNull(ROPrintData.Product) && !tr_utils_1.TrUtils.IsEmpty(ROPrintData.Product.RegNo)) {
|
|
35
35
|
fileName = fileName + '-' + ROPrintData.Product.RegNo;
|
|
36
36
|
}
|
|
37
37
|
return fileName;
|
|
@@ -56,7 +56,7 @@ class DebitNotePdfService {
|
|
|
56
56
|
let List = [];
|
|
57
57
|
if (ROPrintData.Entity.Body === 1) {
|
|
58
58
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
59
|
-
if (
|
|
59
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
60
60
|
ROPrintData.PrintInfo[i].Text = '';
|
|
61
61
|
}
|
|
62
62
|
;
|
|
@@ -65,10 +65,10 @@ class DebitNotePdfService {
|
|
|
65
65
|
else {
|
|
66
66
|
if (ROPrintData.Entity.Body === 2) {
|
|
67
67
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
68
|
-
if (
|
|
68
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
69
69
|
ROPrintData.PrintInfo[i].Text = '';
|
|
70
70
|
}
|
|
71
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(
|
|
71
|
+
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));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
else {
|
|
@@ -79,10 +79,10 @@ class DebitNotePdfService {
|
|
|
79
79
|
}
|
|
80
80
|
else {
|
|
81
81
|
for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
|
|
82
|
-
if (
|
|
82
|
+
if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
|
|
83
83
|
ROPrintData.PrintInfo[i].Text = '';
|
|
84
84
|
}
|
|
85
|
-
List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(
|
|
85
|
+
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));
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -154,14 +154,14 @@ class DebitNotePdfService {
|
|
|
154
154
|
Parts.forEach((part) => {
|
|
155
155
|
var dataRow = [];
|
|
156
156
|
columns.forEach((column) => {
|
|
157
|
-
if ((!
|
|
157
|
+
if ((!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field]))
|
|
158
158
|
|| (column.text === 'Line Total')) {
|
|
159
159
|
if (part[column.Field] === 'Spare Parts') {
|
|
160
160
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
161
161
|
}
|
|
162
162
|
else {
|
|
163
163
|
if (((column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt' || column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc')
|
|
164
|
-
&&
|
|
164
|
+
&& tr_utils_1.TrUtils.CheckInvalidSelect(part.TCode))) {
|
|
165
165
|
part[column.Field] = '';
|
|
166
166
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
|
|
167
167
|
}
|
|
@@ -171,7 +171,7 @@ class DebitNotePdfService {
|
|
|
171
171
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc' || column.text === 'Line Total') {
|
|
172
172
|
if (column.Field === 'Disc') {
|
|
173
173
|
if (column.type === 'percentage') {
|
|
174
|
-
if (!
|
|
174
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part[column.Field])) {
|
|
175
175
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
@@ -179,7 +179,7 @@ class DebitNotePdfService {
|
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
else {
|
|
182
|
-
if (!
|
|
182
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
183
183
|
dataRow.push({ text: part[column.Field].toString(), noWrap: true });
|
|
184
184
|
}
|
|
185
185
|
else {
|
|
@@ -188,7 +188,7 @@ class DebitNotePdfService {
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
else {
|
|
191
|
-
if (!
|
|
191
|
+
if (!tr_utils_1.TrUtils.IsZero(part[column.Field])) {
|
|
192
192
|
dataRow.push({ text: part[column.Field].toString(), alignment: 'right', nowrap: true });
|
|
193
193
|
}
|
|
194
194
|
else {
|
|
@@ -555,7 +555,7 @@ class DebitNotePdfService {
|
|
|
555
555
|
Parts.forEach((part) => {
|
|
556
556
|
var dataRow = [];
|
|
557
557
|
columns.forEach((column) => {
|
|
558
|
-
if (!
|
|
558
|
+
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
|
|
559
559
|
|| column.text === 'Line Total') {
|
|
560
560
|
if (part[column.Field] === 'Spare Parts') {
|
|
561
561
|
dataRow.push({ text: part[column.Field].toString(), marginLeft: 50, style: 'InlineHeader' });
|
|
@@ -658,7 +658,7 @@ class DebitNotePdfService {
|
|
|
658
658
|
}
|
|
659
659
|
static CommonTotalDetails(ROPrintData, moreDiscDetails) {
|
|
660
660
|
let CommonDetails = [
|
|
661
|
-
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(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,
|
|
661
|
+
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(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, moreDiscDetails),
|
|
662
662
|
shared_pdf_service_1.SharedPDFService.DebitDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts),
|
|
663
663
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
664
664
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
@@ -4,47 +4,47 @@ exports.DebitNotePrintService = void 0;
|
|
|
4
4
|
const shared_print_service_1 = require("./shared-print.service");
|
|
5
5
|
const debit_note_totals_service_1 = require("./debit-note-totals.service");
|
|
6
6
|
const code_enums_1 = require("../enums/code-enums");
|
|
7
|
-
const
|
|
7
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
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 DebitNotePrintService {
|
|
12
12
|
static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, IsCustBillTo) {
|
|
13
13
|
var _a, _b;
|
|
14
14
|
let InvoicePrintData = {};
|
|
15
|
-
let argInvoiceData =
|
|
15
|
+
let argInvoiceData = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData);
|
|
16
16
|
if (!IncludeGST) {
|
|
17
17
|
argInvoiceData.Settings.Tax = 'NO';
|
|
18
18
|
}
|
|
19
19
|
InvoicePrintData.IsProforma = IsProforma;
|
|
20
|
-
InvoicePrintData.Settings =
|
|
20
|
+
InvoicePrintData.Settings = tr_utils_1.TrUtils.Stringify(argInvoiceData.Settings);
|
|
21
21
|
let SType;
|
|
22
|
-
if (!
|
|
22
|
+
if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.SType)) {
|
|
23
23
|
SType = argInvoiceData.SType;
|
|
24
24
|
}
|
|
25
25
|
InvoicePrintData = this.GetPrintConditionsBasedOnInput(InvoicePrintData, IncludeGST, ConsolidateGST, SType, argInvoiceData, IsProforma, IsCustBillTo);
|
|
26
26
|
InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Invoice", OriginalInvoiceData);
|
|
27
27
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
28
28
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData, IsCustBillTo);
|
|
29
|
-
let IsTaxable = (IncludeGST &&
|
|
29
|
+
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
30
30
|
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
31
31
|
if (ConsolidateGST) {
|
|
32
32
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
33
33
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
34
34
|
}
|
|
35
|
-
InvoicePrintData =
|
|
35
|
+
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
36
36
|
InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
|
|
37
37
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
38
38
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
39
39
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
40
40
|
InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData, IsCustBillTo);
|
|
41
|
-
if (
|
|
41
|
+
if (tr_utils_1.TrUtils.IsNull(argInvoiceData.Payments)) {
|
|
42
42
|
argInvoiceData.Payments = [];
|
|
43
43
|
}
|
|
44
44
|
let PaymentData = this.GetPaymentsTotal(argInvoiceData.Payments, InvoicePrintData.Total, argInvoiceData.Sts);
|
|
45
45
|
InvoicePrintData.Due = PaymentData.Due;
|
|
46
46
|
InvoicePrintData.Paid = PaymentData.Paid;
|
|
47
|
-
if (!
|
|
47
|
+
if (!tr_utils_1.TrUtils.IsNull(PaymentData.Sts)) {
|
|
48
48
|
InvoicePrintData.Sts = PaymentData.Sts;
|
|
49
49
|
}
|
|
50
50
|
InvoicePrintData.Consolidate = ConsolidateGST;
|
|
@@ -58,11 +58,11 @@ class DebitNotePrintService {
|
|
|
58
58
|
InvoicePrintData.IncludeGST = IncludeGST;
|
|
59
59
|
InvoicePrintData.ConsolidateGST = ConsolidateGST;
|
|
60
60
|
InvoicePrintData.ShowAccParts = false;
|
|
61
|
-
InvoicePrintData.ShowIGST = (
|
|
61
|
+
InvoicePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
62
62
|
InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
63
63
|
// InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
64
64
|
InvoicePrintData = this.GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma, IsBillTo);
|
|
65
|
-
InvoicePrintData.PrDate =
|
|
65
|
+
InvoicePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
|
|
66
66
|
return InvoicePrintData;
|
|
67
67
|
}
|
|
68
68
|
static GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma, IsBillTo) {
|
|
@@ -99,24 +99,24 @@ class DebitNotePrintService {
|
|
|
99
99
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
100
100
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
101
101
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
102
|
-
Item.UnPr =
|
|
102
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
103
103
|
}
|
|
104
104
|
else {
|
|
105
|
-
Item.UnPr =
|
|
105
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
106
106
|
}
|
|
107
|
-
Item.CGSTAmt =
|
|
108
|
-
Item.SGSTAmt =
|
|
109
|
-
Item.IGSTAmt =
|
|
107
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
108
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
109
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
110
110
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
111
111
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
112
112
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
113
113
|
if (LineTotal === 'AT') {
|
|
114
|
-
Item.LineTotal =
|
|
114
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
117
|
-
Item.LineTotal =
|
|
117
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
118
118
|
}
|
|
119
|
-
if (!
|
|
119
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
120
120
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
121
121
|
}
|
|
122
122
|
});
|
|
@@ -136,15 +136,15 @@ class DebitNotePrintService {
|
|
|
136
136
|
return PrintInfo;
|
|
137
137
|
}
|
|
138
138
|
static GetFormattedProductDataForPrint(OriginalInvoiceData, InvoicePrintData) {
|
|
139
|
-
if (!
|
|
139
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Prod)) {
|
|
140
140
|
InvoicePrintData.Product = OriginalInvoiceData.Prod;
|
|
141
|
-
if (
|
|
141
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.VIN)) {
|
|
142
142
|
InvoicePrintData.Product.VIN = '';
|
|
143
143
|
}
|
|
144
|
-
if (
|
|
144
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.RegNo)) {
|
|
145
145
|
InvoicePrintData.Product.RegNo = '';
|
|
146
146
|
}
|
|
147
|
-
if (
|
|
147
|
+
if (tr_utils_1.TrUtils.IsNull(InvoicePrintData.Product.EngNo)) {
|
|
148
148
|
InvoicePrintData.Product.EngNo = '';
|
|
149
149
|
}
|
|
150
150
|
InvoicePrintData.MIn = OriginalInvoiceData.Prod.MIn;
|
|
@@ -158,17 +158,17 @@ class DebitNotePrintService {
|
|
|
158
158
|
Customer.Name = OriginalInvoiceData.BillTo.Name;
|
|
159
159
|
Customer.Adrs = [];
|
|
160
160
|
Customer.Cons = [];
|
|
161
|
-
if (!
|
|
161
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo.Adrs)) {
|
|
162
162
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A1);
|
|
163
|
-
if (!
|
|
163
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.A2)) {
|
|
164
164
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.A2);
|
|
165
165
|
}
|
|
166
|
-
if (!
|
|
166
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Adrs.Ct)) {
|
|
167
167
|
Customer.Adrs.push(OriginalInvoiceData.BillTo.Adrs.Ct);
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
Customer.GSTIN = OriginalInvoiceData.BillTo.GSTIN;
|
|
171
|
-
if (!
|
|
171
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.BillTo.Ph)) {
|
|
172
172
|
Customer.Cons = [
|
|
173
173
|
{
|
|
174
174
|
Type: 'M',
|
|
@@ -187,7 +187,7 @@ class DebitNotePrintService {
|
|
|
187
187
|
let Customer = {};
|
|
188
188
|
Customer.Name = this.GetBillToName(OriginalInvoiceData.Cust.Title, OriginalInvoiceData.Cust.Name);
|
|
189
189
|
Customer.Cons = [];
|
|
190
|
-
if (!
|
|
190
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Ph)) {
|
|
191
191
|
Customer.Cons = [
|
|
192
192
|
{
|
|
193
193
|
Type: 'M',
|
|
@@ -197,9 +197,9 @@ class DebitNotePrintService {
|
|
|
197
197
|
}
|
|
198
198
|
Customer.GSTIN = OriginalInvoiceData.Cust.GSTIN;
|
|
199
199
|
Customer.Adrs = [];
|
|
200
|
-
if (!
|
|
200
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Cust.Adrs)) {
|
|
201
201
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A1);
|
|
202
|
-
if (!
|
|
202
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.Cust.Adrs.A2)) {
|
|
203
203
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.A2);
|
|
204
204
|
}
|
|
205
205
|
Customer.Adrs.push(OriginalInvoiceData.Cust.Adrs.Ct);
|
|
@@ -209,7 +209,7 @@ class DebitNotePrintService {
|
|
|
209
209
|
return Customer;
|
|
210
210
|
}
|
|
211
211
|
static GetBillToName(Title, Name) {
|
|
212
|
-
return
|
|
212
|
+
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
213
213
|
}
|
|
214
214
|
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
215
215
|
var i = 0;
|
|
@@ -222,7 +222,7 @@ class DebitNotePrintService {
|
|
|
222
222
|
Data.Due = 0;
|
|
223
223
|
}
|
|
224
224
|
else {
|
|
225
|
-
Data.Due =
|
|
225
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
226
226
|
}
|
|
227
227
|
if (Data.Due < 0) {
|
|
228
228
|
Data.Due = 0;
|
|
@@ -230,7 +230,7 @@ class DebitNotePrintService {
|
|
|
230
230
|
if (Data.Due === 0) {
|
|
231
231
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
232
232
|
}
|
|
233
|
-
Data.Paid =
|
|
233
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
234
234
|
return Data;
|
|
235
235
|
}
|
|
236
236
|
}
|