QBO Updates.

This commit is contained in:
Patrick Fic
2022-02-03 11:15:23 -08:00
parent 35ab86c5fd
commit 173e9a278c
2 changed files with 2 additions and 3 deletions

View File

@@ -181,7 +181,7 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor) {
TxnDate: moment(bill.date).format("YYYY-MM-DD"),
//DueDate: bill.due_date && moment(bill.due_date).format("YYYY-MM-DD"),
DocNumber: bill.invoice_number,
...(bill.job.class ? { ClassRef: { Id: classes[bill.job.class] } } : {}),
//...(bill.job.class ? { ClassRef: { Id: classes[bill.job.class] } } : {}),
PrivateNote: `RO ${bill.job.ro_number || ""} OWNER ${
bill.job.ownr_fn || ""
@@ -249,7 +249,6 @@ const generateBillLine = (
) => {
const account = costCenters.find((c) => c.name === billLine.cost_center);
console.log(account.accountname, accounts[account.accountname]);
return {
DetailType: "AccountBasedExpenseLineDetail",

View File

@@ -356,7 +356,7 @@ async function InsertJob(oauthClient, qbo_realmId, req, job, parentTierRef) {
exports.InsertJob = InsertJob;
async function QueryMetaData(oauthClient, qbo_realmId, req) {
const items = await oauthClient.makeApiCall({
url: urlBuilder(qbo_realmId, "query", `select * From Item`),
url: urlBuilder(qbo_realmId, "query", `select * From Item where active=true maxresults 1000`),
method: "POST",
headers: {
"Content-Type": "application/json",