shareneus 1.5.2 → 1.5.4
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.js +9 -9
- package/dist/accounting/credit-note/cn-print.service.js +7 -7
- package/dist/accounting/credit-note/credit-note-totals.service.d.ts +2 -2
- package/dist/accounting/credit-note/credit-note-totals.service.js +33 -33
- package/dist/accounting/debit-note/debit-note-print.service.js +8 -8
- package/dist/accounting/debit-note/debit-note-totals.service.d.ts +2 -2
- package/dist/accounting/debit-note/debit-note-totals.service.js +27 -27
- package/dist/accounting/invoice/inv-pdf.service.js +12 -12
- package/dist/accounting/invoice/inv-print.service.js +11 -11
- package/dist/accounting/invoice/invoice-landscape-pdf.service.js +4 -4
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +12 -12
- package/dist/accounting/invoice/invoice-portrait-pdf.js +5 -5
- package/dist/accounting/invoice/invoice-total.service.d.ts +8 -8
- package/dist/accounting/invoice/invoice-total.service.js +79 -79
- package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +2 -2
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +4 -4
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +4 -4
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +3 -3
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +3 -3
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +2 -2
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +2 -2
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +2 -2
- package/dist/appointments/appointments/appointment-total.service.js +12 -12
- package/dist/appointments/consultations/consultation-fee-receipt.service.js +2 -2
- package/dist/purchases/purchase-order/po-totals.service.js +13 -13
- package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +1 -1
- package/dist/purchases/purchase-order/purchase-order-totals.service.js +58 -58
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +1 -1
- package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +20 -20
- package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +7 -7
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +2 -2
- package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +26 -26
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +4 -4
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +7 -7
- package/dist/sales/delivery-challan/delivery-challan-totals.js +35 -35
- package/dist/sales/sales/sales-print.service.js +9 -9
- package/dist/sales/sales/sales-totals.service.js +32 -32
- package/dist/sales-receive/sales-receive-print.service.js +10 -10
- package/dist/sales-receive/sales-receive-totals.service.d.ts +2 -2
- package/dist/sales-receive/sales-receive-totals.service.js +32 -32
- package/dist/services/est.print-service.js +5 -5
- package/dist/services/ro-print-service.js +13 -13
- package/dist/services/ro-totals.service.d.ts +4 -4
- package/dist/services/ro-totals.service.js +140 -140
- package/dist/shared/math-operations.js +46 -41
- package/dist/shared/shared-pdf.service.js +8 -8
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SaleReceiptPrintService = void 0;
|
|
4
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
4
|
const code_enums_1 = require("../../enums/code-enums");
|
|
6
5
|
const enums_1 = require("../../enums/enums");
|
|
7
6
|
const math_operations_1 = require("../../shared/math-operations");
|
|
@@ -33,6 +32,7 @@ class SaleReceiptPrintService {
|
|
|
33
32
|
argInvoiceData.Ops = [];
|
|
34
33
|
}
|
|
35
34
|
let finalTotalsData = invoice_total_service_1.InvoiceTotalsService.GetTotalsValue(argInvoiceData.Ops, argInvoiceData.Items, IsTaxable, true, argInvoiceData.LDisc, argInvoiceData.LPerc, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, argInvoiceData.Adjust, InvoicePrintData.Entity.Round, InvoicePrintData.Entity);
|
|
35
|
+
console.log('finalTotalsData', finalTotalsData);
|
|
36
36
|
if (ConsolidateGST) {
|
|
37
37
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
38
38
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
@@ -164,7 +164,7 @@ class SaleReceiptPrintService {
|
|
|
164
164
|
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax, DecimalsNumber);
|
|
165
165
|
}
|
|
166
166
|
else {
|
|
167
|
-
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
167
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Labor.Amt, Labor.Disc), DecimalsNumber);
|
|
168
168
|
}
|
|
169
169
|
});
|
|
170
170
|
return LaborList;
|
|
@@ -173,11 +173,11 @@ class SaleReceiptPrintService {
|
|
|
173
173
|
Items.forEach((Item) => {
|
|
174
174
|
var _a;
|
|
175
175
|
if (Consolidate) {
|
|
176
|
-
let AfterDiscForEach = (0,
|
|
177
|
-
let CTaxAmtPerItem = (0,
|
|
178
|
-
let STaxAmtPerItem = (0,
|
|
179
|
-
let ITaxAmtPerItem = (0,
|
|
180
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0,
|
|
176
|
+
let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
|
|
177
|
+
let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
|
|
178
|
+
let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
|
|
179
|
+
let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
|
|
180
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
181
181
|
}
|
|
182
182
|
else {
|
|
183
183
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -202,7 +202,7 @@ class SaleReceiptPrintService {
|
|
|
202
202
|
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
203
203
|
}
|
|
204
204
|
else {
|
|
205
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
205
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
206
206
|
}
|
|
207
207
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
208
208
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -410,7 +410,7 @@ class SaleReceiptPrintService {
|
|
|
410
410
|
Data.Due = 0;
|
|
411
411
|
}
|
|
412
412
|
else {
|
|
413
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo((0,
|
|
413
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
|
|
414
414
|
}
|
|
415
415
|
if (Data.Due < 0) {
|
|
416
416
|
Data.Due = 0;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CNPrintService = void 0;
|
|
4
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
4
|
const code_enums_1 = require("../../enums/code-enums");
|
|
6
5
|
const enums_1 = require("../../enums/enums");
|
|
6
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
7
7
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
8
8
|
const my_date_1 = require("../../utils/my-date");
|
|
9
9
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
@@ -67,11 +67,11 @@ class CNPrintService {
|
|
|
67
67
|
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
68
68
|
Items.forEach((Item) => {
|
|
69
69
|
if (Consolidate) {
|
|
70
|
-
let AfterDiscForEach = (0,
|
|
71
|
-
let CTaxAmtPerItem = (0,
|
|
72
|
-
let STaxAmtPerItem = (0,
|
|
73
|
-
let ITaxAmtPerItem = (0,
|
|
74
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0,
|
|
70
|
+
let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
|
|
71
|
+
let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
|
|
72
|
+
let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
|
|
73
|
+
let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
|
|
74
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
75
75
|
}
|
|
76
76
|
else {
|
|
77
77
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -86,7 +86,7 @@ class CNPrintService {
|
|
|
86
86
|
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
89
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
90
90
|
}
|
|
91
91
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
92
92
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -11,9 +11,9 @@ export declare class CreditNoteTotalsService {
|
|
|
11
11
|
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
|
|
12
12
|
static GetTaxGroupingForPartsByPerc(Parts: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
13
13
|
static ComparePartsByPerc(Parts: any, TaxCodes: any): any[];
|
|
14
|
-
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any):
|
|
14
|
+
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): number;
|
|
15
15
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
16
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean):
|
|
16
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): number;
|
|
17
17
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
18
18
|
static GetLaborCGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
19
19
|
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.CreditNoteTotalsService = void 0;
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
4
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
5
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
6
6
|
class CreditNoteTotalsService {
|
|
7
7
|
static GetTotalsValue(opCodesList, PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, EntitySettings = {}) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
@@ -33,11 +33,11 @@ class CreditNoteTotalsService {
|
|
|
33
33
|
if (tr_utils_1.TrUtils.IsZero(Part.Qty)) {
|
|
34
34
|
Part.Qty = 1;
|
|
35
35
|
}
|
|
36
|
-
Part.DiscountedPrice = (0,
|
|
36
|
+
Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, Part.RecDisc);
|
|
37
37
|
// Part.AfterPartDisc = Part.NetAmt;
|
|
38
|
-
Part.AfterPartDisc = (0,
|
|
38
|
+
Part.AfterPartDisc = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
39
39
|
if (IsIndependentTax) {
|
|
40
|
-
Part.AfterPartTax = (0,
|
|
40
|
+
Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
Part.AfterPartTax = Part.AfterPartDisc;
|
|
@@ -84,9 +84,9 @@ class CreditNoteTotalsService {
|
|
|
84
84
|
let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
|
|
85
85
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
86
86
|
let CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
87
|
-
finalTotalsData.STotal = (0,
|
|
87
|
+
finalTotalsData.STotal = (0, math_operations_1.Add)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
|
|
88
88
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, 0, CustPartTaxTotal, [], PartsList, IsIndependentTax);
|
|
89
|
-
finalTotalsData.Round = (0,
|
|
89
|
+
finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
|
|
90
90
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
91
91
|
if (DetailedInfo) {
|
|
92
92
|
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
@@ -102,7 +102,7 @@ class CreditNoteTotalsService {
|
|
|
102
102
|
static GetPartsTotalAfterDiscount(PartsList) {
|
|
103
103
|
let PartsTotalAfterDisc = 0;
|
|
104
104
|
PartsList.forEach((Part) => {
|
|
105
|
-
PartsTotalAfterDisc = (0,
|
|
105
|
+
PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
|
|
106
106
|
});
|
|
107
107
|
return PartsTotalAfterDisc;
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ class CreditNoteTotalsService {
|
|
|
113
113
|
finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
114
114
|
// finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
|
|
115
115
|
// + finalTotalsData.CustLaborDiscTotal);
|
|
116
|
-
finalTotalsData.CustPartsTotalBeforeDisc = (0,
|
|
116
|
+
finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
|
|
117
117
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
118
118
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
119
119
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -123,8 +123,8 @@ class CreditNoteTotalsService {
|
|
|
123
123
|
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
124
124
|
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
125
125
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
126
|
-
// finalTotalsData.CustLaborAfterTax =
|
|
127
|
-
finalTotalsData.CustPartAfterTax = (0,
|
|
126
|
+
// finalTotalsData.CustLaborAfterTax = Add(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
127
|
+
finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
128
128
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
|
|
129
129
|
finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
|
|
130
130
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
@@ -183,15 +183,15 @@ class CreditNoteTotalsService {
|
|
|
183
183
|
overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
184
184
|
}
|
|
185
185
|
PartsList.forEach((Part) => {
|
|
186
|
-
PartsDiscountedTotal = (0,
|
|
186
|
+
PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
187
187
|
});
|
|
188
|
-
return (0,
|
|
188
|
+
return (0, math_operations_1.Add)(PartsDiscountedTotal, overallPartDisc);
|
|
189
189
|
}
|
|
190
190
|
static GetPartsTaxTotalFor(PartsList, IsIndependentTax) {
|
|
191
191
|
let TotalTaxAmt = 0;
|
|
192
192
|
if (IsIndependentTax) {
|
|
193
193
|
PartsList.forEach((Part) => {
|
|
194
|
-
TotalTaxAmt = (0,
|
|
194
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
return TotalTaxAmt;
|
|
@@ -200,20 +200,20 @@ class CreditNoteTotalsService {
|
|
|
200
200
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
201
201
|
let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
202
202
|
if (IsIndependentTax) {
|
|
203
|
-
return (0,
|
|
203
|
+
return (0, math_operations_1.Add)(PartsTotalAfterDisc, LaborTaxAmount, PartsTaxAmount);
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
206
|
-
return (0,
|
|
206
|
+
return (0, math_operations_1.Subtract)(PartsTotalAfterDisc, finalTotalsData.Disc);
|
|
207
207
|
}
|
|
208
208
|
}
|
|
209
209
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
210
|
-
let ItemsTotal = (0,
|
|
210
|
+
let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
211
211
|
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
212
212
|
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
213
|
-
ItemsTotal = (0,
|
|
213
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
|
-
ItemsTotal = (0,
|
|
216
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
return ItemsTotal;
|
|
@@ -222,7 +222,7 @@ class CreditNoteTotalsService {
|
|
|
222
222
|
let TotalTaxAmt = 0;
|
|
223
223
|
if (IsIndependentTax) {
|
|
224
224
|
opCodesList.forEach((Labor) => {
|
|
225
|
-
TotalTaxAmt = (0,
|
|
225
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CGST);
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
228
|
return TotalTaxAmt;
|
|
@@ -231,7 +231,7 @@ class CreditNoteTotalsService {
|
|
|
231
231
|
let TotalTaxAmt = 0;
|
|
232
232
|
if (IsIndependentTax) {
|
|
233
233
|
opCodesList.forEach((Labor) => {
|
|
234
|
-
TotalTaxAmt = (0,
|
|
234
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.IGST);
|
|
235
235
|
});
|
|
236
236
|
}
|
|
237
237
|
return TotalTaxAmt;
|
|
@@ -240,7 +240,7 @@ class CreditNoteTotalsService {
|
|
|
240
240
|
let TotalTaxAmt = 0;
|
|
241
241
|
if (IsIndependentTax) {
|
|
242
242
|
opCodesList.forEach((Labor) => {
|
|
243
|
-
TotalTaxAmt = (0,
|
|
243
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.SGST);
|
|
244
244
|
});
|
|
245
245
|
}
|
|
246
246
|
return TotalTaxAmt;
|
|
@@ -252,10 +252,10 @@ class CreditNoteTotalsService {
|
|
|
252
252
|
let TotalTaxAmt = 0;
|
|
253
253
|
if (IsIndependentTax) {
|
|
254
254
|
PartsList.forEach((Part) => {
|
|
255
|
-
TotalCGSTAmt = (0,
|
|
256
|
-
TotalIGSTAmt = (0,
|
|
257
|
-
TotalSGSTAmt = (0,
|
|
258
|
-
TotalTaxAmt = (0,
|
|
255
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
|
|
256
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
|
|
257
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
|
|
258
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
259
259
|
});
|
|
260
260
|
}
|
|
261
261
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
@@ -275,7 +275,7 @@ class CreditNoteTotalsService {
|
|
|
275
275
|
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
276
276
|
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
277
277
|
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
278
|
-
Part.CombinedTaxPercentage = (0,
|
|
278
|
+
Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
279
279
|
});
|
|
280
280
|
return Parts;
|
|
281
281
|
}
|
|
@@ -322,13 +322,13 @@ class CreditNoteTotalsService {
|
|
|
322
322
|
let HSN = MatchedPart[0].HSN;
|
|
323
323
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
324
324
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
325
|
-
TaxOnAmount = (0,
|
|
326
|
-
TaxAmount = (0,
|
|
327
|
-
TaxAmount = (0,
|
|
328
|
-
TaxAmount = (0,
|
|
329
|
-
CGSTAmt = (0,
|
|
330
|
-
SGSTAmt = (0,
|
|
331
|
-
IGSTAmt = (0,
|
|
325
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
|
|
326
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
327
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
328
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
329
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
330
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
331
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
332
332
|
});
|
|
333
333
|
TaxInfo.HSN = HSN;
|
|
334
334
|
TaxInfo.CGSTAmt = CGSTAmt;
|
|
@@ -7,7 +7,7 @@ const code_enums_1 = require("../../enums/code-enums");
|
|
|
7
7
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
8
8
|
const enums_1 = require("../../enums/enums");
|
|
9
9
|
const my_date_1 = require("../../utils/my-date");
|
|
10
|
-
const
|
|
10
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
11
11
|
class DebitNotePrintService {
|
|
12
12
|
static GetDebitNotePrintInfo(OriginalInvoiceData, OriginalEntityData, image, IncludeGST, ConsolidateGST, TaxCodes, IsProforma, IsCustBillTo) {
|
|
13
13
|
var _a, _b, _c, _d;
|
|
@@ -93,11 +93,11 @@ class DebitNotePrintService {
|
|
|
93
93
|
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
94
94
|
Items.forEach((Item) => {
|
|
95
95
|
if (Consolidate) {
|
|
96
|
-
let AfterDiscForEach = (0,
|
|
97
|
-
let CTaxAmtPerItem = (0,
|
|
98
|
-
let STaxAmtPerItem = (0,
|
|
99
|
-
let ITaxAmtPerItem = (0,
|
|
100
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0,
|
|
96
|
+
let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
|
|
97
|
+
let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
|
|
98
|
+
let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
|
|
99
|
+
let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
|
|
100
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
101
101
|
}
|
|
102
102
|
else {
|
|
103
103
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -112,7 +112,7 @@ class DebitNotePrintService {
|
|
|
112
112
|
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
113
113
|
}
|
|
114
114
|
else {
|
|
115
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
115
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
116
116
|
}
|
|
117
117
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
118
118
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -220,7 +220,7 @@ class DebitNotePrintService {
|
|
|
220
220
|
Data.Due = 0;
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
223
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo((0,
|
|
223
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
|
|
224
224
|
}
|
|
225
225
|
if (Data.Due < 0) {
|
|
226
226
|
Data.Due = 0;
|
|
@@ -9,9 +9,9 @@ export declare class DebitNoteTotalsService {
|
|
|
9
9
|
static GetSubTotalFor(PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
11
|
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any, DecimalsNumber?: number): any;
|
|
12
|
-
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any):
|
|
12
|
+
static GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): number;
|
|
13
13
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
14
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, PartsTaxAmount: number, PartsList: any, IsIndependentTax: boolean):
|
|
14
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, PartsTaxAmount: number, PartsList: any, IsIndependentTax: boolean): number;
|
|
15
15
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc: number, PartsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
16
16
|
static GetPartGSTTaxTotal(PartsList: any, IsIndependentTax: boolean): number[];
|
|
17
17
|
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DebitNoteTotalsService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
5
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, EntitySettings) {
|
|
@@ -33,11 +33,11 @@ class DebitNoteTotalsService {
|
|
|
33
33
|
static ResetLaborPartValues(PartsList, IsIndependentTax) {
|
|
34
34
|
PartsList.forEach((Part) => {
|
|
35
35
|
Part = this.ResetLaborPartValueIfInvalid(Part);
|
|
36
|
-
Part.DiscountedPrice = (0,
|
|
36
|
+
Part.DiscountedPrice = (0, math_operations_1.Add)(Part.Disc, Part.RecDisc);
|
|
37
37
|
// Part.AfterPartDisc = Part.NetAmt;
|
|
38
|
-
Part.AfterPartDisc = (0,
|
|
38
|
+
Part.AfterPartDisc = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
39
39
|
if (IsIndependentTax) {
|
|
40
|
-
Part.AfterPartTax = (0,
|
|
40
|
+
Part.AfterPartTax = (0, math_operations_1.Add)(Part.AfterPartDisc, Part.CGST, Part.SGST, Part.IGST);
|
|
41
41
|
}
|
|
42
42
|
else {
|
|
43
43
|
Part.AfterPartTax = Part.AfterPartDisc;
|
|
@@ -84,9 +84,9 @@ class DebitNoteTotalsService {
|
|
|
84
84
|
let CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList, IsIndependentTax, finalTotalsData);
|
|
85
85
|
// let CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(LaborList);
|
|
86
86
|
let CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
87
|
-
finalTotalsData.STotal = (0,
|
|
87
|
+
finalTotalsData.STotal = (0, math_operations_1.Add)(CustPartsDiscTotal, CustPartsTotalAfterDisc);
|
|
88
88
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(finalTotalsData, CustPartTaxTotal, PartsList, IsIndependentTax);
|
|
89
|
-
finalTotalsData.Round = (0,
|
|
89
|
+
finalTotalsData.Round = (0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal);
|
|
90
90
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
91
91
|
if (DetailedInfo) {
|
|
92
92
|
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
@@ -102,7 +102,7 @@ class DebitNoteTotalsService {
|
|
|
102
102
|
static GetPartsTotalAfterDiscount(PartsList) {
|
|
103
103
|
let PartsTotalAfterDisc = 0;
|
|
104
104
|
PartsList.forEach((Part) => {
|
|
105
|
-
PartsTotalAfterDisc = (0,
|
|
105
|
+
PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterPartDisc);
|
|
106
106
|
});
|
|
107
107
|
return PartsTotalAfterDisc;
|
|
108
108
|
}
|
|
@@ -113,7 +113,7 @@ class DebitNoteTotalsService {
|
|
|
113
113
|
finalTotalsData.CustPartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
114
114
|
// finalTotalsData.CustLaborTotalBeforeDisc = TrUtils.FixedTo(finalTotalsData.CustLaborTotalAfterDisc
|
|
115
115
|
// + finalTotalsData.CustLaborDiscTotal);
|
|
116
|
-
finalTotalsData.CustPartsTotalBeforeDisc = (0,
|
|
116
|
+
finalTotalsData.CustPartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.CustPartsTotalAfterDisc, finalTotalsData.CustPartsDiscTotal);
|
|
117
117
|
// finalTotalsData.CustLaborITax = this.GetLaborTaxTotalFor(opCodesList, IsIndependentTax);
|
|
118
118
|
// finalTotalsData.CustLaborSGST = this.GetLaborSGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
119
119
|
// finalTotalsData.CustLaborCGST = this.GetLaborCGSTTaxTotal(opCodesList, IsIndependentTax);
|
|
@@ -123,8 +123,8 @@ class DebitNoteTotalsService {
|
|
|
123
123
|
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
124
124
|
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
125
125
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
126
|
-
// finalTotalsData.CustLaborAfterTax =
|
|
127
|
-
finalTotalsData.CustPartAfterTax = (0,
|
|
126
|
+
// finalTotalsData.CustLaborAfterTax = Add(finalTotalsData.CustLaborITax , finalTotalsData.CustLaborTotalAfterDisc);
|
|
127
|
+
finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
128
128
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
129
129
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
130
130
|
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
@@ -145,15 +145,15 @@ class DebitNoteTotalsService {
|
|
|
145
145
|
overallPartDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(finalTotalsData.PDisc);
|
|
146
146
|
}
|
|
147
147
|
PartsList.forEach((Part) => {
|
|
148
|
-
PartsDiscountedTotal = (0,
|
|
148
|
+
PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
149
149
|
});
|
|
150
|
-
return (0,
|
|
150
|
+
return (0, math_operations_1.Add)(PartsDiscountedTotal, overallPartDisc);
|
|
151
151
|
}
|
|
152
152
|
static GetPartsTaxTotalFor(PartsList, IsIndependentTax) {
|
|
153
153
|
let TotalTaxAmt = 0;
|
|
154
154
|
if (IsIndependentTax) {
|
|
155
155
|
PartsList.forEach((Part) => {
|
|
156
|
-
TotalTaxAmt = (0,
|
|
156
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
159
|
return TotalTaxAmt;
|
|
@@ -162,20 +162,20 @@ class DebitNoteTotalsService {
|
|
|
162
162
|
// let LaborTotalAfterDisc: any = this.GetLaborTotalAfterDiscount(LaborList);
|
|
163
163
|
let PartsTotalAfterDisc = this.GetPartsTotalAfterDiscount(PartsList);
|
|
164
164
|
if (IsIndependentTax) {
|
|
165
|
-
return (0,
|
|
165
|
+
return (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
166
166
|
}
|
|
167
167
|
else {
|
|
168
|
-
return (0,
|
|
168
|
+
return (0, math_operations_1.Subtract)(PartsTotalAfterDisc, finalTotalsData.Disc);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
static ItemsTotalAfterDiscount(PartsTotalAfterDisc, PartsTaxAmount, MainPDisc, PDiscInPerc) {
|
|
172
|
-
let ItemsTotal = (0,
|
|
172
|
+
let ItemsTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount);
|
|
173
173
|
if (!tr_utils_1.TrUtils.IsZero(MainPDisc)) {
|
|
174
174
|
if (!tr_utils_1.TrUtils.IsEmpty(PDiscInPerc)) {
|
|
175
|
-
ItemsTotal = (0,
|
|
175
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(ItemsTotal, Number(PDiscInPerc)), 100));
|
|
176
176
|
}
|
|
177
177
|
else {
|
|
178
|
-
ItemsTotal = (0,
|
|
178
|
+
ItemsTotal = (0, math_operations_1.Subtract)(ItemsTotal, MainPDisc);
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
181
|
return ItemsTotal;
|
|
@@ -187,10 +187,10 @@ class DebitNoteTotalsService {
|
|
|
187
187
|
let TotalTaxAmt = 0;
|
|
188
188
|
if (IsIndependentTax) {
|
|
189
189
|
PartsList.forEach((Part) => {
|
|
190
|
-
TotalCGSTAmt = (0,
|
|
191
|
-
TotalSGSTAmt = (0,
|
|
192
|
-
TotalIGSTAmt = (0,
|
|
193
|
-
TotalTaxAmt = (0,
|
|
190
|
+
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
|
|
191
|
+
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
|
|
192
|
+
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
|
|
193
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
194
194
|
});
|
|
195
195
|
}
|
|
196
196
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
@@ -210,7 +210,7 @@ class DebitNoteTotalsService {
|
|
|
210
210
|
Part.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[0]);
|
|
211
211
|
Part.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[1]);
|
|
212
212
|
Part.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(GSTValues[2]);
|
|
213
|
-
Part.CombinedTaxPercentage = (0,
|
|
213
|
+
Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
214
214
|
});
|
|
215
215
|
return Parts;
|
|
216
216
|
}
|
|
@@ -246,10 +246,10 @@ class DebitNoteTotalsService {
|
|
|
246
246
|
let HSN = MatchedPart[0].HSN;
|
|
247
247
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
248
248
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
249
|
-
TaxOnAmount = (0,
|
|
250
|
-
TaxAmount = (0,
|
|
251
|
-
TaxAmount = (0,
|
|
252
|
-
TaxAmount = (0,
|
|
249
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, argMatchedGSTPart.AfterPartDisc);
|
|
250
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTPart.CGST);
|
|
251
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTPart.IGST);
|
|
252
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTPart.SGST);
|
|
253
253
|
});
|
|
254
254
|
TaxInfo.HSN = HSN;
|
|
255
255
|
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvoiceprintService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
5
5
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
6
6
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
7
7
|
const my_date_1 = require("../../utils/my-date");
|
|
@@ -194,12 +194,12 @@ class InvoiceprintService {
|
|
|
194
194
|
let FinalTotal = 0;
|
|
195
195
|
Parts.forEach((part) => {
|
|
196
196
|
// console.log('part', part);
|
|
197
|
-
Qty = (0,
|
|
198
|
-
CGSTAMT = (0,
|
|
199
|
-
SGSTAMT = (0,
|
|
200
|
-
IGSTAMT = (0,
|
|
201
|
-
Taxable = (0,
|
|
202
|
-
FinalTotal = (0,
|
|
197
|
+
Qty = (0, math_operations_1.Add)(Qty, tr_utils_1.TrUtils.FixedTo(part.Qty, DecimalsNumber));
|
|
198
|
+
CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(part.CGSTAmt, DecimalsNumber));
|
|
199
|
+
SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(part.SGSTAmt, DecimalsNumber));
|
|
200
|
+
IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(part.IGSTAmt, DecimalsNumber));
|
|
201
|
+
Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(part.AfterPartDisc, DecimalsNumber));
|
|
202
|
+
FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(part.AfterPartTax, DecimalsNumber));
|
|
203
203
|
});
|
|
204
204
|
let dpartadding1 = {};
|
|
205
205
|
dpartadding1.SNo = '';
|
|
@@ -313,11 +313,11 @@ class InvoiceprintService {
|
|
|
313
313
|
Labor.forEach((operation) => {
|
|
314
314
|
// console.log('operation', operation);
|
|
315
315
|
// Qty = Qty + operation.Qty;
|
|
316
|
-
CGSTAMT = (0,
|
|
317
|
-
SGSTAMT = (0,
|
|
318
|
-
IGSTAMT = (0,
|
|
319
|
-
Taxable = (0,
|
|
320
|
-
FinalTotal = (0,
|
|
316
|
+
CGSTAMT = (0, math_operations_1.Add)(CGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.CGSTAmt, DecimalsNumber));
|
|
317
|
+
SGSTAMT = (0, math_operations_1.Add)(SGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.SGSTAmt, DecimalsNumber));
|
|
318
|
+
IGSTAMT = (0, math_operations_1.Add)(IGSTAMT, tr_utils_1.TrUtils.FixedTo(operation.IGSTAmt, DecimalsNumber));
|
|
319
|
+
Taxable = (0, math_operations_1.Add)(Taxable, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborDisc, DecimalsNumber));
|
|
320
|
+
FinalTotal = (0, math_operations_1.Add)(FinalTotal, tr_utils_1.TrUtils.FixedTo(operation.AfterLaborTax, DecimalsNumber));
|
|
321
321
|
});
|
|
322
322
|
let dpartadding1 = {};
|
|
323
323
|
dpartadding1.SNo = '';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.InvPrintService = void 0;
|
|
4
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
4
|
const code_enums_1 = require("../../enums/code-enums");
|
|
6
5
|
const enums_1 = require("../../enums/enums");
|
|
6
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
7
7
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
8
8
|
const my_date_1 = require("../../utils/my-date");
|
|
9
9
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
@@ -214,7 +214,7 @@ class InvPrintService {
|
|
|
214
214
|
else {
|
|
215
215
|
Labor.DiscPerc = Labor.Perc;
|
|
216
216
|
if (!tr_utils_1.TrUtils.IsZero(Number(Labor.UnPr))) {
|
|
217
|
-
Labor.DiscPerc = (0,
|
|
217
|
+
Labor.DiscPerc = (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(100, Labor.Disc), Labor.UnPr);
|
|
218
218
|
}
|
|
219
219
|
else {
|
|
220
220
|
Labor.DiscPerc = 0;
|
|
@@ -231,7 +231,7 @@ class InvPrintService {
|
|
|
231
231
|
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Labor.AfterLaborTax, DecimalsNumber);
|
|
232
232
|
}
|
|
233
233
|
else {
|
|
234
|
-
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
234
|
+
Labor.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Labor.Amt, Labor.Disc), DecimalsNumber);
|
|
235
235
|
}
|
|
236
236
|
});
|
|
237
237
|
return LaborList;
|
|
@@ -239,11 +239,11 @@ class InvPrintService {
|
|
|
239
239
|
static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
|
|
240
240
|
Items.forEach((Item) => {
|
|
241
241
|
if (Consolidate) {
|
|
242
|
-
let AfterDiscForEach = (0,
|
|
243
|
-
let CTaxAmtPerItem = (0,
|
|
244
|
-
let STaxAmtPerItem = (0,
|
|
245
|
-
let ITaxAmtPerItem = (0,
|
|
246
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0,
|
|
242
|
+
let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
|
|
243
|
+
let CTaxAmtPerItem = (0, math_operations_1.Divide)(Item.CGST, Item.Qty);
|
|
244
|
+
let STaxAmtPerItem = (0, math_operations_1.Divide)(Item.SGST, Item.Qty);
|
|
245
|
+
let ITaxAmtPerItem = (0, math_operations_1.Divide)(Item.IGST, Item.Qty);
|
|
246
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
247
247
|
}
|
|
248
248
|
else {
|
|
249
249
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -265,7 +265,7 @@ class InvPrintService {
|
|
|
265
265
|
else {
|
|
266
266
|
Item.DiscPerc = Item.Perc;
|
|
267
267
|
if (!tr_utils_1.TrUtils.IsZero(Number(Item.UnPr))) {
|
|
268
|
-
Item.DiscPerc = (0,
|
|
268
|
+
Item.DiscPerc = (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(100, Item.Disc), Item.UnPr);
|
|
269
269
|
}
|
|
270
270
|
else {
|
|
271
271
|
Item.DiscPerc = 0;
|
|
@@ -278,7 +278,7 @@ class InvPrintService {
|
|
|
278
278
|
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
|
|
279
279
|
}
|
|
280
280
|
else {
|
|
281
|
-
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
281
|
+
Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc), DecimalsNumber);
|
|
282
282
|
}
|
|
283
283
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
284
284
|
Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
|
|
@@ -456,7 +456,7 @@ class InvPrintService {
|
|
|
456
456
|
Data.Due = 0;
|
|
457
457
|
}
|
|
458
458
|
else {
|
|
459
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo((0,
|
|
459
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Total, PaidTotal), DecimalsNumber);
|
|
460
460
|
}
|
|
461
461
|
if (Data.Due < 0) {
|
|
462
462
|
Data.Due = 0;
|