From 6afcf82cc4b70721fa1d49b2c59e0d25ea58c56d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 9 Nov 2021 16:04:16 -0800 Subject: [PATCH] IO-1505 Resolve PST exempt exporting to QBO. --- server/accounting/qb-receivables-lines.js | 19 ++++++++++++------- server/graphql-client/queries.js | 3 ++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 2463c471e..c2a271f48 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -76,7 +76,12 @@ exports.default = function ({ { local: false, federal: true, - state: (jobline.db_ref === "900511" || jobline.db_ref === "900510") ? true: jobline.tax_part, + state: + jobs_by_pk.state_tax_rate === 0 + ? false + : jobline.db_ref === "900511" || jobline.db_ref === "900510" + ? true + : jobline.tax_part, }, bodyshop.md_responsibility_centers.sales_tax_codes ); @@ -142,7 +147,7 @@ exports.default = function ({ { local: false, federal: true, - state: true, + state: jobs_by_pk.state_tax_rate === 0 ? false : true, }, bodyshop.md_responsibility_centers.sales_tax_codes ); @@ -204,7 +209,7 @@ exports.default = function ({ { local: false, federal: true, - state: true, + state: jobs_by_pk.state_tax_rate === 0 ? false : true, }, bodyshop.md_responsibility_centers.sales_tax_codes ); @@ -267,7 +272,7 @@ exports.default = function ({ { local: false, federal: true, - state: true, + state: jobs_by_pk.state_tax_rate === 0 ? false : true, }, bodyshop.md_responsibility_centers.sales_tax_codes ); @@ -346,7 +351,7 @@ exports.default = function ({ { local: false, federal: true, - state: true, + state: jobs_by_pk.state_tax_rate === 0 ? false : true, }, bodyshop.md_responsibility_centers.sales_tax_codes ); @@ -394,7 +399,7 @@ exports.default = function ({ { local: false, federal: true, - state: true, + state: jobs_by_pk.state_tax_rate === 0 ? false : true, }, bodyshop.md_responsibility_centers.sales_tax_codes ); @@ -445,7 +450,7 @@ exports.default = function ({ { local: false, federal: true, - state: true, + state: jobs_by_pk.state_tax_rate === 0 ? false : true, }, bodyshop.md_responsibility_centers.sales_tax_codes ); diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index 6227fe773..91f519c5f 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -126,6 +126,7 @@ query QUERY_JOBS_FOR_RECEIVABLES_EXPORT($ids: [uuid!]!) { towing_payable storage_payable adjustment_bottom_line + state_tax_rate owner { accountingid } @@ -242,7 +243,7 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) { } `; - exports.QUERY_JOBS_FOR_PBS_EXPORT = ` +exports.QUERY_JOBS_FOR_PBS_EXPORT = ` query QUERY_JOBS_FOR_PBS_EXPORT($id: uuid!) { jobs_by_pk(id: $id) { id