Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/app/api/quickbooks/invoice/invoice.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export class InvoiceService extends BaseService {
amount: parseFloat(itemAmount) / 100,
productDescription: mapping.description || '',
// classRef is optional. A classRef to the mapped QB item is checked every time for each item when creating an invoice.
classRef: intuitItem?.ClassRef,
classRef: intuitItem.ClassRef,
}
}
}
Expand Down Expand Up @@ -326,7 +326,11 @@ export class InvoiceService extends BaseService {
syncLogConditions,
)

return { ref: { value: qbItem.Id }, productDescription }
return {
ref: { value: qbItem.Id },
productDescription,
classRef: qbItem.ClassRef,
}
}

private async prepareLineItemPayload(
Expand Down Expand Up @@ -363,9 +367,9 @@ export class InvoiceService extends BaseService {
// Doc reference: https://developer.intuit.com/app/developer/qbo/docs/workflows/manage-sales-tax-for-us-locales#specifying-sales-tax
value: 'TAX',
},
// classrRef is optional. ClassRef to reference the associated class of the QB item.
// ClassRef is optional. Only include when we have a value, otherwise QB will use the item's default class.
// Doc reference: https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/class
ClassRef: itemRef.classRef,
...(itemRef.classRef && { ClassRef: itemRef.classRef }),
},
Description:
typeof itemRef.productDescription === 'undefined'
Expand Down
Loading