IO-256 Add PVRT handling for QBO.

This commit is contained in:
Patrick Fic
2021-09-24 17:17:23 -07:00
parent 8f2b1f0f78
commit dfa9592755
4 changed files with 34 additions and 28 deletions

View File

@@ -15,6 +15,7 @@ const {
} = require("./qbo-callback");
const OAuthClient = require("intuit-oauth");
const CreateInvoiceLines = require("../qb-receivables-lines");
const moment = require("moment");
const GraphQLClient = require("graphql-request").GraphQLClient;
const { generateOwnerTier } = require("../qbxml/qbxml-utils");
@@ -364,28 +365,18 @@ async function InsertInvoice(oauthClient, req, job, bodyshop, parentTierRef) {
});
const invoiceObj = {
// Line: [
// {
// DetailType: "SalesItemLineDetail",
// Amount: 100,
// SalesItemLineDetail: {
// ItemRef: {
// // name: "Services",
// value: "1",
// },
// TaxCodeRef: {
// value: "2",
// },
// Qty: 1,
// UnitPrice: 100,
// },
// },
// ],
Line: InvoiceLineAdd,
TxnDate: moment(job.date_invoiced).format("YYYY-MM-DD"),
DocNumber: job.ro_number,
CustomerRef: {
value: parentTierRef.Id,
},
...(bodyshop.accountingconfig.printlater
? { PrintStatus: "NeedToPrint" }
: {}),
...(bodyshop.accountingconfig.emaillater
? { EmailStatus: "NeedToSend" }
: {}),
};
try {