Merged in feature/IO-2793-State-Tax-Null-QBO (pull request #1474)
IO-2793 Correct variables
This commit is contained in:
@@ -71,7 +71,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
{
|
{
|
||||||
local: false,
|
local: false,
|
||||||
federal: InstanceManager({ imex: true, rome: false }),
|
federal: InstanceManager({ imex: true, rome: false }),
|
||||||
state: checkStateTax(jobline, responsibilityCenters.defaults.profits, jobline.profitcenter_part)
|
state: checkStateTax(jobline, jobs_by_pk.parts_tax_rates, responsibilityCenters.defaults.profits, jobline.profitcenter_part)
|
||||||
},
|
},
|
||||||
bodyshop.md_responsibility_centers.sales_tax_codes
|
bodyshop.md_responsibility_centers.sales_tax_codes
|
||||||
);
|
);
|
||||||
@@ -870,7 +870,7 @@ exports.createMultiQbPayerLines = function ({ bodyshop, jobs_by_pk, qbo = false,
|
|||||||
return InvoiceLineAdd;
|
return InvoiceLineAdd;
|
||||||
};
|
};
|
||||||
|
|
||||||
function checkStateTax(jobline, defaultsProfits, profitCenter) {
|
function checkStateTax(jobline, parts_tax_rates, defaultsProfits, profitCenter) {
|
||||||
//Find out CIECA Code based on profitcenter_part to determine if state tax applies or not.
|
//Find out CIECA Code based on profitcenter_part to determine if state tax applies or not.
|
||||||
const cieca_code = Object.keys(defaultsProfits).find(
|
const cieca_code = Object.keys(defaultsProfits).find(
|
||||||
(key) => defaultsProfits[key].toLowerCase() === profitCenter.toLowerCase()
|
(key) => defaultsProfits[key].toLowerCase() === profitCenter.toLowerCase()
|
||||||
@@ -925,8 +925,8 @@ function checkStateTax(jobline, defaultsProfits, profitCenter) {
|
|||||||
// Line is to be sent to QBO as Parts
|
// Line is to be sent to QBO as Parts
|
||||||
else {
|
else {
|
||||||
if (
|
if (
|
||||||
jobs_by_pk.parts_tax_rates[`${cieca_code}`].prt_tax_in === false ||
|
parts_tax_rates[`${cieca_code}`].prt_tax_in === false ||
|
||||||
jobs_by_pk.parts_tax_rates[`${cieca_code}`].prt_tax_rt === 0
|
parts_tax_rates[`${cieca_code}`].prt_tax_rt === 0
|
||||||
) {
|
) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user