Add department to QBO Payables.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -206,7 +206,14 @@ async function InsertVendorRecord(oauthClient, qbo_realmId, req, bill) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop) {
|
async function InsertBill(
|
||||||
|
oauthClient,
|
||||||
|
qbo_realmId,
|
||||||
|
req,
|
||||||
|
bill,
|
||||||
|
vendor,
|
||||||
|
bodyshop
|
||||||
|
) {
|
||||||
const { accounts, taxCodes, classes } = await QueryMetaData(
|
const { accounts, taxCodes, classes } = await QueryMetaData(
|
||||||
oauthClient,
|
oauthClient,
|
||||||
qbo_realmId,
|
qbo_realmId,
|
||||||
@@ -243,8 +250,7 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop)
|
|||||||
AccountRef: {
|
AccountRef: {
|
||||||
value:
|
value:
|
||||||
accounts[
|
accounts[
|
||||||
bodyshop.md_responsibility_centers.taxes.federal
|
bodyshop.md_responsibility_centers.taxes.federal.accountdesc
|
||||||
.accountdesc
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -286,7 +292,10 @@ async function InsertBill(oauthClient, qbo_realmId, req, bill, vendor, bodyshop)
|
|||||||
)
|
)
|
||||||
? { GlobalTaxCalculation: "TaxExcluded" }
|
? { GlobalTaxCalculation: "TaxExcluded" }
|
||||||
: {}),
|
: {}),
|
||||||
|
...(bodyshop.accountingconfig.qbo_departmentid &&
|
||||||
|
bodyshop.accountingconfig.qbo_departmentid.trim() !== "" && {
|
||||||
|
DepartmentRef: { value: bodyshop.accountingconfig.qbo_departmentid },
|
||||||
|
}),
|
||||||
PrivateNote: `RO ${bill.job.ro_number || ""}`,
|
PrivateNote: `RO ${bill.job.ro_number || ""}`,
|
||||||
Line: lines,
|
Line: lines,
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user