Payables bug fixes for class & bill number IO-742
This commit is contained in:
@@ -63,12 +63,16 @@ const generateBill = (bill) => {
|
||||
TxnDate: moment(bill.date).format("YYYY-MM-DD"),
|
||||
DueDate:
|
||||
bill.due_date && moment(bill.due_date).format("YYYY-MM-DD"),
|
||||
RefNumber: bill.bill_number,
|
||||
RefNumber: bill.invoice_number,
|
||||
Memo: `RO ${bill.job.ro_number || ""} OWNER ${
|
||||
bill.job.ownr_fn || ""
|
||||
} ${bill.job.ownr_ln || ""} ${bill.job.ownr_co_nm || ""}`,
|
||||
ExpenseLineAdd: bill.billlines.map((il) =>
|
||||
generateBillLine(il, bill.job.bodyshop.md_responsibility_centers)
|
||||
generateBillLine(
|
||||
il,
|
||||
bill.job.bodyshop.md_responsibility_centers,
|
||||
bill.job.class
|
||||
)
|
||||
),
|
||||
},
|
||||
},
|
||||
@@ -90,11 +94,7 @@ const generateBill = (bill) => {
|
||||
return billQbxml_Full;
|
||||
};
|
||||
|
||||
const generateBillLine = (billLine, responsibilityCenters) => {
|
||||
console.log(
|
||||
" findTaxCode(billLine, responsibilityCenters.sales_tax_codes)",
|
||||
findTaxCode(billLine, responsibilityCenters.sales_tax_codes)
|
||||
);
|
||||
const generateBillLine = (billLine, responsibilityCenters, jobClass) => {
|
||||
return {
|
||||
AccountRef: {
|
||||
FullName: responsibilityCenters.costs.find(
|
||||
@@ -104,6 +104,7 @@ const generateBillLine = (billLine, responsibilityCenters) => {
|
||||
Amount: Dinero({
|
||||
amount: Math.round(billLine.actual_cost * 100),
|
||||
}).toFormat(DineroQbFormat),
|
||||
...(jobClass ? { ClassRef: { FullName: jobClass } } : {}),
|
||||
SalesTaxCodeRef: {
|
||||
FullName: findTaxCode(billLine, responsibilityCenters.sales_tax_codes),
|
||||
},
|
||||
|
||||
@@ -118,6 +118,7 @@ query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
||||
federal_tax_rate
|
||||
invoice_number
|
||||
is_credit_memo
|
||||
invoice_number
|
||||
job {
|
||||
id
|
||||
ro_number
|
||||
@@ -125,6 +126,7 @@ query QUERY_BILLS_FOR_PAYABLES_EXPORT($bills: [uuid!]!) {
|
||||
ownr_fn
|
||||
ownr_ln
|
||||
ownr_co_nm
|
||||
class
|
||||
bodyshop{
|
||||
md_responsibility_centers
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user