Merged in hotfix/2020-05-28 (pull request #75)

Hotfix to test for IO-1152.
This commit is contained in:
Patrick Fic
2021-05-27 23:50:08 +00:00
2 changed files with 9 additions and 9 deletions

View File

@@ -212,17 +212,16 @@ const generateInvoiceQbxml = (
}
if (jobline.profitcenter_part && jobline.act_price) {
const DineroAmount = Dinero({
let DineroAmount = Dinero({
amount: Math.round(jobline.act_price * 100),
})
.multiply(jobline.part_qty || 1)
.add(
Dinero({
amount: Math.round((jobline.act_price || 0) * 100),
})
.multiply(jobline.part_qty || 0)
.percentage(jobline.prt_dsmk_p || 0)
}).multiply(jobline.part_qty || 1);
if (jobline.prt_dsmk_p && jobline.prt_dsmk_p !== 0) {
console.log("Have a part discount", jobline);
DineroAmount = DineroAmount.add(
DineroAmount.percentage(jobline.prt_dsmk_p || 0)
);
}
const account = responsibilityCenters.profits.find(
(i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase()
);

View File

@@ -101,6 +101,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) {
profitcenter_labor
profitcenter_part
db_ref
prt_dsmk_p
}
}
bodyshops(where: {associations: {active: {_eq: true}}}) {