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

@@ -41,8 +41,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(DmsContainer);
export const socket = SocketIO( export const socket = SocketIO(
import.meta.env.PROD import.meta.env.PROD
? import.meta.env.VITE_APP_AXIOS_BASE_API_URL ? import.meta.env.VITE_APP_AXIOS_BASE_API_URL
: window.location.origin, : "http://localhost:4000", // for dev testing,
// "http://localhost:4000", // for dev testing,
{ {
path: "/ws", path: "/ws",
withCredentials: true, withCredentials: true,

View File

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

View File

@@ -8,7 +8,7 @@
* @property { string | object | function } imex Return this prop if Rome. * @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; let propToReturn = null;
switch (instance || process.env.INSTANCE) { switch (instance || process.env.INSTANCE) {