This commit is contained in:
Patrick Fic
2021-08-19 17:31:32 -07:00
parent 61a5e180f4
commit 5a4d6d3e8c
21 changed files with 301 additions and 610 deletions

View File

@@ -29,6 +29,14 @@ exports.default = async (req, res) => {
});
try {
logger.log(
"qbxml-receivables-create",
"DEBUG",
req.user.email,
req.body.jobIds,
null
);
const result = await client
.setHeaders({ Authorization: BearerToken })
.request(queries.QUERY_JOBS_FOR_RECEIVABLES_EXPORT, { ids: jobIds });
@@ -96,9 +104,9 @@ exports.default = async (req, res) => {
res.status(200).json(QbXmlToExecute);
} catch (error) {
logger.log(
"qbxml-payments-error",
"qbxml-receivables-error",
"error",
req.body.user,
req.user.email,
req.body.jobIds,
error
);
@@ -304,7 +312,7 @@ const generateInvoiceQbxml = (
// console.log("Done creating hash", JSON.stringify(invoiceLineHash));
if (!hasMapaLine && jobs_by_pk.job_totals.rates.mapa.total.amount > 0) {
console.log("Adding MAPA Line Manually.");
// console.log("Adding MAPA Line Manually.");
const mapaAccountName = responsibilityCenters.defaults.profits.MAPA;
const mapaAccount = responsibilityCenters.profits.find(
@@ -329,7 +337,7 @@ const generateInvoiceQbxml = (
}
if (!hasMashLine && jobs_by_pk.job_totals.rates.mash.total.amount > 0) {
console.log("Adding MASH Line Manually.");
// console.log("Adding MASH Line Manually.");
const mashAccountName = responsibilityCenters.defaults.profits.MASH;
@@ -350,7 +358,7 @@ const generateInvoiceQbxml = (
},
});
} else {
console.log("NO MASH ACCOUNT FOUND!!");
// console.log("NO MASH ACCOUNT FOUND!!");
}
}