IO-1152 Add in part mark up for BC Economical claims.

This commit is contained in:
Patrick Fic
2021-05-26 09:06:05 -07:00
parent 6ae9de7df3
commit e8b7e2f0b9
11 changed files with 147 additions and 50 deletions

View File

@@ -203,7 +203,8 @@ const generateInvoiceQbxml = (
//Create the invoice lines mapping.
jobs_by_pk.joblines.map((jobline) => {
//Parts Lines
if (jobline.db_ref === "936008") { //If either of these DB REFs change, they also need to change in job-totals calculations.
if (jobline.db_ref === "936008") {
//If either of these DB REFs change, they also need to change in job-totals calculations.
hasMapaLine = true;
}
if (jobline.db_ref === "936007") {
@@ -213,7 +214,15 @@ const generateInvoiceQbxml = (
if (jobline.profitcenter_part && jobline.act_price) {
const DineroAmount = Dinero({
amount: Math.round(jobline.act_price * 100),
}).multiply(jobline.part_qty || 1);
})
.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)
);
const account = responsibilityCenters.profits.find(
(i) => jobline.profitcenter_part.toLowerCase() === i.name.toLowerCase()
);