From b198ca50516bb410e727da780ebe73f44ffa788c Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 13 Sep 2021 14:56:54 -0700 Subject: [PATCH] IO-233 Revert ITC Calculations. --- server/cdk/cdk-calculate-allocations.js | 70 ++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js index 7bb2f1194..c54c549ed 100644 --- a/server/cdk/cdk-calculate-allocations.js +++ b/server/cdk/cdk-calculate-allocations.js @@ -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);