Merged in feature/IO-2927-qbo-usa-gst-itc (pull request #1710)
Feature/IO-2927 qbo usa gst itc IO-2927
This commit is contained in:
@@ -94,7 +94,10 @@ exports.default = async (req, res) => {
|
|||||||
ret.push({
|
ret.push({
|
||||||
billid: bill.id,
|
billid: bill.id,
|
||||||
success: false,
|
success: false,
|
||||||
errorMessage: (error && error.authResponse && error.authResponse.body) || (error && error.message)
|
errorMessage:
|
||||||
|
(error && error.authResponse && error.authResponse.body) ||
|
||||||
|
error.response?.data?.Fault?.Error.map((e) => e.Detail).join(", ") ||
|
||||||
|
(error && error.message)
|
||||||
});
|
});
|
||||||
|
|
||||||
//Add the export log error.
|
//Add the export log error.
|
||||||
@@ -209,7 +212,7 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop)
|
|||||||
AccountBasedExpenseLineDetail: {
|
AccountBasedExpenseLineDetail: {
|
||||||
...(bill.job.class ? { ClassRef: { value: classes[bill.job.class] } } : {}),
|
...(bill.job.class ? { ClassRef: { value: classes[bill.job.class] } } : {}),
|
||||||
AccountRef: {
|
AccountRef: {
|
||||||
value: accounts[bodyshop.md_responsibility_centers.taxes.federal.accountdesc]
|
value: accounts[bodyshop.md_responsibility_centers.taxes.federal_itc.accountdesc]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -274,6 +277,8 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop)
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
|
logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, {
|
||||||
error: error, //(error && error.authResponse && error.authResponse.body) || (error && error.message),
|
error: error, //(error && error.authResponse && error.authResponse.body) || (error && error.message),
|
||||||
|
validationError: JSON.stringify(error?.response?.data),
|
||||||
|
accountmeta: JSON.stringify({ accounts, taxCodes, classes }),
|
||||||
method: "InsertBill"
|
method: "InsertBill"
|
||||||
});
|
});
|
||||||
throw error;
|
throw error;
|
||||||
|
|||||||
@@ -179,7 +179,10 @@ exports.default = async (req, res) => {
|
|||||||
ret.push({
|
ret.push({
|
||||||
jobid: job.id,
|
jobid: job.id,
|
||||||
success: false,
|
success: false,
|
||||||
errorMessage: (error && error.authResponse && error.authResponse.body) || (error && error.message)
|
errorMessage:
|
||||||
|
(error && error.authResponse && error.authResponse.body) ||
|
||||||
|
error.response?.data?.Fault?.Error.map((e) => e.Detail).join(", ") ||
|
||||||
|
(error && error.message)
|
||||||
});
|
});
|
||||||
console.log(error);
|
console.log(error);
|
||||||
logger.log("qbo-receivable-create-error", "ERROR", req.user.email, {
|
logger.log("qbo-receivable-create-error", "ERROR", req.user.email, {
|
||||||
@@ -575,7 +578,9 @@ async function InsertInvoice(oauthClient, qbo_realmId, req, job, bodyshop, paren
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("qbo-receivables-error", "DEBUG", req.user.email, job.id, {
|
logger.log("qbo-receivables-error", "DEBUG", req.user.email, job.id, {
|
||||||
error,
|
error,
|
||||||
method: "InsertOwner"
|
method: "InsertInvoice",
|
||||||
|
validationError: JSON.stringify(error?.response?.data),
|
||||||
|
accountmeta: JSON.stringify({ accounts, taxCodes, classes })
|
||||||
});
|
});
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user