IO-1381 Updates to mark up calculations process.

This commit is contained in:
Patrick Fic
2021-09-27 16:34:11 -07:00
parent 1cad57bec2
commit 1f2bec06ef
6 changed files with 66 additions and 44 deletions

View File

@@ -70,12 +70,14 @@ exports.default = async function (socket, jobid) {
amount: Math.round(val.act_price * 100),
}).multiply(val.part_qty || 1);
if (val.prt_dsmk_p && val.prt_dsmk_p !== 0) {
if ((val.prt_dsmk_p && val.prt_dsmk_p !== 0) || val.prt_dsmk_m !== 0) {
// console.log("Have a part discount", val);
DineroAmount = DineroAmount.add(
DineroAmount.percentage(Math.abs(val.prt_dsmk_p || 0)).multiply(
val.prt_dsmk_p > 0 ? 1 : -1
)
val.prt_dsmk_m && val.prt_dsmk_m !== 0
? Dinero({ amount: Math.round(val.prt_dsmk_m * 100) })
: DineroAmount.percentage(Math.abs(val.prt_dsmk_p || 0)).multiply(
val.prt_dsmk_p > 0 ? 1 : -1
)
);
}