From 8ec5bc049b8cd339f0462abb7247ca832a792ecd Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 27 Sep 2021 16:50:37 -0700 Subject: [PATCH] Resolve Qb Export not separating for QBO. --- server/accounting/qb-receivables-lines.js | 23 ++++++++++++++------ server/accounting/qbxml/qbxml-receivables.js | 2 +- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/server/accounting/qb-receivables-lines.js b/server/accounting/qb-receivables-lines.js index 22908ca88..1302998a7 100644 --- a/server/accounting/qb-receivables-lines.js +++ b/server/accounting/qb-receivables-lines.js @@ -312,15 +312,24 @@ module.exports = function ({ } } - //Convert the hash to an array. - Object.keys(invoiceLineHash).forEach((key) => { - Object.keys(invoiceLineHash[key]).forEach((key2) => { - InvoiceLineAdd.push({ - ...invoiceLineHash[key][key2], - Amount: invoiceLineHash[key][key2].Amount.toFormat(DineroQbFormat), + if (qbo) { + Object.keys(invoiceLineHash).forEach((key) => { + Object.keys(invoiceLineHash[key]).forEach((key2) => { + InvoiceLineAdd.push({ + ...invoiceLineHash[key][key2], + Amount: invoiceLineHash[key][key2].Amount.toFormat(DineroQbFormat), + }); }); }); - }); + } else { + Object.keys(invoiceLineHash).forEach((key) => { + InvoiceLineAdd.push({ + ...invoiceLineHash[key], + Amount: invoiceLineHash[key].Amount.toFormat(DineroQbFormat), + }); + }); + } + //Convert the hash to an array. //Add Towing, storage and adjustment lines. diff --git a/server/accounting/qbxml/qbxml-receivables.js b/server/accounting/qbxml/qbxml-receivables.js index 1aa506f9a..352088cba 100644 --- a/server/accounting/qbxml/qbxml-receivables.js +++ b/server/accounting/qbxml/qbxml-receivables.js @@ -109,7 +109,7 @@ exports.default = async (req, res) => { "error", req.user.email, req.body.jobIds, - error + {error: (error)} ); res.status(400).send(JSON.stringify(error)); }