shareneus 1.4.98 → 1.4.99
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.
|
@@ -563,7 +563,7 @@ class SalesReceivePdfService {
|
|
|
563
563
|
}
|
|
564
564
|
static CommonTotalDetails(SRPrintData, moreDiscDetails) {
|
|
565
565
|
let CommonDetails = [
|
|
566
|
-
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(SRPrintData, 0, 0, 0, 0, 0, SRPrintData.
|
|
566
|
+
shared_pdf_service_1.SharedPDFService.GetDebitTotalDetails(SRPrintData, 0, 0, 0, 0, 0, SRPrintData.totalIGST, SRPrintData.ShowIGST, SRPrintData.ShowTaxColumn, SRPrintData.subtotal, SRPrintData.totalDiscount, SRPrintData.totalCGST, SRPrintData.totalSGST, SRPrintData.CustTaxGroupData, SRPrintData.ShowAccParts, SRPrintData.CustLaborAfterTax, SRPrintData.CustPartAfterTax, SRPrintData.FixedDisc, SRPrintData.For, SRPrintData.total, SRPrintData.roundOff, SRPrintData.totalAfterRounded, SRPrintData.ShowTaxColumn, SRPrintData.ShowTaxColumn, tr_utils_1.TrUtils.isTaxable(SRPrintData.Settings.Tax), SRPrintData.CustLaborITax, SRPrintData.totalTax, SRPrintData.Consolidate, SRPrintData.From, moreDiscDetails),
|
|
567
567
|
shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(SRPrintData.Type, SRPrintData.Paid, SRPrintData.Due, SRPrintData.Sts, false, SRPrintData.Entity.DecimalsNumber),
|
|
568
568
|
shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(SRPrintData.Entity.Terms),
|
|
569
569
|
shared_pdf_service_1.SharedPDFService.GetUnderLine(),
|
|
@@ -26,6 +26,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false) {
|
|
|
26
26
|
let totalDiscountOnItems = 0;
|
|
27
27
|
let totalDiscountOnLabor = 0;
|
|
28
28
|
let roundOff = 0;
|
|
29
|
+
let totalAfterRounded = 0;
|
|
29
30
|
// Tax breakdown totals - only calculate if taxable
|
|
30
31
|
let totalSGST = 0;
|
|
31
32
|
let totalCGST = 0;
|
|
@@ -89,6 +90,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false) {
|
|
|
89
90
|
const netAmountAfterDiscount = (0, math_operations_1.Subtract)(subtotal, totalDiscount);
|
|
90
91
|
// Step 2: Add tax if taxable
|
|
91
92
|
total = isTaxable ? (0, math_operations_1.Add)(netAmountAfterDiscount, totalTax) : netAmountAfterDiscount;
|
|
93
|
+
totalAfterRounded = isTaxable ? (0, math_operations_1.Add)(netAmountAfterDiscount, totalTax) : netAmountAfterDiscount;
|
|
92
94
|
// FIXED ROUNDING: Use Math.round instead of Math.floor
|
|
93
95
|
const roundedTotal = Math.round(total);
|
|
94
96
|
roundOff = (0, math_operations_1.Subtract)(roundedTotal, total);
|
|
@@ -97,6 +99,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false) {
|
|
|
97
99
|
// Base return object
|
|
98
100
|
const result = {
|
|
99
101
|
total,
|
|
102
|
+
totalAfterRounded,
|
|
100
103
|
subtotal,
|
|
101
104
|
totalDiscount,
|
|
102
105
|
roundOff,
|
|
@@ -109,6 +112,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false) {
|
|
|
109
112
|
// Only include tax fields if taxable
|
|
110
113
|
if (isTaxable) {
|
|
111
114
|
result.totalTax = totalTax;
|
|
115
|
+
result.totalAfterRounded = totalAfterRounded;
|
|
112
116
|
result.totalTaxOnItems = totalTaxOnItems;
|
|
113
117
|
result.totalTaxOnLabor = totalTaxOnLabor;
|
|
114
118
|
result.totalSGST = totalSGST;
|
|
@@ -133,6 +137,7 @@ function SalesTotalCalculationsWithDecimals(items = [], ops = [], isTaxable = fa
|
|
|
133
137
|
// Base rounded result
|
|
134
138
|
const roundedResult = {
|
|
135
139
|
total: roundToDecimals(result.total),
|
|
140
|
+
totalAfterRounded: roundToDecimals(result.totalAfterRounded),
|
|
136
141
|
subtotal: roundToDecimals(result.subtotal),
|
|
137
142
|
totalDiscount: roundToDecimals(result.totalDiscount),
|
|
138
143
|
roundOff: roundToDecimals(result.roundOff),
|