Updates for audatex claims & mapa/mash calculations IO-718

This commit is contained in:
Patrick Fic
2021-03-04 13:23:52 -08:00
parent 7566f61d83
commit 0d317578b2
4 changed files with 28 additions and 6 deletions

View File

@@ -41,10 +41,10 @@ exports.totalsSsu = async function (req, res) {
},
});
res.status(200);
res.status(200).send();
} catch (error) {
console.log(error);
res.status(503);
res.status(503).send();
}
};
@@ -269,7 +269,13 @@ function IsAdditionalCost(jobLine) {
//936008 is Paint/Materials
//936007 is Shop/Materials
return !jobLine.db_ref || jobLine.db_ref.startsWith("9360");
//Remove paint and shop mat lines. They're calculated under rates.
const isPaintOrShopMat =
jobLine.db_ref === "936008" || jobLine.db_ref === "936007";
return (
!jobLine.db_ref || (jobLine.db_ref.startsWith("9360") && !isPaintOrShopMat)
);
}
function CalculateAdditional(job) {
@@ -305,7 +311,7 @@ function CalculateAdditional(job) {
function CalculateTaxesTotals(job, otherTotals) {
const subtotal = otherTotals.parts.parts.subtotal
.add(otherTotals.parts.sublets.subtotal)
.add(otherTotals.rates.rates_subtotal)
.add(otherTotals.rates.subtotal) //No longer using just rates subtotal to include mapa/mash.
.add(otherTotals.additional);
// .add(Dinero({ amount: (job.towing_payable || 0) * 100 }))
// .add(Dinero({ amount: (job.storage_payable || 0) * 100 }));
@@ -350,7 +356,7 @@ function CalculateTaxesTotals(job, otherTotals) {
statePartsTax,
state_tax: statePartsTax
.add(
otherTotals.rates.rates_subtotal.percentage((job.tax_lbr_rt || 0) * 100)
otherTotals.rates.subtotal.percentage((job.tax_lbr_rt || 0) * 100) // THis is currently using the lbr tax rate from PFH not PFL.
)
.add(
Dinero({