shareneus 1.6.20 → 1.6.22
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/tax/tax-calculator.js +14 -7
- package/package.json +1 -1
|
@@ -63,15 +63,22 @@ const math_operations_1 = require("../shared/math-operations");
|
|
|
63
63
|
* // Returns: 3000
|
|
64
64
|
*/
|
|
65
65
|
function CalculateNetAmt(input) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
|
|
66
|
+
var _a, _b, _c;
|
|
67
|
+
const line = input;
|
|
68
|
+
if (line.NetAmt != null) {
|
|
69
|
+
return (0, util_1.GetNumber)(line.NetAmt);
|
|
70
|
+
}
|
|
71
|
+
const disc = (0, util_1.GetNumber)(input.Disc);
|
|
72
|
+
const recDisc = (0, util_1.GetNumber)(input.RecDisc);
|
|
73
|
+
if (line.UnAmt != null || line.Amt != null) {
|
|
74
|
+
return (0, math_operations_1.Subtract)((0, util_1.GetNumber)((_a = line.UnAmt) !== null && _a !== void 0 ? _a : line.Amt), disc, recDisc);
|
|
70
75
|
}
|
|
71
|
-
|
|
72
|
-
|
|
76
|
+
const unitPrice = (_c = (_b = line.UnitPrice) !== null && _b !== void 0 ? _b : line.UnPr) !== null && _c !== void 0 ? _c : line.Pr;
|
|
77
|
+
if (unitPrice != null) {
|
|
78
|
+
const qty = input.Qty == null ? 1 : (0, util_1.GetNumber)(input.Qty);
|
|
79
|
+
return (0, math_operations_1.Subtract)((0, math_operations_1.Multiply)(qty, (0, util_1.GetNumber)(unitPrice)), disc, recDisc);
|
|
73
80
|
}
|
|
74
|
-
return
|
|
81
|
+
return 0;
|
|
75
82
|
}
|
|
76
83
|
// ============================================================
|
|
77
84
|
// Core Tax Calculation
|