IO-256 Add PVRT handling for QBO.
This commit is contained in:
@@ -521,7 +521,31 @@ module.exports = function ({
|
||||
const { ca_bc_pvrt } = jobs_by_pk;
|
||||
if (ca_bc_pvrt) {
|
||||
if (qbo) {
|
||||
// do qbo
|
||||
InvoiceLineAdd.push({
|
||||
DetailType: "SalesItemLineDetail",
|
||||
Amount: Dinero({ amount: (ca_bc_pvrt || 0) * 100 }).toFormat(
|
||||
DineroQbFormat
|
||||
),
|
||||
SalesItemLineDetail: {
|
||||
ItemRef: {
|
||||
value: items["PVRT"],
|
||||
},
|
||||
Qty: 1,
|
||||
TaxCodeRef: {
|
||||
value:
|
||||
taxCodes[
|
||||
findTaxCode(
|
||||
{
|
||||
local: false,
|
||||
federal: false,
|
||||
state: false,
|
||||
},
|
||||
bodyshop.md_responsibility_centers.sales_tax_codes
|
||||
)
|
||||
],
|
||||
},
|
||||
},
|
||||
});
|
||||
} else {
|
||||
InvoiceLineAdd.push({
|
||||
ItemRef: {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user