IO-2704 Resolve CDK Allocation Calculation.

This commit is contained in:
Patrick Fic
2024-03-19 13:26:25 -07:00
parent c28d5b664d
commit 926ff3cb6f
3 changed files with 10 additions and 6 deletions

View File

@@ -26,7 +26,11 @@ exports.default = async function (socket, jobid) {
const {bodyshop} = job;
const taxAllocations =
InstanceManager({imex: {
InstanceManager({
executeFunction:true,
deubg:true,
args: [],
imex: () => ({
local: {
center: bodyshop.md_responsibility_centers.taxes.local.name,
sale: Dinero(job.job_totals.totals.local_tax),
@@ -48,7 +52,7 @@ exports.default = async function (socket, jobid) {
profitCenter: bodyshop.md_responsibility_centers.taxes.federal,
costCenter: bodyshop.md_responsibility_centers.taxes.federal,
},
}, rome:{
}), rome: () => ({
tax_ty1: {
center: bodyshop.md_responsibility_centers.taxes[`tax_ty1`].name,
sale: Dinero(job.job_totals.totals.us_sales_tax_breakdown[`ty1Tax`]),
@@ -84,7 +88,7 @@ exports.default = async function (socket, jobid) {
profitCenter: bodyshop.md_responsibility_centers.taxes[`tax_ty5`],
costCenter: bodyshop.md_responsibility_centers.taxes[`tax_ty5`],
},
} })
}) })
//Determine if there are MAPA and MASH lines already on the estimate.
@@ -439,6 +443,7 @@ if(InstanceManager({rome:true})){
}),
];
} catch (error) {
console.log(error)
CdkBase.createLogEvent(
socket,
"ERROR",

View File

@@ -8,7 +8,7 @@
* @property { string | object | function } imex Return this prop if Rome.
*/
function InstanceManager({ instance, debug, executeFunction, rome, promanager, imex }) {
function InstanceManager({ args, instance, debug, executeFunction, rome, promanager, imex }) {
let propToReturn = null;
switch (instance || process.env.INSTANCE) {