Job costing additional fix.
This commit is contained in:
@@ -31,8 +31,8 @@ async function JobCosting(req, res) {
|
|||||||
res.status(200).json(ret);
|
res.status(200).json(ret);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("job-costing-error", "ERROR", req.user.email, jobid, {
|
logger.log("job-costing-error", "ERROR", req.user.email, jobid, {
|
||||||
jobid,
|
message: error.message,
|
||||||
error,
|
stack: error.stack,
|
||||||
});
|
});
|
||||||
|
|
||||||
res.status(400).send(JSON.stringify(error));
|
res.status(400).send(JSON.stringify(error));
|
||||||
@@ -261,14 +261,17 @@ async function JobCostingMulti(req, res) {
|
|||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("job-costing-multi-error", "ERROR", req.user.email, [jobids], {
|
logger.log("job-costing-multi-error", "ERROR", req.user.email, [jobids], {
|
||||||
jobids,
|
message: error.message,
|
||||||
error,
|
stack: error.stack,
|
||||||
});
|
});
|
||||||
res.status(400).send(JSON.stringify(error));
|
res.status(400).send(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function GenerateCostingData(job) {
|
function GenerateCostingData(job) {
|
||||||
|
if (job.id === "b97353ef-24c8-4b3f-a6c1-2190391c823e") {
|
||||||
|
console.log("here");
|
||||||
|
}
|
||||||
const defaultProfits =
|
const defaultProfits =
|
||||||
job.bodyshop.md_responsibility_centers.defaults.profits;
|
job.bodyshop.md_responsibility_centers.defaults.profits;
|
||||||
const allCenters = _.union(
|
const allCenters = _.union(
|
||||||
@@ -675,12 +678,16 @@ function GenerateCostingData(job) {
|
|||||||
sale_labor_dinero: Dinero(),
|
sale_labor_dinero: Dinero(),
|
||||||
sale_parts: Dinero().toFormat(),
|
sale_parts: Dinero().toFormat(),
|
||||||
sale_parts_dinero: Dinero(),
|
sale_parts_dinero: Dinero(),
|
||||||
|
sale_additional: Dinero(),
|
||||||
|
sale_additional_dinero: Dinero(),
|
||||||
sales: Dinero().toFormat(),
|
sales: Dinero().toFormat(),
|
||||||
sales_dinero: Dinero(),
|
sales_dinero: Dinero(),
|
||||||
cost_parts: Dinero().toFormat(),
|
cost_parts: Dinero().toFormat(),
|
||||||
cost_parts_dinero: Dinero(),
|
cost_parts_dinero: Dinero(),
|
||||||
cost_labor: Adjustment.toFormat(),
|
cost_labor: Adjustment.toFormat(),
|
||||||
cost_labor_dinero: Adjustment,
|
cost_labor_dinero: Adjustment,
|
||||||
|
cost_additional: Dinero(),
|
||||||
|
cost_additional_dinero: Dinero(),
|
||||||
costs: Adjustment.toFormat(),
|
costs: Adjustment.toFormat(),
|
||||||
costs_dinero: Adjustment,
|
costs_dinero: Adjustment,
|
||||||
gpdollars_dinero: Dinero(),
|
gpdollars_dinero: Dinero(),
|
||||||
|
|||||||
Reference in New Issue
Block a user