IO-233 CDK Shop Config

This commit is contained in:
Patrick Fic
2021-08-10 08:40:38 -07:00
parent ac18e78897
commit 124d68ef68
24 changed files with 2540 additions and 816 deletions

View File

@@ -6,6 +6,7 @@ const Dinero = require("dinero.js");
var builder = require("xmlbuilder2");
const QbXmlUtils = require("./qbxml-utils");
const moment = require("moment");
const logger = require("../../utils/logger");
require("dotenv").config({
path: path.resolve(
@@ -45,7 +46,13 @@ exports.default = async (req, res) => {
res.status(200).json(QbXmlToExecute);
} catch (error) {
console.log("error", error);
logger.log(
"qbxml-payable-error",
"error",
req.body.user,
req.body.billsToQuery,
error
);
res.status(400).send(JSON.stringify(error));
}
};
@@ -89,7 +96,6 @@ const generateBill = (bill) => {
.end({ pretty: true });
const billQbxml_Full = QbXmlUtils.addQbxmlHeader(billQbxml_partial);
console.log("generateBill -> billQbxml_Full", billQbxml_Full);
return billQbxml_Full;
};
@@ -131,7 +137,6 @@ const findTaxCode = (billLine, taxcode) => {
!!t.federal === !!federal
);
if (t.length === 1) {
console.log(t);
return t[0].code;
} else if (t.length > 1) {
return "Multiple Tax Codes Match";