shareneus 1.5.19 → 1.5.20

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.
@@ -37,6 +37,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false, taxCode
37
37
  let returnTotal = 0;
38
38
  let nonReturnTotal = 0;
39
39
  let returnTotalDiscount = 0;
40
+ let nonReturnTotalDiscount = 0;
40
41
  // Tax breakdown totals - only calculate if taxable
41
42
  let totalSGST = 0;
42
43
  let totalCGST = 0;
@@ -115,6 +116,7 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false, taxCode
115
116
  subtotal = (0, math_operations_1.Add)(subtotalOnItems, subtotalOnLabor);
116
117
  nonReturnSubTotal = subtotal;
117
118
  nonReturnTax = totalTax;
119
+ nonReturnTotalDiscount = totalDiscount;
118
120
  // Step 2: Add tax if taxable
119
121
  nonReturnTotal = isTaxable ? (0, math_operations_1.Add)((0, math_operations_1.Subtract)(subtotal, totalDiscount), totalTax) : (0, math_operations_1.Subtract)(subtotal, totalDiscount);
120
122
  // Subtract return subtotal from subtotal
@@ -160,7 +162,8 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false, taxCode
160
162
  returnTotal,
161
163
  nonReturnSubTotal,
162
164
  nonReturnTax,
163
- nonReturnTotal
165
+ nonReturnTotal,
166
+ nonReturnTotalDiscount
164
167
  };
165
168
  // Only include tax fields and taxSummary if taxable
166
169
  if (isTaxable) {
@@ -208,7 +211,8 @@ function SalesTotalCalculationsWithDecimals(items = [], ops = [], isTaxable = fa
208
211
  returnTotal: roundToDecimals(result.returnTotal),
209
212
  nonReturnSubTotal: roundToDecimals(result.nonReturnSubTotal),
210
213
  nonReturnTax: roundToDecimals(result.nonReturnTax),
211
- nonReturnTotal: roundToDecimals(result.nonReturnTotal)
214
+ nonReturnTotal: roundToDecimals(result.nonReturnTotal),
215
+ nonReturnTotalDiscount: roundToDecimals(result.nonReturnTotalDiscount)
212
216
  };
213
217
  // Only include tax fields and taxSummary if taxable
214
218
  if (isTaxable) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.19",
3
+ "version": "1.5.20",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",