Merged in feature/IO-2854-ProManager-Profile-Discounts (pull request #1564)
Correct query and object call
This commit is contained in:
@@ -719,11 +719,11 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Handle insurance profile adjustments for Labor and Materials
|
//Handle insurance profile adjustments for Labor and Materials
|
||||||
Object.keys(job_totals.rate).forEach((key) => {
|
Object.keys(job_totals.rates).forEach((key) => {
|
||||||
if (
|
if (
|
||||||
job_totals.rate[key] &&
|
job_totals.rates[key] &&
|
||||||
job_totals.rate[key].adjustment &&
|
job_totals.rates[key].adjustment &&
|
||||||
job_totals.rate[key].adjustment.isZero() === false
|
job_totals.rates[key].adjustment.isZero() === false
|
||||||
) {
|
) {
|
||||||
if (qbo) {
|
if (qbo) {
|
||||||
//Going to always assume that we need to apply GST and PST for labor.
|
//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];
|
: taxCodes[taxAccountCode];
|
||||||
InvoiceLineAdd.push({
|
InvoiceLineAdd.push({
|
||||||
DetailType: "SalesItemLineDetail",
|
DetailType: "SalesItemLineDetail",
|
||||||
Amount: Dinero(job_totals.rate[key]).adjustment.toFormat(DineroQbFormat),
|
Amount: Dinero(job_totals.rates[key]).adjustment.toFormat(DineroQbFormat),
|
||||||
Description: `${account.accountdesc} - Adjustment`,
|
Description: `${account.accountdesc} - Adjustment`,
|
||||||
SalesItemLineDetail: {
|
SalesItemLineDetail: {
|
||||||
...(jobs_by_pk.class ? { ClassRef: { value: classes[jobs_by_pk.class] } } : {}),
|
...(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",
|
Desc: "Storage",
|
||||||
Quantity: 1,
|
Quantity: 1,
|
||||||
Amount: Dinero(job_totals.rate[key]).adjustment.toFormat(DineroQbFormat),
|
Amount: Dinero(job_totals.rates[key]).adjustment.toFormat(DineroQbFormat),
|
||||||
SalesTaxCodeRef: {
|
SalesTaxCodeRef: {
|
||||||
FullName: bodyshop.md_responsibility_centers.taxes.itemexemptcode || "NON"
|
FullName: bodyshop.md_responsibility_centers.taxes.itemexemptcode || "NON"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ function calculateAllocations(connectionData, job) {
|
|||||||
});
|
});
|
||||||
//profile level adjustments for labor and materials
|
//profile level adjustments for labor and materials
|
||||||
Object.keys(job.job_totals.rates).forEach((key) => {
|
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 accountName = selectedDmsAllocationConfig.profits[key.toUpperCase()];
|
||||||
const otherAccount = bodyshop.md_responsibility_centers.profits.find((c) => c.name === accountName);
|
const otherAccount = bodyshop.md_responsibility_centers.profits.find((c) => c.name === accountName);
|
||||||
if (otherAccount) {
|
if (otherAccount) {
|
||||||
|
|||||||
@@ -1528,6 +1528,7 @@ exports.QUERY_JOB_COSTING_DETAILS = ` query QUERY_JOB_COSTING_DETAILS($id: uuid!
|
|||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
dms_allocation
|
dms_allocation
|
||||||
cieca_pfl
|
cieca_pfl
|
||||||
|
materials
|
||||||
joblines(where: { removed: { _eq: false } }) {
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
db_ref
|
db_ref
|
||||||
@@ -1642,6 +1643,8 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT
|
|||||||
ca_bc_pvrt
|
ca_bc_pvrt
|
||||||
ca_customer_gst
|
ca_customer_gst
|
||||||
dms_allocation
|
dms_allocation
|
||||||
|
cieca_pfl
|
||||||
|
materials
|
||||||
joblines(where: {removed: {_eq: false}}) {
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
id
|
id
|
||||||
db_ref
|
db_ref
|
||||||
@@ -1867,6 +1870,8 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
|||||||
scheduled_in
|
scheduled_in
|
||||||
actual_in
|
actual_in
|
||||||
ca_bc_pvrt
|
ca_bc_pvrt
|
||||||
|
cieca_pfl
|
||||||
|
materials
|
||||||
timetickets {
|
timetickets {
|
||||||
id
|
id
|
||||||
actualhrs
|
actualhrs
|
||||||
|
|||||||
Reference in New Issue
Block a user