Merge branch 'release/2021-09-03' into feature/cdk-cert

This commit is contained in:
Patrick Fic
2021-09-03 11:24:16 -07:00
4 changed files with 14 additions and 7 deletions

View File

@@ -1453,7 +1453,7 @@
"partstotal": "This is the total of all parts and sublet amounts on the vehicle (some of these may require an in-house invoice).<br/>\nItems such as shop and paint materials, labor online lines, etc. are not included in this total.",
"totalreturns": "The total amount of returns created for this job."
},
"prt_dsmk_total": "Line Item Markup",
"prt_dsmk_total": "Line Item Adjustment",
"rates": "Rates",
"rates_subtotal": "All Rates Subtotal",
"reconciliation": {

View File

@@ -257,7 +257,9 @@ const generateInvoiceQbxml = (
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)
DineroAmount.percentage(Math.abs(jobline.prt_dsmk_p || 0)).multiply(
jobline.prt_dsmk_p > 0 ? 1 : -1
)
);
}
const account = responsibilityCenters.profits.find(

View File

@@ -301,7 +301,8 @@ function GenerateCostingData(job) {
amount: Math.round((val.act_price || 0) * 100),
})
.multiply(val.part_qty || 0)
.percentage(val.prt_dsmk_p || 0)
.percentage(Math.abs(val.prt_dsmk_p || 0))
.multiply(val.prt_dsmk_p > 0 ? 1 : -1)
);
if (!acc.parts[partsProfitCenter])
acc.parts[partsProfitCenter] = Dinero();
@@ -330,7 +331,8 @@ function GenerateCostingData(job) {
amount: Math.round((val.act_price || 0) * 100),
})
.multiply(val.part_qty || 0)
.percentage(val.prt_dsmk_p || 0)
.percentage(Math.abs(val.prt_dsmk_p || 0))
.multiply(val.prt_dsmk_p > 0 ? 1 : -1)
);
if (!acc.parts[partsProfitCenter])

View File

@@ -258,7 +258,8 @@ function CalculatePartsTotals(jobLines) {
amount: Math.round((value.act_price || 0) * 100),
})
.multiply(value.part_qty || 0)
.percentage(value.prt_dsmk_p || 0)
.percentage(Math.abs(value.prt_dsmk_p || 0))
.multiply(value.prt_dsmk_p > 0 ? 1 : -1)
),
list: {
...acc.parts.list,
@@ -289,7 +290,8 @@ function CalculatePartsTotals(jobLines) {
amount: Math.round((value.act_price || 0) * 100),
})
.multiply(value.part_qty || 0)
.percentage(value.prt_dsmk_p || 0)
.percentage(Math.abs(value.prt_dsmk_p || 0))
.multiply(value.prt_dsmk_p > 0 ? 1 : -1)
),
},
};
@@ -425,7 +427,8 @@ function CalculateTaxesTotals(job, otherTotals) {
amount: Math.round((val.act_price || 0) * 100),
})
.multiply(val.part_qty || 0)
.percentage(val.prt_dsmk_p || 0)
.percentage(Math.abs(val.prt_dsmk_p || 0))
.multiply(val.prt_dsmk_p > 0 ? 1 : -1)
)
.percentage(
((job.parts_tax_rates &&