shareneus 1.4.49 → 1.4.51
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/auto-sales-receipt-pdf.service.js +1 -1
- package/dist/accounting/counter-sales/sales-receipt-pdf.service.js +1 -1
- package/dist/accounting/counter-sales/sales-receipt-print.service.js +1 -1
- package/dist/accounting/credit-note/credit-note-pdf.service.js +1 -1
- package/dist/accounting/debit-note/debit-note-print.service.js +1 -1
- package/dist/accounting/invoice/inv-pdf.service.js +13 -12
- package/dist/accounting/invoice/inv-print.service.js +6 -6
- package/dist/accounting/invoice/invoice-landscape-pdf.service.d.ts +1 -1
- package/dist/accounting/invoice/invoice-landscape-pdf.service.js +7 -6
- package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +13 -12
- package/dist/accounting/invoice/invoice-portrait-pdf.d.ts +5 -5
- package/dist/accounting/invoice/invoice-portrait-pdf.js +31 -30
- package/dist/accounting/invoice/invoice-total.service.js +1 -1
- 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/reports/excel/sa-wise-labor-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +12 -11
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +12 -11
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +11 -10
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +19 -18
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +11 -11
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +11 -11
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.d.ts +3 -3
- package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +13 -12
- package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +14 -13
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +15 -14
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +15 -14
- package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +10 -10
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +15 -14
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +13 -12
- package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +14 -14
- package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +14 -14
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +14 -13
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +8 -8
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.d.ts +4 -4
- package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +12 -11
- package/dist/accounting/invoice/shared-inv-pdf.service.js +1 -1
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.d.ts +4 -4
- package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +9 -9
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.d.ts +5 -5
- package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +11 -11
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +3 -3
- package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +10 -10
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +3 -3
- package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +7 -7
- package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +1 -1
- package/dist/appointments/consultations/consultation-fee-receipt.service.js +4 -4
- 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 +33 -33
- 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/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +2 -2
- package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.js +8 -7
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.d.ts +4 -4
- package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +9 -9
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.d.ts +4 -4
- package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +9 -9
- 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/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +3 -3
- package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +8 -8
- package/dist/purchases/purchase-order/purchase-order-pdf.service.js +5 -5
- package/dist/purchases/purchase-order/purchase-order-print.service.d.ts +2 -2
- package/dist/purchases/purchase-order/purchase-order-print.service.js +25 -25
- package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.js +1 -1
- 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-pdf.service.js +1 -1
- 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/dc-landscape-pdf.service.d.ts +1 -1
- package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +7 -6
- package/dist/sales/delivery-challan/delivery-challan-print.service.js +2 -2
- 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-pdf.service.js +1 -1
- package/dist/sales/sales/sales-print.service.js +7 -7
- 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.js +1 -1
- 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/reports/pdf/repair-orders-pdf.service.d.ts +4 -4
- package/dist/services/reports/pdf/repair-orders-pdf.service.js +9 -9
- package/dist/services/ro-pdf.service.js +2 -2
- package/dist/services/ro-print-service.js +1 -1
- package/dist/services/ro-totals.service.d.ts +11 -11
- package/dist/services/ro-totals.service.js +50 -50
- package/dist/services/separate-wo-print.service.js +1 -1
- package/dist/shared/shared-pdf.service.d.ts +3 -3
- package/dist/shared/shared-pdf.service.js +31 -30
- package/dist/utils/tr-utils.d.ts +1 -1
- package/dist/utils/tr-utils.js +3 -2
- package/package.json +1 -1
|
@@ -547,7 +547,7 @@ class VendorDebitNotePdfService {
|
|
|
547
547
|
static CommonTotalDetails(ROPrintData, moreDiscDetails) {
|
|
548
548
|
let CommonDetails = [
|
|
549
549
|
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, moreDiscDetails),
|
|
550
|
-
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
|
|
550
|
+
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
|
|
551
551
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
552
552
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
553
553
|
shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
|
|
@@ -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];
|
|
@@ -398,7 +398,7 @@ export declare class DCLandscapePdfService {
|
|
|
398
398
|
text: string[];
|
|
399
399
|
marginLeft: number;
|
|
400
400
|
};
|
|
401
|
-
static TotalDetails(ROPrintData: any, moreDiscDetails: boolean): {
|
|
401
|
+
static TotalDetails(ROPrintData: any, moreDiscDetails: boolean, DecimalsNumber: number): {
|
|
402
402
|
style: string;
|
|
403
403
|
marginTop: number;
|
|
404
404
|
table: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DCLandscapePdfService = void 0;
|
|
4
|
+
const aggregation_1 = require("../../aggregation/aggregation");
|
|
4
5
|
const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
|
|
5
6
|
const shared_print_service_1 = require("../../shared/shared-print.service");
|
|
6
7
|
const my_date_1 = require("../../utils/my-date");
|
|
@@ -809,7 +810,7 @@ class DCLandscapePdfService {
|
|
|
809
810
|
// ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn,
|
|
810
811
|
// TrUtils.isTaxable(ROPrintData.Settings.Tax), '0.00',
|
|
811
812
|
// ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, null),
|
|
812
|
-
this.TotalDetails(ROPrintData, moreDiscDetails),
|
|
813
|
+
this.TotalDetails(ROPrintData, moreDiscDetails, ROPrintData.Entity.DecimalsNumber),
|
|
813
814
|
// SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts),
|
|
814
815
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
815
816
|
// SharedPDFService.GetUnderLine(),
|
|
@@ -851,16 +852,16 @@ class DCLandscapePdfService {
|
|
|
851
852
|
text: ['Customer Signature'], marginLeft: 90
|
|
852
853
|
};
|
|
853
854
|
}
|
|
854
|
-
static TotalDetails(ROPrintData, moreDiscDetails) {
|
|
855
|
+
static TotalDetails(ROPrintData, moreDiscDetails, DecimalsNumber) {
|
|
855
856
|
let totalDisc;
|
|
856
857
|
let totalTax;
|
|
857
858
|
if (!ROPrintData.Consolidate) {
|
|
858
|
-
totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(0)
|
|
859
|
+
totalTax = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(0), Number(ROPrintData.CustPartITax)), DecimalsNumber);
|
|
859
860
|
if (tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax)) {
|
|
860
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(0)
|
|
861
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(0), Number(ROPrintData.CustPartsDiscTotal)), DecimalsNumber);
|
|
861
862
|
}
|
|
862
863
|
else {
|
|
863
|
-
totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(0)
|
|
864
|
+
totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(0), Number(ROPrintData.CustPartsDiscTotal), Number(ROPrintData.FixedDisc)), DecimalsNumber);
|
|
864
865
|
}
|
|
865
866
|
}
|
|
866
867
|
return [
|
|
@@ -878,7 +879,7 @@ class DCLandscapePdfService {
|
|
|
878
879
|
// ROPrintData.ShowTaxColumn, ROPrintData.From),
|
|
879
880
|
shared_pdf_service_1.SharedPDFService.GetBankDetials(ROPrintData.Entity.Bank, ROPrintData.Entity.PrBank),
|
|
880
881
|
{
|
|
881
|
-
columns: [{ text: '', width: moreDiscDetails ? 140 : 175 }, shared_pdf_service_1.SharedPDFService.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, null, moreDiscDetails)]
|
|
882
|
+
columns: [{ text: '', width: moreDiscDetails ? 140 : 175 }, shared_pdf_service_1.SharedPDFService.GrandTotal(ROPrintData, '0.00', ROPrintData.CustPartsTotalBeforeDisc, totalDisc, totalTax, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, null, ROPrintData.Consolidate, null, moreDiscDetails, ROPrintData.Entity.DecimalsNumber)],
|
|
882
883
|
}
|
|
883
884
|
// SharedPDFService.GetCustomer(ROPrintData.Customer, ROPrintData.Type, ROPrintData.For,
|
|
884
885
|
// ROPrintData.Product, ROPrintData.Settings, 'Customer Name & Address', false)
|
|
@@ -27,7 +27,7 @@ class DeliveryChallanPrintService {
|
|
|
27
27
|
InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
|
|
28
28
|
InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
|
|
29
29
|
let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
|
|
30
|
-
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);
|
|
31
31
|
if (ConsolidateGST) {
|
|
32
32
|
finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
|
|
33
33
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
|
|
@@ -83,7 +83,7 @@ class DeliveryChallanPrintService {
|
|
|
83
83
|
let CTaxAmtPerItem = Item.CGST / Item.Qty;
|
|
84
84
|
let STaxAmtPerItem = Item.SGST / Item.Qty;
|
|
85
85
|
let ITaxAmtPerItem = Item.IGST / Item.Qty;
|
|
86
|
-
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((AfterDiscForEach
|
|
86
|
+
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
89
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -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
|
}
|
|
@@ -4,15 +4,15 @@ exports.DeliveryChallanTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class DeliveryChallanTotalsService {
|
|
7
|
-
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable) {
|
|
7
|
+
static GetTotalsValue(PartsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
10
10
|
// LDisc = TrUtils.SetValueToZeroIfNull(LDisc);
|
|
11
11
|
Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Disc);
|
|
12
12
|
PartsList = this.CalculateLaborPartValues(PartsList, IsIndependentTax);
|
|
13
|
-
let finalTotalsData = this.GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable);
|
|
13
|
+
let finalTotalsData = this.GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable, EntitySettings.DecimalsNumber);
|
|
14
14
|
if (DetailedInfo) {
|
|
15
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes);
|
|
15
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes, EntitySettings.DecimalsNumber);
|
|
16
16
|
}
|
|
17
17
|
if (WithItems) {
|
|
18
18
|
finalTotalsData.Items = PartsList;
|
|
@@ -50,11 +50,11 @@ class DeliveryChallanTotalsService {
|
|
|
50
50
|
Part.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Part.IGST);
|
|
51
51
|
return Part;
|
|
52
52
|
}
|
|
53
|
-
static GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable) {
|
|
53
|
+
static GetFinalChallanDataForSave(PartsList, IsIndependentTax, Disc, Perc, DetailedInfo, Settings, isRoundable, DecimalsNumber) {
|
|
54
54
|
let finalTotalsData = {};
|
|
55
55
|
finalTotalsData = this.SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo);
|
|
56
56
|
finalTotalsData.Settings = Settings;
|
|
57
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable);
|
|
57
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber);
|
|
58
58
|
return finalTotalsData;
|
|
59
59
|
}
|
|
60
60
|
static SetMainDiscountValues(Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -65,7 +65,7 @@ class DeliveryChallanTotalsService {
|
|
|
65
65
|
}
|
|
66
66
|
return finalTotalsData;
|
|
67
67
|
}
|
|
68
|
-
static GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable) {
|
|
68
|
+
static GetFinalCustomerTotalsData(finalTotalsData, PartsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber) {
|
|
69
69
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(PartsList);
|
|
70
70
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
71
71
|
let CustPartTaxTotal = this.GetPartsTaxTotalFor(PartsList, IsIndependentTax);
|
|
@@ -75,15 +75,15 @@ class DeliveryChallanTotalsService {
|
|
|
75
75
|
let CustTotal = this.GetCustomerTotalBasedOnTaxType(CustPartTaxTotal, PartsList, IsIndependentTax);
|
|
76
76
|
// console.log('CustTotal', CustTotal);
|
|
77
77
|
if (isRoundable) {
|
|
78
|
-
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo(Math.round(CustTotal)
|
|
78
|
+
finalTotalsData.Round = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal), DecimalsNumber);
|
|
79
79
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
|
-
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
82
|
+
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
83
83
|
}
|
|
84
84
|
if (DetailedInfo) {
|
|
85
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
86
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
85
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
86
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
return finalTotalsData;
|
|
89
89
|
}
|
|
@@ -100,7 +100,7 @@ class DeliveryChallanTotalsService {
|
|
|
100
100
|
});
|
|
101
101
|
return PartsTotalAfterDisc;
|
|
102
102
|
}
|
|
103
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes) {
|
|
103
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, PartsList, TaxCodes, DecimalsNumber) {
|
|
104
104
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList);
|
|
105
105
|
finalTotalsData.CustPartsDiscTotal = this.GetPartDiscountedTotal(PartsList);
|
|
106
106
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -122,15 +122,15 @@ class DeliveryChallanTotalsService {
|
|
|
122
122
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
123
123
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
124
124
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
125
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes);
|
|
126
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
127
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
125
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
126
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
127
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
128
128
|
for (var key in finalTotalsData) {
|
|
129
129
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
130
130
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
131
131
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
132
132
|
&& typeof finalTotalsData[key] === 'number') {
|
|
133
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
133
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
return finalTotalsData;
|
|
@@ -234,11 +234,11 @@ class DeliveryChallanTotalsService {
|
|
|
234
234
|
}
|
|
235
235
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
236
236
|
}
|
|
237
|
-
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes) {
|
|
237
|
+
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes, DecimalsNumber) {
|
|
238
238
|
Parts = this.GetCombinedTaxPercentage(Parts, TaxCodes);
|
|
239
239
|
// Parts = this.ResetPartsHSNIfInvalid(Parts);
|
|
240
240
|
let FinalMatchedParts = this.ComparePartsByHSN(Parts, TaxCodes);
|
|
241
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes);
|
|
241
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
|
|
242
242
|
}
|
|
243
243
|
static GetCombinedTaxPercentage(Parts, TaxCodes) {
|
|
244
244
|
Parts.forEach((Part) => {
|
|
@@ -284,7 +284,7 @@ class DeliveryChallanTotalsService {
|
|
|
284
284
|
});
|
|
285
285
|
return FinalMatchedParts;
|
|
286
286
|
}
|
|
287
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes) {
|
|
287
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber) {
|
|
288
288
|
let HSNTaxInfo = [];
|
|
289
289
|
FinalMatchedParts.forEach((MatchedPart) => {
|
|
290
290
|
let TaxInfo = {};
|
|
@@ -299,8 +299,8 @@ class DeliveryChallanTotalsService {
|
|
|
299
299
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
300
300
|
});
|
|
301
301
|
TaxInfo.HSN = HSN;
|
|
302
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
303
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
302
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
303
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
304
304
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
305
305
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
|
|
306
306
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -612,7 +612,7 @@ class SalesPdfService {
|
|
|
612
612
|
static CommonTotalDetails(ROPrintData, index, numberofCopies, moreDiscDetails) {
|
|
613
613
|
let CommonDetails = [
|
|
614
614
|
shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, '0.00', '0.00', '0.00', '0.00', '0.00', '0.00', ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustItemsTotalBeforeDisc, ROPrintData.CustItemsDiscTotal, ROPrintData.CustItemCGST, ROPrintData.CustItemSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, '0.00', ROPrintData.CustItemAfterTax, ROPrintData.FixedDisc, ROPrintData.For, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowTaxColumn, ROPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), '0.00', ROPrintData.CustItemITax, ROPrintData.Consolidate, ROPrintData.From, null, ROPrintData.SubTotal, moreDiscDetails),
|
|
615
|
-
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
|
|
615
|
+
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
|
|
616
616
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
|
|
617
617
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
618
618
|
shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.For),
|
|
@@ -34,7 +34,7 @@ class SalesPrintService {
|
|
|
34
34
|
// argInvoiceData.Items = argInvoiceData.Items.filter((item: any) => {
|
|
35
35
|
// return TrUtils.IsNull(item.Type);
|
|
36
36
|
// });
|
|
37
|
-
let finalTotalsData = sales_totals_service_1.SalesTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round);
|
|
37
|
+
let finalTotalsData = sales_totals_service_1.SalesTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.PDisc, argInvoiceData.PPerc, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity.Round, InvoicePrintData.Entity);
|
|
38
38
|
if (ConsolidateGST) {
|
|
39
39
|
finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustItemAfterTax;
|
|
40
40
|
}
|
|
@@ -113,11 +113,11 @@ class SalesPrintService {
|
|
|
113
113
|
tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.CGST) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.SGST)
|
|
114
114
|
+ tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
115
115
|
if (Consolidate) {
|
|
116
|
-
let AfterDiscForEach = Item.AfterItemDisc
|
|
117
|
-
let CTaxAmtPerItem = Item.CGST
|
|
118
|
-
let STaxAmtPerItem = Item.SGST
|
|
119
|
-
let ITaxAmtPerItem = Item.IGST
|
|
120
|
-
Item.UnPr = tr_utils_1.TrUtils.FixedTo((AfterDiscForEach
|
|
116
|
+
let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterItemDisc, Item.Qty);
|
|
117
|
+
let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
|
|
118
|
+
let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
|
|
119
|
+
let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
|
|
120
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
123
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -293,7 +293,7 @@ class SalesPrintService {
|
|
|
293
293
|
Data.Due = 0;
|
|
294
294
|
}
|
|
295
295
|
else {
|
|
296
|
-
Data.Due = tr_utils_1.TrUtils.FixedTo((Total
|
|
296
|
+
Data.Due = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Total, PaidTotal), DecimalsNumber);
|
|
297
297
|
}
|
|
298
298
|
if (Data.Due < 0) {
|
|
299
299
|
Data.Due = 0;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare class SalesTotalsService {
|
|
2
|
-
static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, PDisc: any, PPerc: string, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean): any;
|
|
2
|
+
static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, PDisc: any, PPerc: string, Disc: any, Perc: string, TaxCodes: any, WithItems: boolean, Settings: any, isRoundable: boolean, 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, PDisc: string, PPerc: string, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean): any;
|
|
6
|
+
static GetFinalRODataForSave(ItemsList: any, IsIndependentTax: boolean, PDisc: string, PPerc: string, Disc: any, Perc: string, DetailedInfo: boolean, Settings: any, isRoundable: boolean, DecimalsNumber: number): any;
|
|
7
7
|
static SetMainDiscountValues(PPerc: string, PDisc: any, Disc: any, Perc: string, finalTotalsData: any, DetailedInfo: boolean): any;
|
|
8
|
-
static GetFinalCustomerTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: boolean): any;
|
|
8
|
+
static GetFinalCustomerTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, isRoundable: 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: any): any;
|
|
12
12
|
static GetLaborDiscountedTotal(LaborList: any): any;
|
|
13
13
|
static GetItemDiscountedTotal(ItemsList: any): any;
|
|
14
14
|
static GetItemsTaxTotalFor(ItemsList: any, IsIndependentTax: boolean): any;
|
|
@@ -19,9 +19,9 @@ export declare class SalesTotalsService {
|
|
|
19
19
|
static GetLaborIGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
20
20
|
static GetLaborSGSTTaxTotal(opCodesList: any, IsIndependentTax: boolean): any;
|
|
21
21
|
static GetItemGSTTaxTotal(ItemsList: any, IsIndependentTax: boolean): number[];
|
|
22
|
-
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
22
|
+
static GetTaxGroupingForItemsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
23
23
|
static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
|
|
24
24
|
static CompareItemsByHSN(Items: any, TaxCodes: any): any[];
|
|
25
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any): any[];
|
|
25
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
26
26
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
27
27
|
}
|
|
@@ -4,7 +4,7 @@ exports.SalesTotalsService = void 0;
|
|
|
4
4
|
const aggregation_1 = require("../../aggregation/aggregation");
|
|
5
5
|
const tr_utils_1 = require("../../utils/tr-utils");
|
|
6
6
|
class SalesTotalsService {
|
|
7
|
-
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, PDisc, PPerc, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable) {
|
|
7
|
+
static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, PDisc, PPerc, Disc, Perc, TaxCodes, WithItems, Settings, isRoundable, EntitySettings) {
|
|
8
8
|
// LPerc = TrUtils.SetPercToStringIfNull(LPerc);
|
|
9
9
|
PPerc = tr_utils_1.TrUtils.SetPercToStringIfNull(PPerc);
|
|
10
10
|
Perc = tr_utils_1.TrUtils.SetPercToStringIfNull(Perc);
|
|
@@ -13,9 +13,9 @@ class SalesTotalsService {
|
|
|
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, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable);
|
|
16
|
+
let finalTotalsData = this.GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable, EntitySettings);
|
|
17
17
|
if (DetailedInfo) {
|
|
18
|
-
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes);
|
|
18
|
+
finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, EntitySettings);
|
|
19
19
|
}
|
|
20
20
|
if (WithItems) {
|
|
21
21
|
finalTotalsData.Items = ItemsList;
|
|
@@ -53,11 +53,11 @@ class SalesTotalsService {
|
|
|
53
53
|
Item.IGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Item.IGST);
|
|
54
54
|
return Item;
|
|
55
55
|
}
|
|
56
|
-
static GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable) {
|
|
56
|
+
static GetFinalRODataForSave(ItemsList, IsIndependentTax, PDisc, PPerc, Disc, Perc, DetailedInfo, Settings, isRoundable, DecimalsNumber) {
|
|
57
57
|
let finalTotalsData = {};
|
|
58
58
|
finalTotalsData = this.SetMainDiscountValues(PPerc, PDisc, Disc, Perc, finalTotalsData, DetailedInfo);
|
|
59
59
|
finalTotalsData.Settings = Settings;
|
|
60
|
-
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable);
|
|
60
|
+
finalTotalsData = this.GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber);
|
|
61
61
|
return finalTotalsData;
|
|
62
62
|
}
|
|
63
63
|
static SetMainDiscountValues(PPerc, PDisc, Disc, Perc, finalTotalsData, DetailedInfo) {
|
|
@@ -71,7 +71,7 @@ class SalesTotalsService {
|
|
|
71
71
|
}
|
|
72
72
|
return finalTotalsData;
|
|
73
73
|
}
|
|
74
|
-
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable) {
|
|
74
|
+
static GetFinalCustomerTotalsData(finalTotalsData, ItemsList, IsIndependentTax, DetailedInfo, isRoundable, DecimalsNumber) {
|
|
75
75
|
let CustomerAfterDiscTotals = this.GetSubTotalFor(ItemsList);
|
|
76
76
|
// let CustLaborTaxTotal = this.GetLaborTaxTotalFor(IsIndependentTax);
|
|
77
77
|
let CustItemTaxTotal = this.GetItemsTaxTotalFor(ItemsList, IsIndependentTax);
|
|
@@ -83,11 +83,11 @@ class SalesTotalsService {
|
|
|
83
83
|
finalTotalsData.Total = Math.round(CustTotal);
|
|
84
84
|
}
|
|
85
85
|
else {
|
|
86
|
-
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
86
|
+
finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
87
87
|
}
|
|
88
88
|
if (DetailedInfo) {
|
|
89
|
-
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
|
|
90
|
-
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
|
|
89
|
+
finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
|
|
90
|
+
finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
|
|
91
91
|
}
|
|
92
92
|
return finalTotalsData;
|
|
93
93
|
}
|
|
@@ -103,7 +103,7 @@ class SalesTotalsService {
|
|
|
103
103
|
});
|
|
104
104
|
return ItemsTotalAfterDisc;
|
|
105
105
|
}
|
|
106
|
-
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes) {
|
|
106
|
+
static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, DecimalsNumber) {
|
|
107
107
|
// finalTotalsData.CustLaborDiscTotal = this.GetLaborDiscountedTotal(opCodesList);
|
|
108
108
|
finalTotalsData.CustItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList);
|
|
109
109
|
// finalTotalsData.CustLaborTotalAfterDisc = this.GetLaborTotalAfterDiscount(opCodesList);
|
|
@@ -121,15 +121,15 @@ class SalesTotalsService {
|
|
|
121
121
|
finalTotalsData.CustItemSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxInfo[1]);
|
|
122
122
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
123
123
|
finalTotalsData.CustItemAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustItemITax, finalTotalsData.CustItemsTotalAfterDisc);
|
|
124
|
-
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes);
|
|
125
|
-
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round);
|
|
126
|
-
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total);
|
|
124
|
+
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
|
|
125
|
+
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
126
|
+
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
127
127
|
for (var key in finalTotalsData) {
|
|
128
128
|
if (key !== 'Total' && key !== 'SubTotal' &&
|
|
129
129
|
key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
|
|
130
130
|
key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
|
|
131
131
|
&& typeof finalTotalsData[key] === 'number') {
|
|
132
|
-
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
|
|
132
|
+
finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
return finalTotalsData;
|
|
@@ -233,11 +233,11 @@ class SalesTotalsService {
|
|
|
233
233
|
}
|
|
234
234
|
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalTaxAmt];
|
|
235
235
|
}
|
|
236
|
-
static GetTaxGroupingForItemsByHSN(Items, TaxCodes) {
|
|
236
|
+
static GetTaxGroupingForItemsByHSN(Items, TaxCodes, DecimalsNumber) {
|
|
237
237
|
Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
|
|
238
238
|
// Items = this.ResetItemsHSNIfInvalid(Items);
|
|
239
239
|
let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
|
|
240
|
-
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
|
|
240
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
|
|
241
241
|
}
|
|
242
242
|
static GetCombinedTaxPercentage(Items, TaxCodes) {
|
|
243
243
|
Items.forEach((Item) => {
|
|
@@ -283,7 +283,7 @@ class SalesTotalsService {
|
|
|
283
283
|
});
|
|
284
284
|
return FinalMatchedItems;
|
|
285
285
|
}
|
|
286
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
|
|
286
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
|
|
287
287
|
let HSNTaxInfo = [];
|
|
288
288
|
FinalMatchedItems.forEach((MatchedItem) => {
|
|
289
289
|
let TaxInfo = {};
|
|
@@ -298,8 +298,8 @@ class SalesTotalsService {
|
|
|
298
298
|
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
|
|
299
299
|
});
|
|
300
300
|
TaxInfo.HSN = HSN;
|
|
301
|
-
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
|
|
302
|
-
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
|
|
301
|
+
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
302
|
+
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
303
303
|
TaxInfo.ItemsCount = MatchedItem.length;
|
|
304
304
|
// let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
|
|
305
305
|
// TaxInfo.CGST = GSTValues[0];
|
|
@@ -54,7 +54,7 @@ class EstPrintService {
|
|
|
54
54
|
ROPrintData.ShowAccParts = this.CheckAndShowItemsAsAR(argROData);
|
|
55
55
|
}
|
|
56
56
|
argROData = this.ReverseItemsForROPrint(argROData, isReverse);
|
|
57
|
-
let finalTotalsData = ro_totals_service_1.ROTotalsService.GetTotalsValue(argROData, TaxCodes, false, true, true, ROPrintData.Entity.Round);
|
|
57
|
+
let finalTotalsData = ro_totals_service_1.ROTotalsService.GetTotalsValue(argROData, TaxCodes, false, true, true, ROPrintData.Entity.Round, ROPrintData.Entity);
|
|
58
58
|
finalTotalsData = this.CheckAndGetCombinedTotals(AsCustomerAndInsurance, AsInsuranceOrCustomer, finalTotalsData, ROPrintData.Entity.DecimalsNumber);
|
|
59
59
|
finalTotalsData.Settings = tr_utils_1.TrUtils.Stringify(argROData.Settings);
|
|
60
60
|
if (AsCustomerOnly) {
|