Merged in feature/IO-3243-Job-Costing-TOW (pull request #2327)
IO-3243 Job Costing TOW Approved-by: Dave Richer
This commit is contained in:
@@ -1596,6 +1596,7 @@ query QUERY_JOB_COSTING_DETAILS($id: uuid!) {
|
|||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
dms_allocation
|
dms_allocation
|
||||||
cieca_pfl
|
cieca_pfl
|
||||||
|
cieca_stl
|
||||||
materials
|
materials
|
||||||
joblines(where: { removed: { _eq: false } }) {
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
@@ -1712,6 +1713,7 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT
|
|||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
dms_allocation
|
dms_allocation
|
||||||
cieca_pfl
|
cieca_pfl
|
||||||
|
cieca_stl
|
||||||
materials
|
materials
|
||||||
joblines(where: {removed: {_eq: false}}) {
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
id
|
id
|
||||||
|
|||||||
@@ -567,6 +567,29 @@ function GenerateCostingData(job) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (InstanceManager({ imex: false, rome: true })) {
|
||||||
|
const stlTowing = job.cieca_stl?.data.find((c) => c.ttl_type === "OTTW");
|
||||||
|
const stlStorage = job.cieca_stl?.data.find((c) => c.ttl_type === "OTST");
|
||||||
|
|
||||||
|
if (!jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]])
|
||||||
|
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = Dinero();
|
||||||
|
|
||||||
|
jobLineTotalsByProfitCenter.additional[defaultProfits["TOW"]] = stlTowing
|
||||||
|
? Dinero({ amount: Math.round(stlTowing.ttl_amt * 100) })
|
||||||
|
: Dinero({
|
||||||
|
amount: Math.round((job.towing_payable || 0) * 100)
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]])
|
||||||
|
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = Dinero();
|
||||||
|
|
||||||
|
jobLineTotalsByProfitCenter.additional[defaultProfits["STO"]] = stlStorage
|
||||||
|
? Dinero({ amount: Math.round(stlStorage.ttl_amt * 100) })
|
||||||
|
: Dinero({
|
||||||
|
amount: Math.round((job.storage_payable || 0) * 100)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//Is it a DMS Setup?
|
//Is it a DMS Setup?
|
||||||
const selectedDmsAllocationConfig =
|
const selectedDmsAllocationConfig =
|
||||||
(job.bodyshop.md_responsibility_centers.dms_defaults &&
|
(job.bodyshop.md_responsibility_centers.dms_defaults &&
|
||||||
|
|||||||
Reference in New Issue
Block a user