shareneus 1.5.1 → 1.5.3
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 +8 -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/sales-receive/sales-total-calculation.js +1 -1
- 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
|
@@ -27,7 +27,7 @@ exports.ServiceAdvisorWisePartXlsxFileService = void 0;
|
|
|
27
27
|
const XLSX = __importStar(require("xlsx"));
|
|
28
28
|
const my_date_1 = require("../../../../utils/my-date");
|
|
29
29
|
const tr_utils_1 = require("../../../../utils/tr-utils");
|
|
30
|
-
const
|
|
30
|
+
const math_operations_1 = require("../../../../shared/math-operations");
|
|
31
31
|
class ServiceAdvisorWisePartXlsxFileService {
|
|
32
32
|
static GetServiceAdvisorPartsExcelData(MainData, EntitySettings) {
|
|
33
33
|
this.wb = {};
|
|
@@ -148,9 +148,9 @@ class ServiceAdvisorWisePartXlsxFileService {
|
|
|
148
148
|
static SetWorkOrderDataInExcel(WorkOrder, index, DecimalsNumber) {
|
|
149
149
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
150
150
|
WorkOrder.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(WorkOrder.CrDate);
|
|
151
|
-
WorkOrder.Discount = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
152
|
-
WorkOrder.Tax = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
153
|
-
WorkOrder.Total = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
151
|
+
WorkOrder.Discount = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull((_a = WorkOrder.Items) === null || _a === void 0 ? void 0 : _a.Disc), tr_utils_1.TrUtils.SetValueToZeroIfNull((_b = WorkOrder.Items) === null || _b === void 0 ? void 0 : _b.RecDisc)), DecimalsNumber);
|
|
152
|
+
WorkOrder.Tax = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)((_c = WorkOrder.Items) === null || _c === void 0 ? void 0 : _c.CGST, (_d = WorkOrder.Items) === null || _d === void 0 ? void 0 : _d.SGST, (_e = WorkOrder.Items) === null || _e === void 0 ? void 0 : _e.IGST), DecimalsNumber);
|
|
153
|
+
WorkOrder.Total = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)((_f = WorkOrder.Items) === null || _f === void 0 ? void 0 : _f.NetAmt, Number(WorkOrder.Tax)), DecimalsNumber);
|
|
154
154
|
// if(!TrUtils.IsNull(WorkOrder.Prod) && !TrUtils.IsNull(WorkOrder.Prod.DDate)){
|
|
155
155
|
// WorkOrder.Prod.DDate= TrUtils.ConvertDateToReadableFormat(WorkOrder.Prod.DDate);
|
|
156
156
|
// }else{
|
|
@@ -26,7 +26,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
26
26
|
exports.SummaryXlsxFileService = void 0;
|
|
27
27
|
const XLSX = __importStar(require("xlsx"));
|
|
28
28
|
const tr_utils_1 = require("../../../../utils/tr-utils");
|
|
29
|
-
const
|
|
29
|
+
const math_operations_1 = require("../../../../shared/math-operations");
|
|
30
30
|
class SummaryXlsxFileService {
|
|
31
31
|
static GetInvoiceWiseExcelData(MainData, WOTypes, EntitySettings) {
|
|
32
32
|
this.wb = {};
|
|
@@ -51,8 +51,8 @@ class SummaryXlsxFileService {
|
|
|
51
51
|
static GetTotals(MainData, WOTypes) {
|
|
52
52
|
MainData.forEach((InvoiceInfo) => {
|
|
53
53
|
InvoiceInfo.GSTAmount =
|
|
54
|
-
(0,
|
|
55
|
-
InvoiceInfo.TotalAmount = (0,
|
|
54
|
+
(0, math_operations_1.Add)(InvoiceInfo.ItemsCGST, InvoiceInfo.ItemsSGST, InvoiceInfo.ItemsIGST);
|
|
55
|
+
InvoiceInfo.TotalAmount = (0, math_operations_1.Add)(InvoiceInfo.GSTAmount, InvoiceInfo.ItemsNetAmt);
|
|
56
56
|
});
|
|
57
57
|
return MainData;
|
|
58
58
|
}
|
|
@@ -27,7 +27,7 @@ exports.SalesByServiceSummaryXlsxFileService = void 0;
|
|
|
27
27
|
const XLSX = __importStar(require("xlsx"));
|
|
28
28
|
const my_date_1 = require("../../../../utils/my-date");
|
|
29
29
|
const tr_utils_1 = require("../../../../utils/tr-utils");
|
|
30
|
-
const
|
|
30
|
+
const math_operations_1 = require("../../../../shared/math-operations");
|
|
31
31
|
class SalesByServiceSummaryXlsxFileService {
|
|
32
32
|
static GetSalesByServiceSummaryExcelData(MainData, searchValue, HeaderName, ForService, EntitySettings) {
|
|
33
33
|
this.wb = {};
|
|
@@ -338,7 +338,7 @@ class SalesByServiceSummaryXlsxFileService {
|
|
|
338
338
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Amt, DecimalsNumber), ColRange: 1, IsString: false },
|
|
339
339
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Disc, DecimalsNumber), ColRange: 1, IsString: false },
|
|
340
340
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Tax, DecimalsNumber), ColRange: 1, IsString: false },
|
|
341
|
-
{ text: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
341
|
+
{ text: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(InvoiceInfo.NetAmt, InvoiceInfo.Tax), DecimalsNumber), ColRange: 1, IsString: false },
|
|
342
342
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.AvgPr, DecimalsNumber), ColRange: 1, IsString: false },
|
|
343
343
|
// { text: InvoiceInfo.Adjust, ColRange: 1, IsString: false },
|
|
344
344
|
// { text: InvoiceInfo.Round, ColRange: 1, IsString: false },
|
|
@@ -356,7 +356,7 @@ class SalesByServiceSummaryXlsxFileService {
|
|
|
356
356
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.UnAmt, DecimalsNumber), ColRange: 1, IsString: false },
|
|
357
357
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Disc, DecimalsNumber), ColRange: 1, IsString: false },
|
|
358
358
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.Tax, DecimalsNumber), ColRange: 1, IsString: false },
|
|
359
|
-
{ text: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
359
|
+
{ text: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(InvoiceInfo.NetAmt, InvoiceInfo.Tax), DecimalsNumber), ColRange: 1, IsString: false },
|
|
360
360
|
{ text: tr_utils_1.TrUtils.FixPriceValue(InvoiceInfo.AvgPr, DecimalsNumber), ColRange: 1, IsString: false },
|
|
361
361
|
// { text: InvoiceInfo.Adjust, ColRange: 1, IsString: false },
|
|
362
362
|
// { text: InvoiceInfo.Round, ColRange: 1, IsString: false },
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ItemWiseSalesPDFService = 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 tr_utils_1 = require("../../../../utils/tr-utils");
|
|
7
7
|
class ItemWiseSalesPDFService {
|
|
@@ -116,7 +116,7 @@ class ItemWiseSalesPDFService {
|
|
|
116
116
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.UnAmt, DecimalsNumber), alignment: 'right' });
|
|
117
117
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Disc, DecimalsNumber), alignment: 'right' });
|
|
118
118
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Tax, DecimalsNumber), alignment: 'right' });
|
|
119
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
119
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(invoice.NetAmt, invoice.Tax), DecimalsNumber), alignment: 'right' });
|
|
120
120
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.AvgPr, DecimalsNumber), alignment: 'right' });
|
|
121
121
|
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
122
122
|
// }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ManfWiseSalesService = 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 tr_utils_1 = require("../../../../utils/tr-utils");
|
|
7
7
|
class ManfWiseSalesService {
|
|
@@ -118,7 +118,7 @@ class ManfWiseSalesService {
|
|
|
118
118
|
// dataRow.push({ text: TrUtils.IsNull(invoice.Prod) ? '' : invoice.Prod?.Model + ' ' + invoice.Prod?.Var });
|
|
119
119
|
// }
|
|
120
120
|
// dataRow.push({ text: invoice.BFrom.Name, alignment: 'left', style: ['headerstyle'], });
|
|
121
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
121
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(invoice.UnAmt, invoice.Tax), DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
|
|
122
122
|
// dataRow.push({ text: TrUtils.FixPriceValue(invoice.Due), alignment: 'right', style: ['headerstyle'], });
|
|
123
123
|
body.push(dataRow);
|
|
124
124
|
// if (InvoiceData.Invoices.length === (index + 1)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SalesByServiceSummaryPDF = 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 tr_utils_1 = require("../../../../utils/tr-utils");
|
|
7
7
|
class SalesByServiceSummaryPDF {
|
|
@@ -80,7 +80,7 @@ class SalesByServiceSummaryPDF {
|
|
|
80
80
|
dataRow.push({ text: ForService ? tr_utils_1.TrUtils.FixPriceValue(invoice.Amt, DecimalsNumber) : tr_utils_1.TrUtils.FixPriceValue(invoice.UnAmt, DecimalsNumber), alignment: 'right' });
|
|
81
81
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Disc, DecimalsNumber), alignment: 'right' });
|
|
82
82
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Tax, DecimalsNumber), alignment: 'right' });
|
|
83
|
-
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue((0,
|
|
83
|
+
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(invoice.NetAmt, invoice.Tax), DecimalsNumber), alignment: 'right' });
|
|
84
84
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.AvgPr, DecimalsNumber), alignment: 'right' });
|
|
85
85
|
body.push(dataRow);
|
|
86
86
|
});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppointmentTotalsService = void 0;
|
|
4
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
4
|
const enums_1 = require("../../enums/enums");
|
|
5
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
6
6
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
7
7
|
class AppointmentTotalsService {
|
|
8
8
|
static GetTotalsValue(OriRecordData, TaxCodes, detailedInfo, withItems, EntitySettings) {
|
|
@@ -115,15 +115,15 @@ class AppointmentTotalsService {
|
|
|
115
115
|
let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
116
116
|
let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData, DecimalsNumber);
|
|
117
117
|
let CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
|
|
118
|
-
argRecordData.STotal = tr_utils_1.TrUtils.FixPriceValue((0,
|
|
119
|
-
argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0,
|
|
118
|
+
argRecordData.STotal = tr_utils_1.TrUtils.FixPriceValue((0, math_operations_1.Add)(CustLaborDiscTotal, CustLaborTotalAfterDisc), DecimalsNumber);
|
|
119
|
+
argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal, DecimalsNumber));
|
|
120
120
|
argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
121
121
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), DecimalsNumber);
|
|
122
122
|
if (detailedInfo) {
|
|
123
123
|
argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
124
124
|
argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
125
125
|
}
|
|
126
|
-
argRecordData.Round = tr_utils_1.TrUtils.FixedTo((0,
|
|
126
|
+
argRecordData.Round = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
127
127
|
argRecordData.Total = Math.round(CustTotal);
|
|
128
128
|
return argRecordData;
|
|
129
129
|
}
|
|
@@ -151,24 +151,24 @@ class AppointmentTotalsService {
|
|
|
151
151
|
let SubTotalWithTax = 0;
|
|
152
152
|
let LaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(LaborList);
|
|
153
153
|
if (IsTaxable) {
|
|
154
|
-
SubTotalWithTax = (0,
|
|
154
|
+
SubTotalWithTax = (0, math_operations_1.Add)(LaborTotalAfterDisc, LaborTaxAmount);
|
|
155
155
|
}
|
|
156
156
|
else {
|
|
157
|
-
SubTotalWithTax = tr_utils_1.TrUtils.FixedTo((0,
|
|
157
|
+
SubTotalWithTax = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(LaborTotalAfterDisc - dupRecordData.LDisc, dupRecordData.Disc), DecimalsNumber);
|
|
158
158
|
}
|
|
159
159
|
return SubTotalWithTax;
|
|
160
160
|
}
|
|
161
161
|
static GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, DecimalsNumber) {
|
|
162
162
|
argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData, DecimalsNumber);
|
|
163
163
|
argRecordData.CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
|
|
164
|
-
argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0,
|
|
164
|
+
argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal), DecimalsNumber);
|
|
165
165
|
argRecordData.CustLaborITax = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
166
166
|
argRecordData.CustLaborSGST = this.GetCustLaborSGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
167
167
|
argRecordData.CustLaborCGST = this.GetCustLaborCGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
168
168
|
argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
|
|
169
169
|
argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
|
|
170
170
|
argRecordData.CustLaborAfterLDisc = argRecordData.CustLaborTotalAfterDisc;
|
|
171
|
-
argRecordData.CustLaborAfterTax = tr_utils_1.TrUtils.FixedTo((0,
|
|
171
|
+
argRecordData.CustLaborAfterTax = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(argRecordData.CustLaborITax, argRecordData.CustLaborAfterLDisc), DecimalsNumber);
|
|
172
172
|
argRecordData.CustTotalRoundedBy = argRecordData.Round;
|
|
173
173
|
argRecordData.CustRoundedTotal = argRecordData.Total;
|
|
174
174
|
for (var key in argRecordData) {
|
|
@@ -190,13 +190,13 @@ class AppointmentTotalsService {
|
|
|
190
190
|
LaborList.forEach((Labor) => {
|
|
191
191
|
LaborDiscountedTotal += Labor.CustDiscountedPrice;
|
|
192
192
|
});
|
|
193
|
-
return tr_utils_1.TrUtils.FixedTo((0,
|
|
193
|
+
return tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(LaborDiscountedTotal, overallLaborDisc), DecimalsNumber);
|
|
194
194
|
}
|
|
195
195
|
static GetCustLaborCGSTTaxTotal(opCodesList, IsTaxable) {
|
|
196
196
|
let TotalTaxAmt = 0;
|
|
197
197
|
if (IsTaxable) {
|
|
198
198
|
opCodesList.forEach((Labor) => {
|
|
199
|
-
TotalTaxAmt = (0,
|
|
199
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CCGST);
|
|
200
200
|
});
|
|
201
201
|
}
|
|
202
202
|
return TotalTaxAmt;
|
|
@@ -205,7 +205,7 @@ class AppointmentTotalsService {
|
|
|
205
205
|
let TotalTaxAmt = 0;
|
|
206
206
|
if (IsTaxable) {
|
|
207
207
|
opCodesList.forEach((Labor) => {
|
|
208
|
-
TotalTaxAmt = (0,
|
|
208
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CIGST);
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
return TotalTaxAmt;
|
|
@@ -214,7 +214,7 @@ class AppointmentTotalsService {
|
|
|
214
214
|
let TotalTaxAmt = 0;
|
|
215
215
|
if (IsTaxable) {
|
|
216
216
|
opCodesList.forEach((Labor) => {
|
|
217
|
-
TotalTaxAmt = (0,
|
|
217
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Labor.CSGST);
|
|
218
218
|
});
|
|
219
219
|
}
|
|
220
220
|
return TotalTaxAmt;
|
|
@@ -5,7 +5,7 @@ const date_fns_1 = require("date-fns");
|
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
7
7
|
const my_date_1 = require("../../utils/my-date");
|
|
8
|
-
const
|
|
8
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
9
9
|
class ConsultationFeeReceiptPrintService {
|
|
10
10
|
static GetPrint(consultationData) {
|
|
11
11
|
if (tr_utils_1.TrUtils.IsNull(consultationData.Name)) {
|
|
@@ -227,7 +227,7 @@ class ConsultationFeeReceiptPrintService {
|
|
|
227
227
|
return { text: (Settings === null || Settings === void 0 ? void 0 : Settings.Tax) === 'BS' ? 'Bill of Supply' : null, alignment: 'right', marginRight: 5, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
|
|
228
228
|
}
|
|
229
229
|
static GetDiscountOverall(consultationData, DecimalsNumber) {
|
|
230
|
-
let OveralDisc = (0,
|
|
230
|
+
let OveralDisc = (0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(consultationData.Disc)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(consultationData.CustPartsDiscTotal)));
|
|
231
231
|
return tr_utils_1.TrUtils.FixPriceValue(OveralDisc, DecimalsNumber);
|
|
232
232
|
}
|
|
233
233
|
static CustomerAndVehicleDetailsAfterLine(size) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.POTotalsService = 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 POTotalsService {
|
|
7
7
|
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, EntitySettings) {
|
|
@@ -84,7 +84,7 @@ class POTotalsService {
|
|
|
84
84
|
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, DecimalsNumber) {
|
|
85
85
|
finalTotalsData.ItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList);
|
|
86
86
|
finalTotalsData.ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
|
|
87
|
-
finalTotalsData.ItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0,
|
|
87
|
+
finalTotalsData.ItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(finalTotalsData.ItemsTotalAfterDisc, finalTotalsData.ItemsDiscTotal), DecimalsNumber);
|
|
88
88
|
finalTotalsData.ItemITax = this.GetItemsTaxTotal(ItemsList, IsIndependentTax);
|
|
89
89
|
// finalTotalsData.ItemCGST = this.GetItemCGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
90
90
|
// finalTotalsData.ItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
|
|
@@ -93,10 +93,10 @@ class POTotalsService {
|
|
|
93
93
|
finalTotalsData.ItemCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[0]);
|
|
94
94
|
finalTotalsData.ItemSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[1]);
|
|
95
95
|
finalTotalsData.ItemIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[2]);
|
|
96
|
-
finalTotalsData.ItemAfterTax = tr_utils_1.TrUtils.FixedTo((0,
|
|
97
|
-
finalTotalsData.OverAllRecordDiscount = (finalTotalsData.Perc) ? (0,
|
|
96
|
+
finalTotalsData.ItemAfterTax = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(finalTotalsData.ItemITax, finalTotalsData.ItemsTotalAfterDisc), DecimalsNumber);
|
|
97
|
+
finalTotalsData.OverAllRecordDiscount = (finalTotalsData.Perc) ? (0, math_operations_1.Divide)((0, math_operations_1.Multiply)(finalTotalsData.SubTotal, finalTotalsData.Disc), 100) : finalTotalsData.Disc;
|
|
98
98
|
finalTotalsData.TaxGroupData = this.GetItemsTaxGrouping(ItemsList, TaxCodes, DecimalsNumber);
|
|
99
|
-
finalTotalsData.TotalRoundedBy = tr_utils_1.TrUtils.FixedTo((0,
|
|
99
|
+
finalTotalsData.TotalRoundedBy = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Math.round(finalTotalsData.Total), finalTotalsData.Total), DecimalsNumber);
|
|
100
100
|
finalTotalsData.RoundedTotal = Math.round(finalTotalsData.Total);
|
|
101
101
|
for (var key in finalTotalsData) {
|
|
102
102
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
@@ -112,9 +112,9 @@ class POTotalsService {
|
|
|
112
112
|
let SGSTAmt = 0;
|
|
113
113
|
let IGSTAmt = 0;
|
|
114
114
|
ItemsList.forEach((Item) => {
|
|
115
|
-
CGSTAmt = (0,
|
|
116
|
-
SGSTAmt = (0,
|
|
117
|
-
IGSTAmt = (0,
|
|
115
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, Item.CGST);
|
|
116
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, Item.SGST);
|
|
117
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, Item.IGST);
|
|
118
118
|
});
|
|
119
119
|
return [CGSTAmt, SGSTAmt, IGSTAmt];
|
|
120
120
|
}
|
|
@@ -179,7 +179,7 @@ class POTotalsService {
|
|
|
179
179
|
Item.CGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[0]);
|
|
180
180
|
Item.SGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
181
181
|
Item.IGSTAmt = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[2]);
|
|
182
|
-
Item.CombinedTaxPercentage = (0,
|
|
182
|
+
Item.CombinedTaxPercentage = (0, math_operations_1.Add)(Item.CGSTAmt, Item.SGSTAmt, Item.IGSTAmt);
|
|
183
183
|
});
|
|
184
184
|
return Items;
|
|
185
185
|
}
|
|
@@ -225,10 +225,10 @@ class POTotalsService {
|
|
|
225
225
|
// TaxAmount += TrUtils.FixedTo(argMatchedGSTItem.CCGST);
|
|
226
226
|
// TaxAmount += TrUtils.FixedTo(argMatchedGSTItem.CIGST);
|
|
227
227
|
// TaxAmount += TrUtils.FixedTo(argMatchedGSTItem.CSGST);
|
|
228
|
-
TaxOnAmount = (0,
|
|
229
|
-
TaxAmount = (0,
|
|
230
|
-
TaxAmount = (0,
|
|
231
|
-
TaxAmount = (0,
|
|
228
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, argMatchedGSTItem.AfterItemDisc);
|
|
229
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.CGST);
|
|
230
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.IGST);
|
|
231
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, argMatchedGSTItem.SGST);
|
|
232
232
|
});
|
|
233
233
|
TaxInfo.HSN = HSN;
|
|
234
234
|
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
@@ -5,7 +5,7 @@ export declare class PurchaseOrderTotalsService {
|
|
|
5
5
|
static ResetLaborValueIfInvalid(Operation: any): any;
|
|
6
6
|
static CheckPartStatusAndReturn(PartsList: any): any;
|
|
7
7
|
static ResetPartValueIfInvalid(Part: any): any;
|
|
8
|
-
static GetPartDiscountedPrice(Disc: any, RecDisc: any):
|
|
8
|
+
static GetPartDiscountedPrice(Disc: any, RecDisc: any): number;
|
|
9
9
|
static GetPartsTaxAmount(Items: any, IsTaxable: boolean, TaxCodes: any, DecimalsNumber: number): any;
|
|
10
10
|
static GetGSTValueBasedOnTaxCode(TCode: any, argTaxCodes: any): any[];
|
|
11
11
|
static GetTotalsInfo(PartsList: any, LaborList: any, IsTaxable: boolean, TaxCodes: any, HasNoTax: boolean, GetSubTotal: boolean, Discount: number, DiscInPerc: boolean, Adjust: number, DecimalsNumber: number): any;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PurchaseOrderTotalsService = void 0;
|
|
4
|
-
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
4
|
const code_enums_1 = require("../../enums/code-enums");
|
|
5
|
+
const math_operations_1 = require("../../shared/math-operations");
|
|
6
6
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
7
7
|
class PurchaseOrderTotalsService {
|
|
8
8
|
static GetTotalsValue(opCodesList, argPartsList, IsTaxable, DetailedTotalsInfo, TaxCodes, Tax, ReturnPartsAlso, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, EntitySettings) {
|
|
@@ -36,27 +36,27 @@ class PurchaseOrderTotalsService {
|
|
|
36
36
|
static ResetLaborValues(opCodesList, IsIndependentTax, DecimalsNumber) {
|
|
37
37
|
opCodesList.forEach((Operation) => {
|
|
38
38
|
Operation = this.ResetLaborValueIfInvalid(Operation);
|
|
39
|
-
Operation.DiscountedPrice = (0,
|
|
39
|
+
Operation.DiscountedPrice = (0, math_operations_1.Add)(Operation.Disc, Operation.RecDisc);
|
|
40
40
|
if (tr_utils_1.TrUtils.IsNull(Operation.Amt)) {
|
|
41
41
|
Operation.Amt = Operation.UnCo;
|
|
42
42
|
}
|
|
43
|
-
Operation.GSTAmt = (0,
|
|
43
|
+
Operation.GSTAmt = (0, math_operations_1.Add)(Operation.SGST, Operation.CGST, Operation.IGST);
|
|
44
44
|
if (IsIndependentTax) {
|
|
45
|
-
let NetAmt = (0,
|
|
45
|
+
let NetAmt = (0, math_operations_1.Subtract)(Operation.Amt, Operation.Disc, Operation.RecDisc);
|
|
46
46
|
Operation.AfterLaborDisc = NetAmt;
|
|
47
|
-
Operation.AfterLaborTax = (0,
|
|
47
|
+
Operation.AfterLaborTax = (0, math_operations_1.Add)(Operation.AfterLaborDisc, Operation.CGST, Operation.SGST, Operation.IGST);
|
|
48
48
|
}
|
|
49
49
|
else {
|
|
50
|
-
Operation.AfterLaborDisc = (0,
|
|
50
|
+
Operation.AfterLaborDisc = (0, math_operations_1.Subtract)(Operation.Amt, Operation.Disc);
|
|
51
51
|
Operation.AfterLaborTax = Operation.AfterLaborDisc;
|
|
52
52
|
}
|
|
53
53
|
let Price = 0;
|
|
54
|
-
Price = (0,
|
|
54
|
+
Price = (0, math_operations_1.Multiply)(Operation.UnCo, Operation.Qty);
|
|
55
55
|
if (IsIndependentTax) {
|
|
56
|
-
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0,
|
|
56
|
+
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)((0, math_operations_1.Subtract)(Price, Operation.Disc), Operation.GSTAmt), DecimalsNumber);
|
|
57
57
|
}
|
|
58
58
|
else {
|
|
59
|
-
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0,
|
|
59
|
+
Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Price, Operation.Disc), DecimalsNumber);
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
return opCodesList;
|
|
@@ -93,7 +93,7 @@ class PurchaseOrderTotalsService {
|
|
|
93
93
|
// if (DiscInPerc) {
|
|
94
94
|
// return TrUtils.FixedTo(((Price * Qty) * Disc) / 100);
|
|
95
95
|
// } else {
|
|
96
|
-
return (0,
|
|
96
|
+
return (0, math_operations_1.Add)(Disc, tr_utils_1.TrUtils.SetValueToZeroIfNull(RecDisc));
|
|
97
97
|
// }
|
|
98
98
|
}
|
|
99
99
|
static GetPartsTaxAmount(Items, IsTaxable, TaxCodes, DecimalsNumber) {
|
|
@@ -105,15 +105,15 @@ class PurchaseOrderTotalsService {
|
|
|
105
105
|
if (tr_utils_1.TrUtils.IsNull(Part.Ind)) {
|
|
106
106
|
Part.DiscountedPrice = this.GetPartDiscountedPrice(Part.Disc, Part.RecDisc);
|
|
107
107
|
// Part.AfterDiscountPrice = Part.NetAmt;
|
|
108
|
-
Part.AfterDiscountPrice = (0,
|
|
108
|
+
Part.AfterDiscountPrice = (0, math_operations_1.Subtract)(Part.UnAmt, Part.Disc, Part.RecDisc);
|
|
109
109
|
}
|
|
110
|
-
Part.GSTAmt = (0,
|
|
110
|
+
Part.GSTAmt = (0, math_operations_1.Add)(Part.SGST, Part.CGST, Part.IGST);
|
|
111
111
|
Part.Desc = Part.Name;
|
|
112
112
|
let Price = 0;
|
|
113
113
|
if (IsTaxable) {
|
|
114
114
|
// if (!TrUtils(Part.Perc)) {
|
|
115
|
-
Price = (0,
|
|
116
|
-
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0,
|
|
115
|
+
Price = (0, math_operations_1.Multiply)(Part.UnCo, Part.Qty);
|
|
116
|
+
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)((0, math_operations_1.Subtract)(Price, Part.Disc), Part.GSTAmt), DecimalsNumber);
|
|
117
117
|
// } else {
|
|
118
118
|
// Part.LineTotal = TrUtils.FixedTo((Part.UnPr - Part.Disc) + Part.GSTAmt);
|
|
119
119
|
// }
|
|
@@ -121,13 +121,13 @@ class PurchaseOrderTotalsService {
|
|
|
121
121
|
else {
|
|
122
122
|
// let DiscPrice: any = 0;
|
|
123
123
|
// if (Part.Perc) {
|
|
124
|
-
Price = (0,
|
|
125
|
-
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0,
|
|
124
|
+
Price = (0, math_operations_1.Multiply)(Part.UnCo, Part.Qty);
|
|
125
|
+
Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Subtract)(Price, Part.Disc), DecimalsNumber);
|
|
126
126
|
// } else {
|
|
127
127
|
// Part.LineTotal = TrUtils.FixedTo((Part.UnPr - Part.Disc));
|
|
128
128
|
// }
|
|
129
129
|
}
|
|
130
|
-
Part.AfterTax = (0,
|
|
130
|
+
Part.AfterTax = (0, math_operations_1.Add)(Part.AfterDiscountPrice, Part.GSTAmt);
|
|
131
131
|
});
|
|
132
132
|
return Items;
|
|
133
133
|
}
|
|
@@ -166,7 +166,7 @@ class PurchaseOrderTotalsService {
|
|
|
166
166
|
let ServicesTotalAfterDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[0]);
|
|
167
167
|
let ServicesDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[1]);
|
|
168
168
|
let ServicesTaxTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[2]);
|
|
169
|
-
finalTotalsData.SubTotal = (0,
|
|
169
|
+
finalTotalsData.SubTotal = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsDiscTotal, ServicesTotalAfterDisc, ServicesDiscTotal);
|
|
170
170
|
finalTotalsData.Adj = tr_utils_1.TrUtils.FixPriceValue(Adjust, DecimalsNumber);
|
|
171
171
|
// if (GetSubTotal) {
|
|
172
172
|
// finalTotalsData.SubTotal = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal,
|
|
@@ -193,9 +193,9 @@ class PurchaseOrderTotalsService {
|
|
|
193
193
|
let ServicesDiscountedTotal = 0;
|
|
194
194
|
let TotalTaxAmt = 0;
|
|
195
195
|
LaborList.forEach((Part) => {
|
|
196
|
-
ServicesTotalAfterDisc = (0,
|
|
197
|
-
ServicesDiscountedTotal = (0,
|
|
198
|
-
TotalTaxAmt = (0,
|
|
196
|
+
ServicesTotalAfterDisc = (0, math_operations_1.Add)(ServicesTotalAfterDisc, Part.AfterLaborDisc);
|
|
197
|
+
ServicesDiscountedTotal = (0, math_operations_1.Add)(ServicesDiscountedTotal, Part.DiscountedPrice);
|
|
198
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.GSTAmt);
|
|
199
199
|
});
|
|
200
200
|
return [ServicesTotalAfterDisc, ServicesDiscountedTotal, TotalTaxAmt];
|
|
201
201
|
}
|
|
@@ -204,21 +204,21 @@ class PurchaseOrderTotalsService {
|
|
|
204
204
|
let PartsDiscountedTotal = 0;
|
|
205
205
|
let TotalTaxAmt = 0;
|
|
206
206
|
PartsList.forEach((Part) => {
|
|
207
|
-
PartsTotalAfterDisc = (0,
|
|
208
|
-
PartsDiscountedTotal = (0,
|
|
209
|
-
TotalTaxAmt = (0,
|
|
207
|
+
PartsTotalAfterDisc = (0, math_operations_1.Add)(PartsTotalAfterDisc, Part.AfterDiscountPrice);
|
|
208
|
+
PartsDiscountedTotal = (0, math_operations_1.Add)(PartsDiscountedTotal, Part.DiscountedPrice);
|
|
209
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.GSTAmt);
|
|
210
210
|
});
|
|
211
211
|
return [PartsTotalAfterDisc, PartsDiscountedTotal, TotalTaxAmt];
|
|
212
212
|
}
|
|
213
213
|
static GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust, DecimalsNumber) {
|
|
214
214
|
let Total = 0;
|
|
215
215
|
if (IsTaxable) {
|
|
216
|
-
Total = (0,
|
|
216
|
+
Total = (0, math_operations_1.Add)(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal);
|
|
217
217
|
}
|
|
218
218
|
else {
|
|
219
|
-
Total = (0,
|
|
219
|
+
Total = (0, math_operations_1.Add)(PartsTotalAfterDisc, ServicesTotalAfterDisc);
|
|
220
220
|
}
|
|
221
|
-
let finalTotal = (0,
|
|
221
|
+
let finalTotal = (0, math_operations_1.Add)(Total, tr_utils_1.TrUtils.SetValueToZeroIfNull(Adjust));
|
|
222
222
|
return tr_utils_1.TrUtils.FixedTo(finalTotal, DecimalsNumber);
|
|
223
223
|
}
|
|
224
224
|
static GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, LaborList, TaxCodes, Tax, HasNoTax, DecimalsNumber) {
|
|
@@ -226,13 +226,13 @@ class PurchaseOrderTotalsService {
|
|
|
226
226
|
let ServicesInfo = this.GetServiceTotalTaxAndAfterDiscount(LaborList);
|
|
227
227
|
finalTotalsData.PartsDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[1]);
|
|
228
228
|
finalTotalsData.PartsTotalAfterDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[0]);
|
|
229
|
-
finalTotalsData.PartsTotalBeforeDisc = (0,
|
|
229
|
+
finalTotalsData.PartsTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.PartsTotalAfterDisc, finalTotalsData.PartsDiscTotal);
|
|
230
230
|
// finalTotalsData.TaxTotal = this.GetPartsTaxTotal(PartsList);
|
|
231
|
-
finalTotalsData.TaxTotal = (0,
|
|
231
|
+
finalTotalsData.TaxTotal = (0, math_operations_1.Add)(tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[2]), tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[2]));
|
|
232
232
|
finalTotalsData.ServiceTotalAfterDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[0]);
|
|
233
233
|
finalTotalsData.ServiceDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[1]);
|
|
234
234
|
finalTotalsData.ServiceTaxTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[2]);
|
|
235
|
-
finalTotalsData.ServiceTotalBeforeDisc = (0,
|
|
235
|
+
finalTotalsData.ServiceTotalBeforeDisc = (0, math_operations_1.Add)(finalTotalsData.ServiceTotalAfterDisc, finalTotalsData.ServiceDiscTotal);
|
|
236
236
|
let TaxAmt = this.GetPartGSTTaxTotal(PartsList);
|
|
237
237
|
// finalTotalsData.PartCGST = this.GetPartCGSTTaxTotal(PartsList);
|
|
238
238
|
// finalTotalsData.PartIGST = this.GetPartIGSTTaxTotal(PartsList);
|
|
@@ -244,8 +244,8 @@ class PurchaseOrderTotalsService {
|
|
|
244
244
|
finalTotalsData.ServieCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[0]);
|
|
245
245
|
finalTotalsData.ServieSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[1]);
|
|
246
246
|
finalTotalsData.ServieIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[2]);
|
|
247
|
-
finalTotalsData.PartAfterTax = (0,
|
|
248
|
-
finalTotalsData.ServiceAfterTax = (0,
|
|
247
|
+
finalTotalsData.PartAfterTax = (0, math_operations_1.Add)(finalTotalsData.PartsTotalAfterDisc, finalTotalsData.TaxTotal);
|
|
248
|
+
finalTotalsData.ServiceAfterTax = (0, math_operations_1.Add)(finalTotalsData.ServiceTotalAfterDisc, finalTotalsData.ServiceTaxTotal);
|
|
249
249
|
finalTotalsData.IsTaxable = IsTaxable;
|
|
250
250
|
finalTotalsData.Tax = Tax;
|
|
251
251
|
finalTotalsData.HasNoTax = HasNoTax;
|
|
@@ -271,14 +271,14 @@ class PurchaseOrderTotalsService {
|
|
|
271
271
|
combined.forEach(item => {
|
|
272
272
|
if (groupedMap.has(item.CombinedTaxPercentage)) {
|
|
273
273
|
const existing = groupedMap.get(item.CombinedTaxPercentage);
|
|
274
|
-
existing.CGSTAmt = (0,
|
|
275
|
-
existing.SGSTAmt = (0,
|
|
274
|
+
existing.CGSTAmt = (0, math_operations_1.Add)(existing.CGSTAmt, item.CGSTAmt);
|
|
275
|
+
existing.SGSTAmt = (0, math_operations_1.Add)(existing.SGSTAmt, item.SGSTAmt);
|
|
276
276
|
// Sum IGST if present
|
|
277
277
|
if (item.IGSTAmt !== undefined) {
|
|
278
|
-
existing.IGSTAmt = (0,
|
|
278
|
+
existing.IGSTAmt = (0, math_operations_1.Add)(existing.IGSTAmt || 0, item.IGSTAmt);
|
|
279
279
|
}
|
|
280
|
-
existing.TotalTaxAmount = (0,
|
|
281
|
-
existing.TotalTaxableAmount = (0,
|
|
280
|
+
existing.TotalTaxAmount = (0, math_operations_1.Add)(existing.TotalTaxAmount || 0, item.TotalTaxAmount || 0);
|
|
281
|
+
existing.TotalTaxableAmount = (0, math_operations_1.Add)(existing.TotalTaxableAmount || 0, item.TotalTaxableAmount || 0);
|
|
282
282
|
}
|
|
283
283
|
else {
|
|
284
284
|
// Clone the object to avoid mutation
|
|
@@ -311,13 +311,13 @@ class PurchaseOrderTotalsService {
|
|
|
311
311
|
let SAC = MatchedLabor[0].SAC;
|
|
312
312
|
TaxInfo.CombinedTaxPercentage = MatchedLabor[0].CombinedTaxPercentage;
|
|
313
313
|
MatchedLabor === null || MatchedLabor === void 0 ? void 0 : MatchedLabor.forEach((argMatchedGSTLabor) => {
|
|
314
|
-
TaxOnAmount = (0,
|
|
315
|
-
TaxAmount = (0,
|
|
316
|
-
TaxAmount = (0,
|
|
317
|
-
TaxAmount = (0,
|
|
318
|
-
CGSTAmt = (0,
|
|
319
|
-
SGSTAmt = (0,
|
|
320
|
-
IGSTAmt = (0,
|
|
314
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.AfterLaborDisc, DecimalsNumber));
|
|
315
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.CGST, DecimalsNumber));
|
|
316
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.IGST, DecimalsNumber));
|
|
317
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.SGST, DecimalsNumber));
|
|
318
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.CGST, DecimalsNumber));
|
|
319
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.SGST, DecimalsNumber));
|
|
320
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTLabor.IGST, DecimalsNumber));
|
|
321
321
|
});
|
|
322
322
|
TaxInfo.SAC = SAC;
|
|
323
323
|
TaxInfo.CGSTAmt = CGSTAmt;
|
|
@@ -403,9 +403,9 @@ class PurchaseOrderTotalsService {
|
|
|
403
403
|
let SGSTAmt = 0;
|
|
404
404
|
let IGSTAmt = 0;
|
|
405
405
|
PartsList.forEach((Part) => {
|
|
406
|
-
CGSTAmt = (0,
|
|
407
|
-
SGSTAmt = (0,
|
|
408
|
-
IGSTAmt = (0,
|
|
406
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, Part.CGST);
|
|
407
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, Part.SGST);
|
|
408
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, Part.IGST);
|
|
409
409
|
});
|
|
410
410
|
return [CGSTAmt, SGSTAmt, IGSTAmt];
|
|
411
411
|
}
|
|
@@ -414,9 +414,9 @@ class PurchaseOrderTotalsService {
|
|
|
414
414
|
let SGSTAmt = 0;
|
|
415
415
|
let IGSTAmt = 0;
|
|
416
416
|
ServicesList.forEach((labor) => {
|
|
417
|
-
CGSTAmt = (0,
|
|
418
|
-
SGSTAmt = (0,
|
|
419
|
-
IGSTAmt = (0,
|
|
417
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, labor.CGST);
|
|
418
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, labor.SGST);
|
|
419
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, labor.IGST);
|
|
420
420
|
});
|
|
421
421
|
return [CGSTAmt, SGSTAmt, IGSTAmt];
|
|
422
422
|
}
|
|
@@ -441,7 +441,7 @@ class PurchaseOrderTotalsService {
|
|
|
441
441
|
// Part.CGSTAmt = this.GetCGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
442
442
|
// Part.SGSTAmt = this.GetSGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
443
443
|
// Part.IGSTAmt = this.GetIGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
444
|
-
Part.CombinedTaxPercentage = (0,
|
|
444
|
+
Part.CombinedTaxPercentage = (0, math_operations_1.Add)(Part.CGSTAmt, Part.SGSTAmt, Part.IGSTAmt);
|
|
445
445
|
});
|
|
446
446
|
return Items;
|
|
447
447
|
}
|
|
@@ -486,13 +486,13 @@ class PurchaseOrderTotalsService {
|
|
|
486
486
|
let HSN = MatchedPart[0].HSN;
|
|
487
487
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
488
488
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
489
|
-
TaxOnAmount = (0,
|
|
490
|
-
TaxAmount = (0,
|
|
491
|
-
TaxAmount = (0,
|
|
492
|
-
TaxAmount = (0,
|
|
493
|
-
CGSTAmt = (0,
|
|
494
|
-
SGSTAmt = (0,
|
|
495
|
-
IGSTAmt = (0,
|
|
489
|
+
TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterDiscountPrice, DecimalsNumber));
|
|
490
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
491
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
492
|
+
TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
493
|
+
CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
494
|
+
SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
495
|
+
IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
496
496
|
});
|
|
497
497
|
TaxInfo.HSN = HSN;
|
|
498
498
|
TaxInfo.CGSTAmt = CGSTAmt;
|
|
@@ -12,7 +12,7 @@ export declare class VendorCreditNoteTotalsService {
|
|
|
12
12
|
static GetItemDiscountedTotal(ItemsList: any, isTaxable: boolean, finalTotalsData: any, DecimalsNumber: number): number;
|
|
13
13
|
static GetLaborTaxTotalFor(opCodesList: any, IsIndependentTax: boolean): any;
|
|
14
14
|
static GetItemsTaxTotalFor(ItemsList: any, IsIndependentTax: boolean): any;
|
|
15
|
-
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, ItemsTaxAmount: number, LaborList: any, ItemsList: any, IsIndependentTax: boolean, DecimalsNumber: number):
|
|
15
|
+
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, ItemsTaxAmount: number, LaborList: any, ItemsList: any, IsIndependentTax: boolean, DecimalsNumber: number): number;
|
|
16
16
|
static LaborTotalAfterDiscount(LaborTotalAfterDisc: number, LaborTaxAmount: number, MainLDisc: number, LDiscInPerc: string): number;
|
|
17
17
|
static ItemsTotalAfterDiscount(ItemsTotalAfterDisc: number, ItemsTaxAmount: number, MainPDisc: number, PDiscInPerc: string): number;
|
|
18
18
|
static GetItemGSTTaxTotal(ItemsList: any, IsIndependentTax: boolean): number[];
|