Update QBO Export.

This commit is contained in:
Patrick Fic
2022-02-07 08:46:27 -08:00
parent f41277c081
commit 7ef8ef5f2f

View File

@@ -356,7 +356,11 @@ 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 where active=true maxresults 1000`),
url: urlBuilder(
qbo_realmId,
"query",
`select * From Item where active=true maxresults 1000`
),
method: "POST",
headers: {
"Content-Type": "application/json",
@@ -431,7 +435,7 @@ async function InsertInvoice(
qbo: true,
items,
taxCodes,
classes
classes,
});
const invoiceObj = {
@@ -442,7 +446,9 @@ async function InsertInvoice(
CustomerMemo: {
value: `${job.clm_no ? `Claim No: ${job.clm_no}` : ``}${
job.po_number ? `PO No: ${job.po_number}` : ``
}`.trim(),
} Vehicle:${job.v_model_yr || ""} ${job.v_make_desc || ""} ${
job.v_model_desc || ""
} ${job.v_vin || ""} ${job.plate_no || ""} `.trim(),
},
CustomerRef: {
value: parentTierRef.Id,