From 9c3e4b7b83f1a355110d7bc63f93e9c7f8472f9d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Mon, 25 Oct 2021 17:25:29 -0700 Subject: [PATCH] IO-1489 Resolve payables memo for QBO. --- .gitignore | 1 + server/accounting/qbo/qbo-payables.js | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 16e920044..fe7c402dc 100644 --- a/.gitignore +++ b/.gitignore @@ -112,3 +112,4 @@ firebase/.env .elasticbeanstalk/* !.elasticbeanstalk/*.cfg.yml !.elasticbeanstalk/*.global.yml +logs/oAuthClient-log.log diff --git a/server/accounting/qbo/qbo-payables.js b/server/accounting/qbo/qbo-payables.js index ce96dc3de..7d03f4172 100644 --- a/server/accounting/qbo/qbo-payables.js +++ b/server/accounting/qbo/qbo-payables.js @@ -180,9 +180,9 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor) { DocNumber: bill.invoice_number, ...(bill.job.class ? { ClassRef: { Id: classes[bill.job.class] } } : {}), - Memo: `RO ${bill.job.ro_number || ""} OWNER ${bill.job.ownr_fn || ""} ${ - bill.job.ownr_ln || "" - } ${bill.job.ownr_co_nm || ""}`, + PrivateNote: `RO ${bill.job.ro_number || ""} OWNER ${ + bill.job.ownr_fn || "" + } ${bill.job.ownr_ln || ""} ${bill.job.ownr_co_nm || ""}`, Line: bill.billlines.map((il) => generateBillLine( il, @@ -211,7 +211,7 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor) { body: JSON.stringify(billQbo), }); setNewRefreshToken(req.user.email, result); - return result && result.Bill; + return result && result.json && result.json.Bill; } catch (error) { logger.log("qbo-payables-error", "DEBUG", req.user.email, bill.id, { error: @@ -245,6 +245,8 @@ const generateBillLine = ( costCenters ) => { const account = costCenters.find((c) => c.name === billLine.cost_center); + + console.log(account.accountname, accounts[account.accountname]); return { DetailType: "AccountBasedExpenseLineDetail",