IO-1336 Resolve issues with QB Export of towing.

This commit is contained in:
Patrick Fic
2021-08-30 16:59:15 -07:00
parent 901c64ed85
commit cb76e2dcde

View File

@@ -394,11 +394,15 @@ const generateInvoiceQbxml = (
if (jobs_by_pk.towing_payable && jobs_by_pk.towing_payable !== 0) { if (jobs_by_pk.towing_payable && jobs_by_pk.towing_payable !== 0) {
InvoiceLineAdd.push({ InvoiceLineAdd.push({
ItemRef: { ItemRef: {
FullName: responsibilityCenters.defaults.profits["TOW"].accountitem, FullName: responsibilityCenters.profits.find(
(c) => c.name === responsibilityCenters.defaults.profits["TOW"]
).accountitem,
}, },
Desc: responsibilityCenters.defaults.profits["TOW"].accountdesc, Desc: "Towing",
Quantity: 1, Quantity: 1,
Amount: Dinero(jobs_by_pk.towing_payable).toFormat(DineroQbFormat), Amount: Dinero({
amount: Math.round((jobs_by_pk.towing_payable || 0) * 100),
}).toFormat(DineroQbFormat),
SalesTaxCodeRef: { SalesTaxCodeRef: {
FullName: "E", FullName: "E",
}, },
@@ -407,11 +411,15 @@ const generateInvoiceQbxml = (
if (jobs_by_pk.storage_payable && jobs_by_pk.storage_payable !== 0) { if (jobs_by_pk.storage_payable && jobs_by_pk.storage_payable !== 0) {
InvoiceLineAdd.push({ InvoiceLineAdd.push({
ItemRef: { ItemRef: {
FullName: responsibilityCenters.defaults.profits["TOW"].accountitem, FullName: responsibilityCenters.profits.find(
(c) => c.name === responsibilityCenters.defaults.profits["TOW"]
).accountitem,
}, },
Desc: responsibilityCenters.defaults.profits["TOW"].accountdesc, Desc: "Storage",
Quantity: 1, Quantity: 1,
Amount: Dinero(jobs_by_pk.storage_payable).toFormat(DineroQbFormat), Amount: Dinero({
amount: Math.round((jobs_by_pk.storage_payable || 0) * 100),
}).toFormat(DineroQbFormat),
SalesTaxCodeRef: { SalesTaxCodeRef: {
FullName: "E", FullName: "E",
}, },
@@ -423,13 +431,15 @@ const generateInvoiceQbxml = (
) { ) {
InvoiceLineAdd.push({ InvoiceLineAdd.push({
ItemRef: { ItemRef: {
FullName: responsibilityCenters.defaults.profits["TOW"].accountitem, FullName: responsibilityCenters.profits.find(
(c) => c.name === responsibilityCenters.defaults.profits["PAO"]
).accountitem,
}, },
Desc: responsibilityCenters.defaults.profits["TOW"].accountdesc, Desc: "Adjustment",
Quantity: 1, Quantity: 1,
Amount: Dinero(jobs_by_pk.adjustment_bottom_line).toFormat( Amount: Dinero({
DineroQbFormat amount: Math.round((jobs_by_pk.adjustment_bottom_line || 0) * 100),
), }).toFormat(DineroQbFormat),
SalesTaxCodeRef: { SalesTaxCodeRef: {
FullName: "E", FullName: "E",
}, },