IO-1606 IO-1607 IO-1752 Move towing rates.
This commit is contained in:
@@ -418,21 +418,27 @@ function CalculateAdditional(job) {
|
||||
pvrt: null,
|
||||
total: null,
|
||||
};
|
||||
ret.towing = Dinero({
|
||||
amount: Math.round((job.towing_payable || 0) * 100),
|
||||
});
|
||||
ret.additionalCosts = job.joblines
|
||||
.filter((jl) => !jl.removed && IsAdditionalCost(jl))
|
||||
.reduce((acc, val) => {
|
||||
const lineValue = Dinero({
|
||||
amount: Math.round((val.act_price || 0) * 100),
|
||||
}).multiply(val.part_qty || 1);
|
||||
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
|
||||
return acc.add(lineValue);
|
||||
|
||||
if (val.line_desc.toLowerCase().includes("towing")) {
|
||||
ret.towing = lineValue;
|
||||
return acc;
|
||||
} else {
|
||||
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
|
||||
return acc.add(lineValue);
|
||||
}
|
||||
}, Dinero());
|
||||
ret.adjustments = Dinero({
|
||||
amount: Math.round((job.adjustment_bottom_line || 0) * 100),
|
||||
});
|
||||
ret.towing = Dinero({
|
||||
amount: Math.round((job.towing_payable || 0) * 100),
|
||||
});
|
||||
ret.storage = Dinero({
|
||||
amount: Math.round((job.storage_payable || 0) * 100),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user