New fix for NA mitchell items. RPS-46. Fixed vehicle age bug RPS-51
This commit is contained in:
@@ -9,11 +9,15 @@ export function CalculateJobRpsDollars(job, returnSumActPrice) {
|
||||
.filter((j) => !j.ignore)
|
||||
.reduce((acc, val) => {
|
||||
actPriceSum = actPriceSum.add(
|
||||
Dinero({ amount: Math.round((val.act_price || 0) * 100) })
|
||||
Dinero({ amount: Math.round((val.act_price || 0) * 100) }).multiply(
|
||||
val.part_qty || 1
|
||||
)
|
||||
);
|
||||
if (val.price_diff > 0) {
|
||||
return acc.add(
|
||||
Dinero({ amount: Math.round((val.price_diff || 0) * 100) })
|
||||
Dinero({ amount: Math.round((val.price_diff || 0) * 100) }).multiply(
|
||||
val.part_qty || 1
|
||||
)
|
||||
);
|
||||
} else {
|
||||
return acc;
|
||||
@@ -34,7 +38,11 @@ export function CalculateJobRpsPc(
|
||||
const dbPriceSum = job.joblines
|
||||
.filter((j) => !j.ignore)
|
||||
.reduce((acc, val) => {
|
||||
return acc.add(Dinero({ amount: Math.round((val.db_price || 0) * 100) }));
|
||||
return acc.add(
|
||||
Dinero({ amount: Math.round((val.db_price || 0) * 100) }).multiply(
|
||||
val.part_qty || 1
|
||||
)
|
||||
);
|
||||
}, Dinero());
|
||||
|
||||
const jobRpsPc = currentRpsDollars.getAmount() / dbPriceSum.getAmount();
|
||||
|
||||
Reference in New Issue
Block a user