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
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DebitNoteTotalsService = void 0;
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
|
-
const
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
class DebitNoteTotalsService {
|
|
7
7
|
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
|
-
Perc =
|
|
10
|
+
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
11
11
|
// LDisc = TrUtils.SetValueToZeroIfNull(LDisc);
|
|
12
12
|
// PDisc = TrUtils.SetValueToZeroIfNull(PDisc);
|
|
13
|
-
Disc =
|
|
13
|
+
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
PartsList = this.CalculateLaborPartValues(PartsList, IsIndependentTax);
|
|
16
16
|
let finalTotalsData = this.GetFinalRODataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
@@ -46,12 +46,12 @@ class DebitNoteTotalsService {
|
|
|
46
46
|
return PartsList;
|
|
47
47
|
}
|
|
48
48
|
static ResetLaborPartValueIfInvalid(Part) {
|
|
49
|
-
Part.UnPr =
|
|
50
|
-
Part.Disc =
|
|
51
|
-
Part.RecDisc =
|
|
52
|
-
Part.CGST =
|
|
53
|
-
Part.SGST =
|
|
54
|
-
Part.IGST =
|
|
49
|
+
Part.UnPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnPr);
|
|
50
|
+
Part.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.Disc);
|
|
51
|
+
Part.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc);
|
|
52
|
+
Part.CGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.CGST);
|
|
53
|
+
Part.SGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.SGST);
|
|
54
|
+
Part.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.IGST);
|
|
55
55
|
return Part;
|
|
56
56
|
}
|
|
57
57
|
static GetFinalRODataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
@@ -89,8 +89,8 @@ class DebitNoteTotalsService {
|
|
|
89
89
|
finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
90
90
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
91
91
|
if (DetailedInfo) {
|
|
92
|
-
finalTotalsData.FixedSubTotal =
|
|
93
|
-
finalTotalsData.FixedTotal =
|
|
92
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
93
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
94
94
|
}
|
|
95
95
|
return finalTotalsData;
|
|
96
96
|
}
|
|
@@ -119,21 +119,21 @@ class DebitNoteTotalsService {
|
|
|
119
119
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
120
120
|
// finalTotalsData.CustLaborIGST = this.GetLaborIGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
121
121
|
let TaxInfo = this.GetPartGSTTaxTotal(PartsList, IsIndependentTax);
|
|
122
|
-
finalTotalsData.CustPartITax =
|
|
123
|
-
finalTotalsData.CustPartCGST =
|
|
124
|
-
finalTotalsData.CustPartIGST =
|
|
125
|
-
finalTotalsData.CustPartSGST =
|
|
122
|
+
finalTotalsData.CustPartITax = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[3]);
|
|
123
|
+
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
124
|
+
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
125
|
+
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
126
126
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
|
|
127
127
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
128
128
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes);
|
|
129
|
-
finalTotalsData.CustTotalRoundedBy =
|
|
130
|
-
finalTotalsData.CustRoundedTotal =
|
|
129
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
130
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
131
131
|
for (var key in finalTotalsData) {
|
|
132
132
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
133
133
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
134
134
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
135
135
|
&& typeof finalTotalsData[key] === 'number') {
|
|
136
|
-
finalTotalsData[key] =
|
|
136
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
return finalTotalsData;
|
|
@@ -142,7 +142,7 @@ class DebitNoteTotalsService {
|
|
|
142
142
|
let PartsDiscountedTotal = 0;
|
|
143
143
|
let overallPartDisc = 0;
|
|
144
144
|
if (!isTaxable) {
|
|
145
|
-
overallPartDisc =
|
|
145
|
+
overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
146
146
|
}
|
|
147
147
|
PartsList.forEach((Part) => {
|
|
148
148
|
PartsDiscountedTotal = (0, aggregation_1.addition)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
@@ -170,8 +170,8 @@ class DebitNoteTotalsService {
|
|
|
170
170
|
}
|
|
171
171
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
172
172
|
let ItemsTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
173
|
-
if (!
|
|
174
|
-
if (!
|
|
173
|
+
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
174
|
+
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
175
175
|
ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
@@ -203,13 +203,13 @@ class DebitNoteTotalsService {
|
|
|
203
203
|
}
|
|
204
204
|
static GetCombinedTaxPercentage(Parts, TaxCodes) {
|
|
205
205
|
Parts.forEach((Part) => {
|
|
206
|
-
if (
|
|
206
|
+
if (tr_utils_1.TrUtils.IsNull(Part.HSN)) {
|
|
207
207
|
Part.HSN = '';
|
|
208
208
|
}
|
|
209
209
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
210
|
-
Part.CGSTAmt =
|
|
211
|
-
Part.SGSTAmt =
|
|
212
|
-
Part.IGSTAmt =
|
|
210
|
+
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
211
|
+
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
212
|
+
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
213
213
|
Part.CombinedTaxPercentage = (0, aggregation_1.addition)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
214
214
|
});
|
|
215
215
|
return Parts;
|
|
@@ -252,8 +252,8 @@ class DebitNoteTotalsService {
|
|
|
252
252
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
253
253
|
});
|
|
254
254
|
TaxInfo.HSN = HSN;
|
|
255
|
-
TaxInfo.TotalTaxableAmount =
|
|
256
|
-
TaxInfo.TotalTaxAmount =
|
|
255
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
256
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
257
257
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
258
258
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
259
259
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -272,7 +272,7 @@ class DebitNoteTotalsService {
|
|
|
272
272
|
let CGST = 0;
|
|
273
273
|
let SGST = 0;
|
|
274
274
|
let IGST = 0;
|
|
275
|
-
if (
|
|
275
|
+
if (tr_utils_1.TrUtils.IsNull(TCode)) {
|
|
276
276
|
return [CGST, SGST, IGST];
|
|
277
277
|
}
|
|
278
278
|
let TCodeIndex = TaxCodes.findIndex((TaxCode) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeliveryChallanPdfService = 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 DeliveryChallanPdfService {
|
|
@@ -10,7 +10,7 @@ class DeliveryChallanPdfService {
|
|
|
10
10
|
}
|
|
11
11
|
static GetDeliveryChallanPrint(ROPrintData, numberofCopies, 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), this.PreparesparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies, moreDiscDetails));
|
|
15
15
|
}
|
|
16
16
|
else {
|
|
@@ -36,7 +36,7 @@ class DeliveryChallanPdfService {
|
|
|
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 DeliveryChallanPdfService {
|
|
|
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 DeliveryChallanPdfService {
|
|
|
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 DeliveryChallanPdfService {
|
|
|
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
|
}
|
|
@@ -154,14 +154,14 @@ class DeliveryChallanPdfService {
|
|
|
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 DeliveryChallanPdfService {
|
|
|
171
171
|
|| column.Field === 'CGSTPerc' || column.Field === 'SGSTPerc' || column.Field === 'IGSTAmt' || column.Field === 'IGSTPerc') {
|
|
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 DeliveryChallanPdfService {
|
|
|
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 DeliveryChallanPdfService {
|
|
|
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 {
|
|
@@ -201,7 +201,7 @@ class DeliveryChallanPdfService {
|
|
|
201
201
|
if (column.Field === 'Desc') {
|
|
202
202
|
let DescData = [];
|
|
203
203
|
DescData.push(part[column.Field].toString());
|
|
204
|
-
if (!
|
|
204
|
+
if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
|
|
205
205
|
DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
|
|
206
206
|
}
|
|
207
207
|
dataRow.push({ stack: DescData });
|
|
@@ -416,7 +416,7 @@ class DeliveryChallanPdfService {
|
|
|
416
416
|
}
|
|
417
417
|
static CommonTotalDetails(ROPrintData, index, numberofCopies, moreDiscDetails) {
|
|
418
418
|
let CommonDetails = [
|
|
419
|
-
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, '0.00', ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
419
|
+
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, '0.00', ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), '0.00', ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, null, null, moreDiscDetails),
|
|
420
420
|
// SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts),
|
|
421
421
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
422
422
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
@@ -425,7 +425,7 @@ class DeliveryChallanPdfService {
|
|
|
425
425
|
if (ROPrintData.Type !== 'Invoice') {
|
|
426
426
|
CommonDetails.splice(2, 0, shared_pdf_service_1.SharedPDFService.GetUnderLine());
|
|
427
427
|
}
|
|
428
|
-
if (!
|
|
428
|
+
if (!tr_utils_1.TrUtils.IsNull(numberofCopies) && numberofCopies.length !== 0 && (index !== (numberofCopies.length - 1))) {
|
|
429
429
|
CommonDetails.push({ text: '', pageBreak: 'after' });
|
|
430
430
|
}
|
|
431
431
|
return CommonDetails;
|
|
@@ -3,36 +3,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeliveryChallanPrintService = void 0;
|
|
4
4
|
const shared_print_service_1 = require("./shared-print.service");
|
|
5
5
|
const delivery_challan_totals_1 = require("./delivery-challan-totals");
|
|
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 DeliveryChallanPrintService {
|
|
12
12
|
static GetChallanDataPrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma) {
|
|
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);
|
|
26
26
|
InvoicePrintData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(OriginalEntityData, "Delivery Challan", OriginalInvoiceData);
|
|
27
27
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
28
28
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
29
|
-
let IsTaxable = (IncludeGST &&
|
|
29
|
+
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
30
30
|
let finalTotalsData = delivery_challan_totals_1.DeliveryChallanTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round);
|
|
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);
|
|
@@ -52,12 +52,12 @@ class DeliveryChallanPrintService {
|
|
|
52
52
|
InvoicePrintData.IncludeGST = IncludeGST;
|
|
53
53
|
InvoicePrintData.ConsolidateGST = ConsolidateGST;
|
|
54
54
|
InvoicePrintData.ShowAccParts = false;
|
|
55
|
-
InvoicePrintData.ShowIGST = (
|
|
55
|
+
InvoicePrintData.ShowIGST = (tr_utils_1.TrUtils.IsNull(SType) || (SType === 'Intra')) ? false : true;
|
|
56
56
|
InvoicePrintData.ShowTaxColumn = (IncludeGST && !ConsolidateGST) ? true : false;
|
|
57
57
|
// InvoicePrintData.ShowDiscountColumn = (!ForInsurance && !ConsolidateGST) ? true : false;
|
|
58
58
|
InvoicePrintData = this.GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma);
|
|
59
|
-
InvoicePrintData.PrDate =
|
|
60
|
-
InvoicePrintData.BL =
|
|
59
|
+
InvoicePrintData.PrDate = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.PrDate) ? '' : my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.PrDate);
|
|
60
|
+
InvoicePrintData.BL = tr_utils_1.TrUtils.Stringify(OriginalInvoiceData.BL);
|
|
61
61
|
return InvoicePrintData;
|
|
62
62
|
}
|
|
63
63
|
static GetInvoiceTypeHeading(InvoicePrintData, OriginalInvoiceData, IncludeGST, ConsolidateGST, IsProforma) {
|
|
@@ -83,24 +83,24 @@ class DeliveryChallanPrintService {
|
|
|
83
83
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
84
84
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
85
85
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
86
|
-
Item.UnPr =
|
|
86
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
Item.UnPr =
|
|
89
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
90
90
|
}
|
|
91
|
-
Item.CGSTAmt =
|
|
92
|
-
Item.SGSTAmt =
|
|
93
|
-
Item.IGSTAmt =
|
|
91
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
92
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
93
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
94
94
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
95
95
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
96
96
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
97
97
|
if (LineTotal === 'AT') {
|
|
98
|
-
Item.LineTotal =
|
|
98
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
99
99
|
}
|
|
100
100
|
else {
|
|
101
|
-
Item.LineTotal =
|
|
101
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
102
102
|
}
|
|
103
|
-
if (!
|
|
103
|
+
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
104
104
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
105
105
|
}
|
|
106
106
|
});
|
|
@@ -124,20 +124,20 @@ class DeliveryChallanPrintService {
|
|
|
124
124
|
Customer.Name = OriginalInvoiceData.ShipTo.Name;
|
|
125
125
|
Customer.Adrs = [];
|
|
126
126
|
Customer.Cons = [];
|
|
127
|
-
if (!
|
|
127
|
+
if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.ShipTo.Adrs)) {
|
|
128
128
|
Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.A1);
|
|
129
|
-
if (!
|
|
129
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Adrs.A2)) {
|
|
130
130
|
Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.A2);
|
|
131
131
|
}
|
|
132
|
-
if (!
|
|
132
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Adrs.Ct)) {
|
|
133
133
|
Customer.Adrs.push(OriginalInvoiceData.ShipTo.Adrs.Ct);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
Customer.GSTIN = OriginalInvoiceData.ShipTo.GSTIN;
|
|
137
|
-
if (!
|
|
137
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.DLNo)) {
|
|
138
138
|
Customer.DLNo = OriginalInvoiceData.ShipTo.DLNo;
|
|
139
139
|
}
|
|
140
|
-
if (!
|
|
140
|
+
if (!tr_utils_1.TrUtils.IsEmpty(OriginalInvoiceData.ShipTo.Ph)) {
|
|
141
141
|
Customer.Cons = [
|
|
142
142
|
{
|
|
143
143
|
Type: 'M',
|
|
@@ -149,7 +149,7 @@ class DeliveryChallanPrintService {
|
|
|
149
149
|
return InvoicePrintData;
|
|
150
150
|
}
|
|
151
151
|
static GetBillToName(Title, Name) {
|
|
152
|
-
return
|
|
152
|
+
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
153
153
|
}
|
|
154
154
|
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
155
155
|
var i = 0;
|
|
@@ -162,7 +162,7 @@ class DeliveryChallanPrintService {
|
|
|
162
162
|
Data.Due = 0;
|
|
163
163
|
}
|
|
164
164
|
else {
|
|
165
|
-
Data.Due =
|
|
165
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
166
166
|
}
|
|
167
167
|
if (Data.Due < 0) {
|
|
168
168
|
Data.Due = 0;
|
|
@@ -170,7 +170,7 @@ class DeliveryChallanPrintService {
|
|
|
170
170
|
if (Data.Due === 0) {
|
|
171
171
|
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
172
172
|
}
|
|
173
|
-
Data.Paid =
|
|
173
|
+
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
174
174
|
return Data;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DeliveryChallanTotalsService = void 0;
|
|
4
4
|
const aggregation_1 = require("../aggregation/aggregation");
|
|
5
|
-
const
|
|
5
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
6
6
|
class DeliveryChallanTotalsService {
|
|
7
7
|
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
|
-
Perc =
|
|
9
|
+
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
10
10
|
// LDisc = TrUtils.SetValueToZeroIfNull(LDisc);
|
|
11
|
-
Disc =
|
|
11
|
+
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
12
12
|
PartsList = this.CalculateLaborPartValues(PartsList, IsIndependentTax);
|
|
13
13
|
let finalTotalsData = this.GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable);
|
|
14
14
|
if (DetailedInfo) {
|
|
@@ -29,7 +29,7 @@ class DeliveryChallanTotalsService {
|
|
|
29
29
|
static ResetLaborPartValues(PartsList, IsIndependentTax) {
|
|
30
30
|
PartsList.forEach((Part) => {
|
|
31
31
|
Part = this.ResetLaborPartValueIfInvalid(Part);
|
|
32
|
-
Part.DiscountedPrice = (0, aggregation_1.addition)(Part.Disc,
|
|
32
|
+
Part.DiscountedPrice = (0, aggregation_1.addition)(Part.Disc, tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc));
|
|
33
33
|
let NetAmt = (0, aggregation_1.subtraction)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
34
34
|
Part.AfterPartDisc = NetAmt;
|
|
35
35
|
if (IsIndependentTax) {
|
|
@@ -42,12 +42,12 @@ class DeliveryChallanTotalsService {
|
|
|
42
42
|
return PartsList;
|
|
43
43
|
}
|
|
44
44
|
static ResetLaborPartValueIfInvalid(Part) {
|
|
45
|
-
Part.UnPr =
|
|
46
|
-
Part.Disc =
|
|
47
|
-
Part.RecDisc =
|
|
48
|
-
Part.CGST =
|
|
49
|
-
Part.SGST =
|
|
50
|
-
Part.IGST =
|
|
45
|
+
Part.UnPr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.UnPr);
|
|
46
|
+
Part.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.Disc);
|
|
47
|
+
Part.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.RecDisc);
|
|
48
|
+
Part.CGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.CGST);
|
|
49
|
+
Part.SGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.SGST);
|
|
50
|
+
Part.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.IGST);
|
|
51
51
|
return Part;
|
|
52
52
|
}
|
|
53
53
|
static GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable) {
|
|
@@ -75,15 +75,15 @@ class DeliveryChallanTotalsService {
|
|
|
75
75
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(CustPartTaxTotal, PartsList, IsIndependentTax);
|
|
76
76
|
// console.log('CustTotal', CustTotal);
|
|
77
77
|
if (isRoundable) {
|
|
78
|
-
finalTotalsData.Round =
|
|
78
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo(Math.round(CustTotal) - CustTotal);
|
|
79
79
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
finalTotalsData.Total =
|
|
82
|
+
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
83
83
|
}
|
|
84
84
|
if (DetailedInfo) {
|
|
85
|
-
finalTotalsData.FixedSubTotal =
|
|
86
|
-
finalTotalsData.FixedTotal =
|
|
85
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
86
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
87
87
|
}
|
|
88
88
|
return finalTotalsData;
|
|
89
89
|
}
|
|
@@ -116,21 +116,21 @@ class DeliveryChallanTotalsService {
|
|
|
116
116
|
// finalTotalsData.CustPartIGST = this.GetPartIGSTTaxTotal(PartsList, IsIndependentTax);
|
|
117
117
|
// finalTotalsData.CustPartSGST = this.GetPartSGSTTaxTotal(PartsList, IsIndependentTax);
|
|
118
118
|
let TaxInfo = this.GetPartGSTTaxTotal(PartsList, IsIndependentTax);
|
|
119
|
-
finalTotalsData.CustPartITax =
|
|
120
|
-
finalTotalsData.CustPartCGST =
|
|
121
|
-
finalTotalsData.CustPartIGST =
|
|
122
|
-
finalTotalsData.CustPartSGST =
|
|
119
|
+
finalTotalsData.CustPartITax = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[3]);
|
|
120
|
+
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
121
|
+
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
122
|
+
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
123
123
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
124
124
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
125
125
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes);
|
|
126
|
-
finalTotalsData.CustTotalRoundedBy =
|
|
127
|
-
finalTotalsData.CustRoundedTotal =
|
|
126
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
127
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
128
128
|
for (var key in finalTotalsData) {
|
|
129
129
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
130
130
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
131
131
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
132
132
|
&& typeof finalTotalsData[key] === 'number') {
|
|
133
|
-
finalTotalsData[key] =
|
|
133
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return finalTotalsData;
|
|
@@ -170,8 +170,8 @@ class DeliveryChallanTotalsService {
|
|
|
170
170
|
}
|
|
171
171
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
|
|
172
172
|
let LaborTotal = (0, aggregation_1.addition)(LaborTotalAfterDisc, LaborTaxAmount);
|
|
173
|
-
if (!
|
|
174
|
-
if (!
|
|
173
|
+
if (!tr_utils_1.TrUtils.IsZero(MainLDisc)) {
|
|
174
|
+
if (!tr_utils_1.TrUtils.IsEmpty(LDiscInPerc)) {
|
|
175
175
|
LaborTotal = (0, aggregation_1.subtraction)(LaborTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(LaborTotal, Number(LDiscInPerc)), 100));
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
@@ -182,8 +182,8 @@ class DeliveryChallanTotalsService {
|
|
|
182
182
|
}
|
|
183
183
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
184
184
|
let ItemsTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
185
|
-
if (!
|
|
186
|
-
if (!
|
|
185
|
+
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
186
|
+
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
187
187
|
ItemsTotal = (0, aggregation_1.subtraction)(ItemsTotal, (0, aggregation_1.division)((0, aggregation_1.multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
188
188
|
}
|
|
189
189
|
else {
|
|
@@ -242,13 +242,13 @@ class DeliveryChallanTotalsService {
|
|
|
242
242
|
}
|
|
243
243
|
static GetCombinedTaxPercentage(Parts, TaxCodes) {
|
|
244
244
|
Parts.forEach((Part) => {
|
|
245
|
-
if (
|
|
245
|
+
if (tr_utils_1.TrUtils.IsNull(Part.HSN)) {
|
|
246
246
|
Part.HSN = '';
|
|
247
247
|
}
|
|
248
248
|
let GSTValues = this.GetGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
249
|
-
Part.CGSTAmt =
|
|
250
|
-
Part.SGSTAmt =
|
|
251
|
-
Part.IGSTAmt =
|
|
249
|
+
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
250
|
+
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
251
|
+
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
252
252
|
Part.CombinedTaxPercentage = (0, aggregation_1.addition)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
253
253
|
});
|
|
254
254
|
return Parts;
|
|
@@ -299,8 +299,8 @@ class DeliveryChallanTotalsService {
|
|
|
299
299
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
300
300
|
});
|
|
301
301
|
TaxInfo.HSN = HSN;
|
|
302
|
-
TaxInfo.TotalTaxableAmount =
|
|
303
|
-
TaxInfo.TotalTaxAmount =
|
|
302
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
303
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
304
304
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
305
305
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
306
306
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -319,7 +319,7 @@ class DeliveryChallanTotalsService {
|
|
|
319
319
|
let CGST = 0;
|
|
320
320
|
let SGST = 0;
|
|
321
321
|
let IGST = 0;
|
|
322
|
-
if (
|
|
322
|
+
if (tr_utils_1.TrUtils.IsNull(TCode)) {
|
|
323
323
|
return [CGST, SGST, IGST];
|
|
324
324
|
}
|
|
325
325
|
let TCodeIndex = TaxCodes.findIndex((TaxCode) => {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EquipmentDesignPdf = void 0;
|
|
4
4
|
const shared_print_service_1 = require("./shared-print.service");
|
|
5
5
|
const shared_pdf_service_1 = require("./shared-pdf.service");
|
|
6
|
-
const
|
|
6
|
+
const tr_utils_1 = require("../utils/tr-utils");
|
|
7
7
|
class EquipmentDesignPdf {
|
|
8
8
|
static GetEquipmentPdf(Entity, Image, Sites, Items) {
|
|
9
9
|
var dd = {
|
|
@@ -23,7 +23,7 @@ class EquipmentDesignPdf {
|
|
|
23
23
|
return dd;
|
|
24
24
|
}
|
|
25
25
|
static GetContentData(Entity, Sites, Items, Image) {
|
|
26
|
-
let EntityData = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(
|
|
26
|
+
let EntityData = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(tr_utils_1.TrUtils.Stringify(Entity), '', null);
|
|
27
27
|
Entity = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(Entity, Entity, Image);
|
|
28
28
|
EntityData.HColor = Entity.HColor;
|
|
29
29
|
return [
|
|
@@ -45,7 +45,7 @@ class EquipmentDesignPdf {
|
|
|
45
45
|
static getsites(Sites, Items) {
|
|
46
46
|
let mainsites = [];
|
|
47
47
|
mainsites = Sites.filter((site) => {
|
|
48
|
-
return
|
|
48
|
+
return tr_utils_1.TrUtils.IsNull(site.Parent);
|
|
49
49
|
});
|
|
50
50
|
mainsites.forEach((site, pindex) => {
|
|
51
51
|
site.Index = pindex + 1;
|
|
@@ -58,16 +58,16 @@ class EquipmentDesignPdf {
|
|
|
58
58
|
// lo.push({ text: item.Name, colSpan: item.children.length });
|
|
59
59
|
// lo.push({});
|
|
60
60
|
let Itemdata = this.GetItem(item.ItemId, Items);
|
|
61
|
-
if (
|
|
61
|
+
if (tr_utils_1.TrUtils.IsNull(Itemdata.TR)) {
|
|
62
62
|
Itemdata.TR = '';
|
|
63
63
|
}
|
|
64
|
-
if (
|
|
64
|
+
if (tr_utils_1.TrUtils.IsNull(Itemdata.Model)) {
|
|
65
65
|
Itemdata.Model = '';
|
|
66
66
|
}
|
|
67
|
-
if (
|
|
67
|
+
if (tr_utils_1.TrUtils.IsNull(item.Qty)) {
|
|
68
68
|
item.Qty = '';
|
|
69
69
|
}
|
|
70
|
-
if (
|
|
70
|
+
if (tr_utils_1.TrUtils.IsNull(item.children) || item.children.length === 0) {
|
|
71
71
|
lo.push({ text: item.Index });
|
|
72
72
|
lo.push({ text: item.Name });
|
|
73
73
|
lo.push({ text: item.Qty });
|
|
@@ -105,13 +105,13 @@ class EquipmentDesignPdf {
|
|
|
105
105
|
// sm.push({ text: child.Name, colSpan: child.children.length })
|
|
106
106
|
// sm.push({ text: 'High wall' });
|
|
107
107
|
let Itemdata = this.GetItem(child.ItemId, Items);
|
|
108
|
-
if (
|
|
108
|
+
if (tr_utils_1.TrUtils.IsNull(Itemdata.TR)) {
|
|
109
109
|
Itemdata.TR = '';
|
|
110
110
|
}
|
|
111
|
-
if (
|
|
111
|
+
if (tr_utils_1.TrUtils.IsNull(Itemdata.Model)) {
|
|
112
112
|
Itemdata.Model = '';
|
|
113
113
|
}
|
|
114
|
-
if (
|
|
114
|
+
if (tr_utils_1.TrUtils.IsNull(child.Qty)) {
|
|
115
115
|
child.Qty = '';
|
|
116
116
|
}
|
|
117
117
|
if (child.children.length === 0) {
|