IO-233 Revert ITC Calculations.

This commit is contained in:
Patrick Fic
2021-09-13 14:56:54 -07:00
parent d9abe84949
commit b198ca5051

View File

@@ -86,44 +86,44 @@ exports.default = async function (socket, jobid) {
.multiply(line_val.quantity)
.multiply(bill_val.is_credit_memo ? -1 : 1);
//Add appropriate tax amounts.
const {
applicable_taxes: { local, state, federal },
} = line_val;
// //Add appropriate tax amounts.
// const {
// applicable_taxes: { local, state, federal },
// } = line_val;
if (local) {
if (bodyshop.cdk_configuration.itc_local)
taxAllocations.local.cost = taxAllocations.local.cost.add(
lineDinero.percentage(bill_val.local_tax_rate || 0)
);
lineDinero = lineDinero.add(
lineDinero.percentage(bill_val.local_tax_rate || 0)
);
}
if (state) {
if (bodyshop.cdk_configuration.itc_state)
taxAllocations.state.cost = taxAllocations.state.cost.add(
lineDinero.percentage(bill_val.state_tax_rate || 0)
);
lineDinero = lineDinero.add(
lineDinero.percentage(bill_val.state_tax_rate || 0)
);
}
if (federal) {
//If it's an ITC, add it as a negative cost, otherwise add it to the item cost.
if (bodyshop.cdk_configuration.itc_federal)
taxAllocations.federal.cost = taxAllocations.federal.cost.add(
lineDinero.percentage(bill_val.federal_tax_rate || 0)
);
// if (local) {
// if (bodyshop.cdk_configuration.itc_local)
// taxAllocations.local.cost = taxAllocations.local.cost.add(
// lineDinero.percentage(bill_val.local_tax_rate || 0)
// );
// lineDinero = lineDinero.add(
// lineDinero.percentage(bill_val.local_tax_rate || 0)
// );
// }
// if (state) {
// if (bodyshop.cdk_configuration.itc_state)
// taxAllocations.state.cost = taxAllocations.state.cost.add(
// lineDinero.percentage(bill_val.state_tax_rate || 0)
// );
// lineDinero = lineDinero.add(
// lineDinero.percentage(bill_val.state_tax_rate || 0)
// );
// }
// if (federal) {
// //If it's an ITC, add it as a negative cost, otherwise add it to the item cost.
// if (bodyshop.cdk_configuration.itc_federal)
// taxAllocations.federal.cost = taxAllocations.federal.cost.add(
// lineDinero.percentage(bill_val.federal_tax_rate || 0)
// );
lineDinero = lineDinero.add(
lineDinero.percentage(bill_val.federal_tax_rate || 0)
);
// lineDinero = lineDinero.add(
// lineDinero.percentage(bill_val.federal_tax_rate || 0)
// );
// bill_acc[line_val.cost_center] = bill_acc[line_val.cost_center].add(
// lineDinero.percentage(bill_val.federal_tax_rate || 0)
// );
}
// // bill_acc[line_val.cost_center] = bill_acc[line_val.cost_center].add(
// // lineDinero.percentage(bill_val.federal_tax_rate || 0)
// // );
// }
bill_acc[line_val.cost_center] =
bill_acc[line_val.cost_center].add(lineDinero);