shareneus 1.4.48 → 1.4.50
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/accounting/counter-sales/sales-receipt-print.service.d.ts +3 -3
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +30 -29
- package/dist/accounting/credit-note/cn-print.service.d.ts +1 -2
- package/dist/accounting/credit-note/cn-print.service.js +10 -32
- package/dist/accounting/credit-note/credit-note-totals.service.d.ts +6 -6
- package/dist/accounting/credit-note/credit-note-totals.service.js +19 -19
- package/dist/accounting/debit-note/debit-note-print.service.d.ts +2 -2
- package/dist/accounting/debit-note/debit-note-print.service.js +15 -15
- package/dist/accounting/debit-note/debit-note-totals.service.d.ts +6 -6
- package/dist/accounting/debit-note/debit-note-totals.service.js +18 -18
- package/dist/accounting/invoice/hc-inv-pdf.service.d.ts +7 -7
- package/dist/accounting/invoice/hc-inv-pdf.service.js +36 -36
- package/dist/accounting/invoice/inv-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/inv-pdf.service.js +43 -43
- package/dist/accounting/invoice/inv-print.service.d.ts +3 -3
- package/dist/accounting/invoice/inv-print.service.js +24 -24
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +43 -43
- package/dist/accounting/invoice/invoice-total.service.d.ts +11 -11
- package/dist/accounting/invoice/invoice-total.service.js +54 -54
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
- package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +8 -7
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +14 -14
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +8 -8
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +10 -10
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +14 -13
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +8 -8
- package/dist/accounting/invoice/reports/excel/operator-wise-details.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/operator-wise-details.js +8 -8
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +8 -8
- package/dist/accounting/invoice/shared-inv-pdf.service.d.ts +6 -6
- package/dist/accounting/invoice/shared-inv-pdf.service.js +29 -29
- package/dist/appointments/appointments/appointment-total.service.d.ts +6 -6
- package/dist/appointments/appointments/appointment-total.service.js +28 -29
- package/dist/gst/excel/GSTR-RO-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR-RO-excel.service.js +8 -8
- package/dist/gst/excel/GSTR1-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR1-excel.service.js +10 -10
- package/dist/gst/excel/GSTR2-excel.service.d.ts +4 -4
- package/dist/gst/excel/GSTR2-excel.service.js +9 -9
- package/dist/gst/excel/tally-sales-import.service.d.ts +4 -4
- package/dist/gst/excel/tally-sales-import.service.js +8 -8
- package/dist/inventory/items/issue-parts-pdf.service.d.ts +6 -6
- package/dist/inventory/items/issue-parts-pdf.service.js +32 -32
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +11 -10
- package/dist/inventory/items/reports/excel/item-wise-mout-details.d.ts +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-details.js +8 -8
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.d.ts +4 -4
- package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +8 -8
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +12 -12
- package/dist/inventory/items/reports/excel/stock-excel.service.d.ts +4 -4
- package/dist/inventory/items/reports/excel/stock-excel.service.js +8 -8
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.d.ts +4 -4
- package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +9 -9
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.d.ts +6 -6
- package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +14 -14
- package/dist/purchases/purchase-order/po-totals.service.d.ts +7 -7
- package/dist/purchases/purchase-order/po-totals.service.js +24 -25
- package/dist/purchases/purchase-order/purchase-order-print.service.js +3 -3
- package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +10 -10
- package/dist/purchases/purchase-order/purchase-order-totals.service.js +27 -27
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.d.ts +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.js +20 -20
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +8 -8
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +31 -32
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.d.ts +1 -2
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +10 -32
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +6 -6
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +19 -19
- package/dist/sales/delivery-challan/delivery-challan-print.service.d.ts +1 -2
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +10 -33
- package/dist/sales/delivery-challan/delivery-challan-totals.d.ts +6 -6
- package/dist/sales/delivery-challan/delivery-challan-totals.js +20 -20
- package/dist/sales/sales/sales-print.service.d.ts +2 -2
- package/dist/sales/sales/sales-print.service.js +18 -18
- package/dist/sales/sales/sales-totals.service.d.ts +6 -6
- package/dist/sales/sales/sales-totals.service.js +19 -19
- package/dist/services/est.print-service.d.ts +18 -18
- package/dist/services/est.print-service.js +133 -133
- package/dist/services/reports/excel/insurance-expire-excel.service.d.ts +4 -4
- package/dist/services/reports/excel/insurance-expire-excel.service.js +8 -8
- package/dist/services/reports/excel/next-service-date-excel.service.d.ts +4 -4
- package/dist/services/reports/excel/next-service-date-excel.service.js +8 -8
- package/dist/services/reports/excel/repair-orders-excel.service.d.ts +5 -5
- package/dist/services/reports/excel/repair-orders-excel.service.js +11 -11
- package/dist/services/ro-print-service.d.ts +6 -6
- package/dist/services/ro-print-service.js +40 -40
- package/dist/services/ro-totals.service.d.ts +11 -11
- package/dist/services/ro-totals.service.js +50 -50
- package/dist/shared/shared-pdf.service.d.ts +0 -16
- package/dist/shared/shared-pdf.service.js +36 -34
- package/dist/shared/shared-print.service.js +1 -0
- package/dist/utils/tr-utils.d.ts +2 -3
- package/dist/utils/tr-utils.js +7 -6
- package/package.json +1 -1
- package/dist/shared/shared-pdfs/shared-pdf.service.d.ts +0 -926
- package/dist/shared/shared-pdfs/shared-pdf.service.js +0 -2608
|
@@ -4,7 +4,7 @@ exports.VendorCreditNoteTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class VendorCreditNoteTotalsService {
|
|
7
|
-
static GetTotalsValue(opCodesList, ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
7
|
+
static GetTotalsValue(opCodesList, ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
10
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
@@ -13,9 +13,9 @@ class VendorCreditNoteTotalsService {
|
|
|
13
13
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
ItemsList = this.CalculateLaborItemValues(ItemsList, IsIndependentTax);
|
|
16
|
-
let finalTotalsData = this.GetFinalCNDataForSave(opCodesList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
16
|
+
let finalTotalsData = this.GetFinalCNDataForSave(opCodesList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, EntitySettings.DecimalsNumber);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
// finalTotalsData.Ops = opCodesList;
|
|
@@ -53,11 +53,11 @@ class VendorCreditNoteTotalsService {
|
|
|
53
53
|
Item.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
54
54
|
return Item;
|
|
55
55
|
}
|
|
56
|
-
static GetFinalCNDataForSave(LaborList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
56
|
+
static GetFinalCNDataForSave(LaborList, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, DecimalsNumber) {
|
|
57
57
|
let finalTotalsData = {};
|
|
58
58
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
59
59
|
finalTotalsData.Settings = Settings;
|
|
60
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, [], ItemsList, IsIndependentTax, DetailedInfo);
|
|
60
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, [], ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber);
|
|
61
61
|
return finalTotalsData;
|
|
62
62
|
}
|
|
63
63
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -74,22 +74,22 @@ class VendorCreditNoteTotalsService {
|
|
|
74
74
|
}
|
|
75
75
|
return finalTotalsData;
|
|
76
76
|
}
|
|
77
|
-
static GetFinalCustomerTotalsData(finalTotalsData, LaborList, ItemsList, IsIndependentTax, DetailedInfo) {
|
|
77
|
+
static GetFinalCustomerTotalsData(finalTotalsData, LaborList, ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber) {
|
|
78
78
|
let CustomerAfterDiscTotals = this.GetSubTotalFor([], ItemsList);
|
|
79
79
|
let CustLaborTaxTotal = this.GetLaborTaxTotalFor([], IsIndependentTax);
|
|
80
80
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
81
|
-
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
81
|
+
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
82
82
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
83
|
-
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
83
|
+
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData, DecimalsNumber);
|
|
84
84
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
85
85
|
let CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
86
|
-
finalTotalsData.STotal = tr_utils_1.TrUtils.FixedTo(CustItemsDiscTotal
|
|
87
|
-
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, CustItemTaxTotal, [], ItemsList, IsIndependentTax);
|
|
88
|
-
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo(Math.round(CustTotal)
|
|
86
|
+
finalTotalsData.STotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(CustItemsDiscTotal, CustItemsTotalAfterDisc), DecimalsNumber);
|
|
87
|
+
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustLaborTaxTotal, CustItemTaxTotal, [], ItemsList, IsIndependentTax, DecimalsNumber);
|
|
88
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
89
89
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
90
90
|
if (DetailedInfo) {
|
|
91
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
92
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
91
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
92
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
93
93
|
}
|
|
94
94
|
return finalTotalsData;
|
|
95
95
|
}
|
|
@@ -105,15 +105,14 @@ class VendorCreditNoteTotalsService {
|
|
|
105
105
|
});
|
|
106
106
|
return ItemsTotalAfterDisc;
|
|
107
107
|
}
|
|
108
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes) {
|
|
108
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, opCodesList, ItemsList, TaxCodes, DecimalsNumber) {
|
|
109
109
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList, IsIndependentTax, finalTotalsData);
|
|
110
|
-
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
110
|
+
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData, DecimalsNumber);
|
|
111
111
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
112
112
|
finalTotalsData.CustItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
113
113
|
// finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
|
|
114
114
|
// + finalTotalsData.CustLaborDiscTotal);
|
|
115
|
-
finalTotalsData.CustItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo(finalTotalsData.CustItemsTotalAfterDisc
|
|
116
|
-
+ finalTotalsData.CustItemsDiscTotal);
|
|
115
|
+
finalTotalsData.CustItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(finalTotalsData.CustItemsTotalAfterDisc, finalTotalsData.CustItemsDiscTotal), DecimalsNumber);
|
|
117
116
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
118
117
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
119
118
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -128,21 +127,21 @@ class VendorCreditNoteTotalsService {
|
|
|
128
127
|
// finalTotalsData.CustItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
129
128
|
// finalTotalsData.CustItemSGST = this.GetItemSGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
130
129
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
131
|
-
finalTotalsData.CustItemAfterTax = tr_utils_1.TrUtils.FixedTo(finalTotalsData.CustItemITax
|
|
132
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
133
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
134
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
130
|
+
finalTotalsData.CustItemAfterTax = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc), DecimalsNumber);
|
|
131
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
132
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
133
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
135
134
|
for (var key in finalTotalsData) {
|
|
136
135
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
137
136
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
138
137
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
139
138
|
&& typeof finalTotalsData[key] === 'number') {
|
|
140
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
139
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
141
140
|
}
|
|
142
141
|
}
|
|
143
142
|
return finalTotalsData;
|
|
144
143
|
}
|
|
145
|
-
static GetItemDiscountedTotal(ItemsList, isTaxable, finalTotalsData) {
|
|
144
|
+
static GetItemDiscountedTotal(ItemsList, isTaxable, finalTotalsData, DecimalsNumber) {
|
|
146
145
|
let ItemsDiscountedTotal = 0;
|
|
147
146
|
let overallItemDisc = 0;
|
|
148
147
|
if (!isTaxable) {
|
|
@@ -151,7 +150,7 @@ class VendorCreditNoteTotalsService {
|
|
|
151
150
|
ItemsList.forEach((Item) => {
|
|
152
151
|
ItemsDiscountedTotal += Item.DiscountedPrice;
|
|
153
152
|
});
|
|
154
|
-
return tr_utils_1.TrUtils.FixedTo(ItemsDiscountedTotal
|
|
153
|
+
return tr_utils_1.TrUtils.FixedTo(((0, aggregation_1.addition)(ItemsDiscountedTotal, overallItemDisc)), DecimalsNumber);
|
|
155
154
|
}
|
|
156
155
|
static GetLaborTaxTotalFor(opCodesList, IsIndependentTax) {
|
|
157
156
|
let TotalTaxAmt = 0;
|
|
@@ -171,14 +170,14 @@ class VendorCreditNoteTotalsService {
|
|
|
171
170
|
}
|
|
172
171
|
return TotalTaxAmt;
|
|
173
172
|
}
|
|
174
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData, LaborTaxAmount, ItemsTaxAmount, LaborList, ItemsList, IsIndependentTax) {
|
|
173
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData, LaborTaxAmount, ItemsTaxAmount, LaborList, ItemsList, IsIndependentTax, DecimalsNumber) {
|
|
175
174
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
176
175
|
let ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
177
176
|
if (IsIndependentTax) {
|
|
178
|
-
return ItemsTotalAfterDisc
|
|
177
|
+
return (0, aggregation_1.addition)(ItemsTotalAfterDisc, LaborTaxAmount, ItemsTaxAmount);
|
|
179
178
|
}
|
|
180
179
|
else {
|
|
181
|
-
return tr_utils_1.TrUtils.FixedTo(ItemsTotalAfterDisc
|
|
180
|
+
return tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(ItemsTotalAfterDisc, finalTotalsData.Disc), DecimalsNumber);
|
|
182
181
|
}
|
|
183
182
|
}
|
|
184
183
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc, LaborTaxAmount, MainLDisc, LDiscInPerc) {
|
|
@@ -220,11 +219,11 @@ class VendorCreditNoteTotalsService {
|
|
|
220
219
|
}
|
|
221
220
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
222
221
|
}
|
|
223
|
-
static GetTaxGroupingForItemsByHSN(Items, TaxCodes) {
|
|
222
|
+
static GetTaxGroupingForItemsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
224
223
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
225
224
|
// Items = this.ResetItemsHSNIfInvalid(Items);
|
|
226
225
|
let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
|
|
227
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
|
|
226
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
|
|
228
227
|
}
|
|
229
228
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
230
229
|
Items.forEach((Item) => {
|
|
@@ -270,7 +269,7 @@ class VendorCreditNoteTotalsService {
|
|
|
270
269
|
});
|
|
271
270
|
return FinalMatchedItems;
|
|
272
271
|
}
|
|
273
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
|
|
272
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
|
|
274
273
|
let HSNTaxInfo = [];
|
|
275
274
|
FinalMatchedItems.forEach((MatchedItem) => {
|
|
276
275
|
let TaxInfo = {};
|
|
@@ -285,8 +284,8 @@ class VendorCreditNoteTotalsService {
|
|
|
285
284
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
286
285
|
});
|
|
287
286
|
TaxInfo.HSN = HSN;
|
|
288
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
289
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
287
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
288
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
290
289
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
291
290
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
292
291
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -3,12 +3,11 @@ export declare class VendorDebitNotePrintService {
|
|
|
3
3
|
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, ForInsurance: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
|
|
4
4
|
static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
|
|
5
5
|
static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
|
|
6
|
-
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
|
|
6
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
|
|
7
7
|
static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
|
|
8
8
|
static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
|
|
9
9
|
static GetFormattedProductDataForPrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
10
10
|
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
11
11
|
static GetCustomerDetails(OriginalInvoiceData: any): any;
|
|
12
12
|
static GetBillToName(Title: any, Name: string): string;
|
|
13
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
14
13
|
}
|
|
@@ -29,13 +29,13 @@ class VendorDebitNotePrintService {
|
|
|
29
29
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
30
30
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
31
31
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
32
|
-
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
|
|
32
|
+
let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity);
|
|
33
33
|
if (ConsolidateGST) {
|
|
34
34
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
35
35
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
36
36
|
}
|
|
37
37
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
38
|
-
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);
|
|
38
|
+
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, OriginalEntityData.Entity.DecimalsNumber);
|
|
39
39
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
40
40
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
41
41
|
InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
|
|
@@ -103,29 +103,29 @@ class VendorDebitNotePrintService {
|
|
|
103
103
|
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
|
|
104
104
|
return InvoicePrintData;
|
|
105
105
|
}
|
|
106
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
|
|
106
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
107
107
|
Items.forEach((Item) => {
|
|
108
108
|
if (Consolidate) {
|
|
109
109
|
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
|
|
110
110
|
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
111
111
|
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
112
112
|
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
113
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
|
|
113
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
114
114
|
}
|
|
115
115
|
else {
|
|
116
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
116
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
117
117
|
}
|
|
118
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
119
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
120
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
118
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
119
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
120
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
121
121
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
122
122
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
123
123
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
124
124
|
if (LineTotal === 'AT') {
|
|
125
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
125
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
126
126
|
}
|
|
127
127
|
else {
|
|
128
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
128
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
129
129
|
}
|
|
130
130
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
131
131
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -220,27 +220,5 @@ class VendorDebitNotePrintService {
|
|
|
220
220
|
static GetBillToName(Title, Name) {
|
|
221
221
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
222
222
|
}
|
|
223
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
224
|
-
var i = 0;
|
|
225
|
-
let Data = {};
|
|
226
|
-
let PaidTotal = 0;
|
|
227
|
-
for (i = 0; i < InvoicePayments.length; i++) {
|
|
228
|
-
PaidTotal += InvoicePayments[i].Paid;
|
|
229
|
-
}
|
|
230
|
-
if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
|
|
231
|
-
Data.Due = 0;
|
|
232
|
-
}
|
|
233
|
-
else {
|
|
234
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
235
|
-
}
|
|
236
|
-
if (Data.Due < 0) {
|
|
237
|
-
Data.Due = 0;
|
|
238
|
-
}
|
|
239
|
-
if (Data.Due === 0) {
|
|
240
|
-
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
241
|
-
}
|
|
242
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
243
|
-
return Data;
|
|
244
|
-
}
|
|
245
223
|
}
|
|
246
224
|
exports.VendorDebitNotePrintService = VendorDebitNotePrintService;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export declare class VendorDebitNoteTotalsService {
|
|
2
|
-
static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any): any;
|
|
2
|
+
static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, EntitySettings: any): any;
|
|
3
3
|
static CalculateLaborItemValues(ItemsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborItemValues(ItemsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborItemValueIfInvalid(Item: any): any;
|
|
6
|
-
static GetFinalRODataForSave(ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any): any;
|
|
6
|
+
static GetFinalRODataForSave(ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, DecimalsNumber: number): any;
|
|
7
7
|
static SetMainDiscountValues(Disc: string, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, DecimalsNumber: number): any;
|
|
9
9
|
static GetSubTotalFor(ItemsList: any): any;
|
|
10
10
|
static GetItemsTotalAfterDiscount(ItemsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any): any;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
12
12
|
static GetItemDiscountedTotal(ItemsList: any, isTaxable: boolean, finalTotalsData: any): any;
|
|
13
13
|
static GetItemsTaxTotalFor(ItemsList: any, IsIndependentTax: boolean): any;
|
|
14
14
|
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, ItemsTaxAmount: number, ItemsList: any, IsIndependentTax: boolean): any;
|
|
15
15
|
static ItemsTotalAfterDiscount(ItemsTotalAfterDisc: number, ItemsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
16
16
|
static GetItemGSTTaxTotal(ItemsList: any, IsIndependentTax: boolean): number[];
|
|
17
|
-
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
17
|
+
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
18
18
|
static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
|
|
19
19
|
static CompareItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
20
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any): any[];
|
|
20
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
21
21
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
22
22
|
}
|
|
@@ -4,7 +4,7 @@ exports.VendorDebitNoteTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class VendorDebitNoteTotalsService {
|
|
7
|
-
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings) {
|
|
7
|
+
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
// PPerc = TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
10
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
@@ -13,9 +13,9 @@ class VendorDebitNoteTotalsService {
|
|
|
13
13
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
14
14
|
// opCodesList = this.CalculateLaborValues(opCodesList, IsIndependentTax);
|
|
15
15
|
ItemsList = this.CalculateLaborItemValues(ItemsList, IsIndependentTax);
|
|
16
|
-
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings);
|
|
16
|
+
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, EntitySettings.DecimalsNumber);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
// finalTotalsData.Ops = opCodesList;
|
|
@@ -56,11 +56,11 @@ class VendorDebitNoteTotalsService {
|
|
|
56
56
|
Item.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
57
57
|
return Item;
|
|
58
58
|
}
|
|
59
|
-
static GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings) {
|
|
59
|
+
static GetFinalRODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, DecimalsNumber) {
|
|
60
60
|
let finalTotalsData = {};
|
|
61
61
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
62
62
|
finalTotalsData.Settings = Settings;
|
|
63
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo);
|
|
63
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber);
|
|
64
64
|
return finalTotalsData;
|
|
65
65
|
}
|
|
66
66
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -77,11 +77,11 @@ class VendorDebitNoteTotalsService {
|
|
|
77
77
|
}
|
|
78
78
|
return finalTotalsData;
|
|
79
79
|
}
|
|
80
|
-
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo) {
|
|
80
|
+
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, DecimalsNumber) {
|
|
81
81
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(ItemsList);
|
|
82
82
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
83
83
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
84
|
-
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
84
|
+
finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
85
85
|
// let CustLaborDiscTotal = this.GetLaborDiscountedTotal(LaborList, IsIndependentTax, finalTotalsData);
|
|
86
86
|
let CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
87
87
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
@@ -91,8 +91,8 @@ class VendorDebitNoteTotalsService {
|
|
|
91
91
|
finalTotalsData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
|
|
92
92
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
93
93
|
if (DetailedInfo) {
|
|
94
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
95
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
94
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
95
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
96
96
|
}
|
|
97
97
|
return finalTotalsData;
|
|
98
98
|
}
|
|
@@ -108,7 +108,7 @@ class VendorDebitNoteTotalsService {
|
|
|
108
108
|
});
|
|
109
109
|
return ItemsTotalAfterDisc;
|
|
110
110
|
}
|
|
111
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes) {
|
|
111
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, DecimalsNumber) {
|
|
112
112
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList, IsIndependentTax, finalTotalsData);
|
|
113
113
|
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList, IsIndependentTax, finalTotalsData);
|
|
114
114
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -131,15 +131,15 @@ class VendorDebitNoteTotalsService {
|
|
|
131
131
|
// finalTotalsData.CustItemSGST = this.GetItemSGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
132
132
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
|
|
133
133
|
finalTotalsData.CustItemAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
|
|
134
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
135
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
136
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
134
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
135
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
136
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
137
137
|
for (var key in finalTotalsData) {
|
|
138
138
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
139
139
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
140
140
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
141
141
|
&& typeof finalTotalsData[key] === 'number') {
|
|
142
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
142
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
return finalTotalsData;
|
|
@@ -201,11 +201,11 @@ class VendorDebitNoteTotalsService {
|
|
|
201
201
|
}
|
|
202
202
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
203
203
|
}
|
|
204
|
-
static GetTaxGroupingForItemsByHSN(Items, TaxCodes) {
|
|
204
|
+
static GetTaxGroupingForItemsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
205
205
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
206
206
|
// Items = this.ResetItemsHSNIfInvalid(Items);
|
|
207
207
|
let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
|
|
208
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
|
|
208
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
|
|
209
209
|
}
|
|
210
210
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
211
211
|
Items.forEach((Item) => {
|
|
@@ -251,7 +251,7 @@ class VendorDebitNoteTotalsService {
|
|
|
251
251
|
});
|
|
252
252
|
return FinalMatchedItems;
|
|
253
253
|
}
|
|
254
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
|
|
254
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
|
|
255
255
|
let HSNTaxInfo = [];
|
|
256
256
|
FinalMatchedItems.forEach((MatchedItem) => {
|
|
257
257
|
let TaxInfo = {};
|
|
@@ -266,8 +266,8 @@ class VendorDebitNoteTotalsService {
|
|
|
266
266
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
267
267
|
});
|
|
268
268
|
TaxInfo.HSN = HSN;
|
|
269
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
270
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
269
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
270
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
271
271
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
272
272
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
273
273
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -3,10 +3,9 @@ export declare class DeliveryChallanPrintService {
|
|
|
3
3
|
static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
|
|
4
4
|
static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
|
|
5
5
|
static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
|
|
6
|
-
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
|
|
6
|
+
static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
|
|
7
7
|
static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
|
|
8
8
|
static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
|
|
9
9
|
static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
|
|
10
10
|
static GetBillToName(Title: any, Name: string): string;
|
|
11
|
-
static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
|
|
12
11
|
}
|
|
@@ -4,7 +4,6 @@ exports.DeliveryChallanPrintService = void 0;
|
|
|
4
4
|
const delivery_challan_totals_1 = require("./delivery-challan-totals");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
const code_enums_1 = require("../../enums/code-enums");
|
|
7
|
-
const enums_1 = require("../../enums/enums");
|
|
8
7
|
const my_date_1 = require("../../utils/my-date");
|
|
9
8
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
10
9
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
@@ -28,13 +27,13 @@ class DeliveryChallanPrintService {
|
|
|
28
27
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
29
28
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
30
29
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
31
|
-
let finalTotalsData = delivery_challan_totals_1.DeliveryChallanTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round);
|
|
30
|
+
let finalTotalsData = delivery_challan_totals_1.DeliveryChallanTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round, InvoicePrintData.Entity);
|
|
32
31
|
if (ConsolidateGST) {
|
|
33
32
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
34
33
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
35
34
|
}
|
|
36
35
|
InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
|
|
37
|
-
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);
|
|
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, OriginalEntityData.Entity.DecimalsNumber);
|
|
38
37
|
argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
|
|
39
38
|
InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
|
|
40
39
|
InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
|
|
@@ -77,29 +76,29 @@ class DeliveryChallanPrintService {
|
|
|
77
76
|
InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
|
|
78
77
|
return InvoicePrintData;
|
|
79
78
|
}
|
|
80
|
-
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
|
|
79
|
+
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
81
80
|
Items.forEach((Item) => {
|
|
82
81
|
if (Consolidate) {
|
|
83
82
|
let AfterDiscForEach = Item.AfterPartDisc / Item.Qty;
|
|
84
83
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
85
84
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
86
85
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
87
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(AfterDiscForEach
|
|
86
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
88
87
|
}
|
|
89
88
|
else {
|
|
90
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
|
|
89
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
91
90
|
}
|
|
92
|
-
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
|
|
93
|
-
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
|
|
94
|
-
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
|
|
91
|
+
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
|
|
92
|
+
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
|
|
93
|
+
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
|
|
95
94
|
Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
96
95
|
Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
97
96
|
Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
|
|
98
97
|
if (LineTotal === 'AT') {
|
|
99
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
|
|
98
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
100
99
|
}
|
|
101
100
|
else {
|
|
102
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
|
|
101
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
103
102
|
}
|
|
104
103
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
105
104
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -152,27 +151,5 @@ class DeliveryChallanPrintService {
|
|
|
152
151
|
static GetBillToName(Title, Name) {
|
|
153
152
|
return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
|
|
154
153
|
}
|
|
155
|
-
static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
|
|
156
|
-
var i = 0;
|
|
157
|
-
let Data = {};
|
|
158
|
-
let PaidTotal = 0;
|
|
159
|
-
for (i = 0; i < InvoicePayments.length; i++) {
|
|
160
|
-
PaidTotal += InvoicePayments[i].Paid;
|
|
161
|
-
}
|
|
162
|
-
if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
|
|
163
|
-
Data.Due = 0;
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
|
|
167
|
-
}
|
|
168
|
-
if (Data.Due < 0) {
|
|
169
|
-
Data.Due = 0;
|
|
170
|
-
}
|
|
171
|
-
if (Data.Due === 0) {
|
|
172
|
-
Data.Sts = enums_1.InvoiceStatusEnum.Closed;
|
|
173
|
-
}
|
|
174
|
-
Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
|
|
175
|
-
return Data;
|
|
176
|
-
}
|
|
177
154
|
}
|
|
178
155
|
exports.DeliveryChallanPrintService = DeliveryChallanPrintService;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare class DeliveryChallanTotalsService {
|
|
2
|
-
static GetTotalsValue(PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean): any;
|
|
2
|
+
static GetTotalsValue(PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean, EntitySettings: any): any;
|
|
3
3
|
static CalculateLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
4
4
|
static ResetLaborPartValues(PartsList: any, IsIndependentTax: boolean): any;
|
|
5
5
|
static ResetLaborPartValueIfInvalid(Part: any): any;
|
|
6
|
-
static GetFinalChallanDataForSave(PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean): any;
|
|
6
|
+
static GetFinalChallanDataForSave(PartsList: any, IsIndependentTax: boolean, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean, DecimalsNumber: number): any;
|
|
7
7
|
static SetMainDiscountValues(Disc: any, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, PartsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean, DecimalsNumber: number): any;
|
|
9
9
|
static GetSubTotalFor(PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
|
-
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any): any;
|
|
11
|
+
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
12
12
|
static GetLaborDiscountedTotal(LaborList: any): any;
|
|
13
13
|
static GetPartDiscountedTotal(PartsList: any): any;
|
|
14
14
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
@@ -19,9 +19,9 @@ export declare class DeliveryChallanTotalsService {
|
|
|
19
19
|
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
20
20
|
static GetLaborSGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
21
21
|
static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
|
|
22
|
-
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
22
|
+
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
23
23
|
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
24
24
|
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
25
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any): any[];
|
|
25
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
26
26
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
27
27
|
}
|