diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 0ef97135a..77b4c13c7 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -719,11 +719,11 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes }); //Handle insurance profile adjustments for Labor and Materials - Object.keys(job_totals.rate).forEach((key) => { + Object.keys(job_totals.rates).forEach((key) => { if ( - job_totals.rate[key] && - job_totals.rate[key].adjustment && - job_totals.rate[key].adjustment.isZero() === false + job_totals.rates[key] && + job_totals.rates[key].adjustment && + job_totals.rates[key].adjustment.isZero() === false ) { if (qbo) { //Going to always assume that we need to apply GST and PST for labor. @@ -748,7 +748,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes : taxCodes[taxAccountCode]; InvoiceLineAdd.push({ DetailType: "SalesItemLineDetail", - Amount: Dinero(job_totals.rate[key]).adjustment.toFormat(DineroQbFormat), + Amount: Dinero(job_totals.rates[key]).adjustment.toFormat(DineroQbFormat), Description: `${account.accountdesc} - Adjustment`, SalesItemLineDetail: { ...(jobs_by_pk.class ? { ClassRef: { value: classes[jobs_by_pk.class] } } : {}), @@ -770,7 +770,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes }, Desc: "Storage", Quantity: 1, - Amount: Dinero(job_totals.rate[key]).adjustment.toFormat(DineroQbFormat), + Amount: Dinero(job_totals.rates[key]).adjustment.toFormat(DineroQbFormat), SalesTaxCodeRef: { FullName: bodyshop.md_responsibility_centers.taxes.itemexemptcode || "NON" } diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js index 8e92c76a9..780468345 100644 --- a/server/cdk/cdk-calculate-allocations.js +++ b/server/cdk/cdk-calculate-allocations.js @@ -380,7 +380,7 @@ function calculateAllocations(connectionData, job) { }); //profile level adjustments for labor and materials Object.keys(job.job_totals.rates).forEach((key) => { - if (job.job_totals.rate[key] && job.job_totals.rate[key].adjustment && job.job_totals.rate[key].adjustment.isZero() === false) { + if (job.job_totals.rates[key] && job.job_totals.rates[key].adjustment && job.job_totals.rates[key].adjustment.isZero() === false) { const accountName = selectedDmsAllocationConfig.profits[key.toUpperCase()]; const otherAccount = bodyshop.md_responsibility_centers.profits.find((c) => c.name === accountName); if (otherAccount) { diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 814f8d490..65cbef473 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -1528,6 +1528,7 @@ exports.QUERY_JOB_COSTING_DETAILS = ` query QUERY_JOB_COSTING_DETAILS($id: uuid! ca_customer_gst dms_allocation cieca_pfl + materials joblines(where: { removed: { _eq: false } }) { id db_ref @@ -1642,6 +1643,8 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT ca_bc_pvrt ca_customer_gst dms_allocation + cieca_pfl + materials joblines(where: {removed: {_eq: false}}) { id db_ref @@ -1867,6 +1870,8 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) { scheduled_in actual_in ca_bc_pvrt + cieca_pfl + materials timetickets { id actualhrs