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

@@ -7,7 +7,6 @@ var builder = require("xmlbuilder2");
const QbXmlUtils = require("./qbxml-utils");
const moment = require("moment");
const logger = require("../../utils/logger");
require("dotenv").config({
path: path.resolve(
process.cwd(),
@@ -26,6 +25,13 @@ exports.default = async (req, res) => {
});
try {
logger.log(
"qbxml-payable-create",
"DEBUG",
req.user.email,
req.body.billsToQuery
);
const result = await client
.setHeaders({ Authorization: BearerToken })
.request(queries.QUERY_BILLS_FOR_PAYABLES_EXPORT, {
@@ -43,15 +49,14 @@ exports.default = async (req, res) => {
});
//For each invoice.
res.status(200).json(QbXmlToExecute);
} catch (error) {
logger.log(
"qbxml-payable-error",
"error",
req.body.user,
"ERROR",
req.user.email,
req.body.billsToQuery,
error
{ error }
);
res.status(400).send(JSON.stringify(error));
}
@@ -119,13 +124,6 @@ const generateBillLine = (billLine, responsibilityCenters, jobClass) => {
};
};
// [
// {
// AccountRef: { FullName: "BODY SHOP COST:SUBLET" },
// Amount: invoice.amount,
// },
// ],
const findTaxCode = (billLine, taxcode) => {
const {
applicable_taxes: { local, state, federal },