release/2024-11-01 - Misc fixes
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -63,7 +63,7 @@ exports.default = function ({ bodyshop, jobs_by_pk, qbo = false, items, taxCodes
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!account) {
|
if (!account) {
|
||||||
logger.log("qbxml-receivables-no-account", "warn", null, jobline.id, null);
|
logger.log("qbxml-receivables-no-account", "warn", null, jobline.id);
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}`
|
`A matching account does not exist for the part allocation. Center: ${jobline.profitcenter_part}`
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ exports.default = async (req, res) => {
|
|||||||
//For each invoice.
|
//For each invoice.
|
||||||
res.status(200).json(QbXmlToExecute);
|
res.status(200).json(QbXmlToExecute);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("qbxml-payable-error", "ERROR", req.user.email, req.body.billsToQuery, {
|
logger.log("qbxml-payable-error", "ERROR", req?.user?.email, null, {
|
||||||
error: error.message,
|
billsToQuery: req?.body?.billsToQuery,
|
||||||
stack: error.stack
|
error: error?.message,
|
||||||
|
stack: error?.stack
|
||||||
});
|
});
|
||||||
res.status(400).send(JSON.stringify(error));
|
res.status(400).send(JSON.stringify(error));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,9 @@ exports.default = async (req, res) => {
|
|||||||
const client = req.userGraphQLClient;
|
const client = req.userGraphQLClient;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.log("qbxml-payments-create", "DEBUG", req.user.email, req.body.paymentsToQuery, null);
|
logger.log("qbxml-payments-create", "DEBUG", req?.user?.email, null, {
|
||||||
|
paymentsToQuery: req.body?.paymentsToQuery
|
||||||
|
});
|
||||||
|
|
||||||
const result = await client.setHeaders({ Authorization: BearerToken }).request(queries.QUERY_PAYMENTS_FOR_EXPORT, {
|
const result = await client.setHeaders({ Authorization: BearerToken }).request(queries.QUERY_PAYMENTS_FOR_EXPORT, {
|
||||||
payments: paymentsToQuery
|
payments: paymentsToQuery
|
||||||
@@ -62,7 +64,8 @@ exports.default = async (req, res) => {
|
|||||||
|
|
||||||
res.status(200).json(QbXmlToExecute);
|
res.status(200).json(QbXmlToExecute);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("qbxml-payments-error", "error", req.user.email, req.body.paymentsToQuery, {
|
logger.log("qbxml-payments-error", "error", req?.user?.email, null, {
|
||||||
|
paymentsToQuery: req.body?.paymentsToQuery,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -23,7 +23,9 @@ exports.default = async (req, res) => {
|
|||||||
const client = req.userGraphQLClient;
|
const client = req.userGraphQLClient;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
logger.log("qbxml-receivables-create", "DEBUG", req.user.email, req.body.jobIds, null);
|
logger.log("qbxml-receivables-create", "DEBUG", req?.user?.email, null, {
|
||||||
|
jobIds: req?.body?.jobIds
|
||||||
|
});
|
||||||
|
|
||||||
const result = await client
|
const result = await client
|
||||||
.setHeaders({ Authorization: BearerToken })
|
.setHeaders({ Authorization: BearerToken })
|
||||||
@@ -74,7 +76,8 @@ exports.default = async (req, res) => {
|
|||||||
|
|
||||||
res.status(200).json(QbXmlToExecute);
|
res.status(200).json(QbXmlToExecute);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
logger.log("qbxml-receivables-error", "error", req.user.email, req.body.jobIds, {
|
logger.log("qbxml-receivables-error", "error", req?.user?.email, null, {
|
||||||
|
jobIds: req.body?.jobIds,
|
||||||
error: error.message,
|
error: error.message,
|
||||||
stack: error.stack
|
stack: error.stack
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user