Created export payables screen + basic invoice exporting BOD-139
This commit is contained in:
@@ -4,6 +4,7 @@ const DineroQbFormat = require("../accounting-constants").DineroQbFormat;
|
||||
const queries = require("../../graphql-client/queries");
|
||||
const Dinero = require("dinero.js");
|
||||
var builder = require("xmlbuilder");
|
||||
const QbXmlUtils = require("./qbxml-utils");
|
||||
require("dotenv").config({
|
||||
path: path.resolve(
|
||||
process.cwd(),
|
||||
@@ -77,7 +78,7 @@ const generateSourceCustomerQbxml = (jobs_by_pk, bodyshop) => {
|
||||
})
|
||||
.end({ pretty: true });
|
||||
|
||||
const customerQbxml_Full = addQbxmlHeader(customerQbxml_partial);
|
||||
const customerQbxml_Full = QbXmlUtils.addQbxmlHeader(customerQbxml_partial);
|
||||
|
||||
return customerQbxml_Full;
|
||||
};
|
||||
@@ -138,7 +139,7 @@ const generateJobQbxml = (jobs_by_pk, bodyshop, isThreeTier, tierLevel) => {
|
||||
})
|
||||
.end({ pretty: true });
|
||||
|
||||
const jobQbxml_Full = addQbxmlHeader(jobQbxml_partial);
|
||||
const jobQbxml_Full = QbXmlUtils.addQbxmlHeader(jobQbxml_partial);
|
||||
console.log("jobQbxml_Full", jobQbxml_Full);
|
||||
return jobQbxml_Full;
|
||||
};
|
||||
@@ -262,7 +263,7 @@ const generateInvoiceQbxml = (jobs_by_pk, bodyshop) => {
|
||||
})
|
||||
.end({ pretty: true });
|
||||
|
||||
const invoiceQbxml_Full = addQbxmlHeader(invoiceQbxml_partial);
|
||||
const invoiceQbxml_Full = QbXmlUtils.addQbxmlHeader(invoiceQbxml_partial);
|
||||
|
||||
return invoiceQbxml_Full;
|
||||
};
|
||||
@@ -291,10 +292,3 @@ const generateInvoiceLine = (job, allocation, responsibilityCenters) => {
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
const addQbxmlHeader = (xml) => {
|
||||
return `<?xml version="1.0" encoding="utf-8"?>
|
||||
<?qbxml version="13.0"?>
|
||||
${xml}
|
||||
`;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user