IO-2704 Resolve CDK Allocation Calculation.
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user