shareneus 1.5.19 → 1.5.21

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
@@ -158,9 +160,11 @@ function SalesTotalCalculations(items = [], ops = [], isTaxable = false, taxCode
158
160
  returnSubtotal,
159
161
  returnTax,
160
162
  returnTotal,
163
+ returnTotalDiscount,
161
164
  nonReturnSubTotal,
162
165
  nonReturnTax,
163
- nonReturnTotal
166
+ nonReturnTotal,
167
+ nonReturnTotalDiscount
164
168
  };
165
169
  // Only include tax fields and taxSummary if taxable
166
170
  if (isTaxable) {
@@ -206,9 +210,11 @@ function SalesTotalCalculationsWithDecimals(items = [], ops = [], isTaxable = fa
206
210
  returnSubtotal: roundToDecimals(result.returnSubtotal),
207
211
  returnTax: roundToDecimals(result.returnTax),
208
212
  returnTotal: roundToDecimals(result.returnTotal),
213
+ returnTotalDiscount: roundToDecimals(result.returnTotalDiscount),
209
214
  nonReturnSubTotal: roundToDecimals(result.nonReturnSubTotal),
210
215
  nonReturnTax: roundToDecimals(result.nonReturnTax),
211
- nonReturnTotal: roundToDecimals(result.nonReturnTotal)
216
+ nonReturnTotal: roundToDecimals(result.nonReturnTotal),
217
+ nonReturnTotalDiscount: roundToDecimals(result.nonReturnTotalDiscount)
212
218
  };
213
219
  // Only include tax fields and taxSummary if taxable
214
220
  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.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",