- πΊπΈUnited States mradcliffe USA
I'm sorry I never got to this. Currently this got switched to using the order entity id in 8.x-1.x and 2.0.x.
Hi there.
I worked with this module some time ago, it did the job almost perfect, but I noticed one annoying bug.
function commerce_xero_get_invoice() never returns existing invoice and always create new one in the xero system. This happens because when you try to query the invoice you use the following code:
$invoice = xero_query('get', 'Invoices', FALSE, FALSE, array('Reference' => $order->order_number->value()));
And when you create new invoice you use the following one:
$invoice['Invoice']['Reference'] = t('Order #@num', array('@num' => $order->order_number->value()));
This cause difference in reference ID used in query and in an invoice creation and that's why query always return nothing.
I've tried to change invoice querying code to
$invoice = xero_query('get', 'Invoices', FALSE, FALSE, array('Reference' => t('Order #@num', array('@num' => $order->order_number->value())));
but this caused some error, so I've got rid from translatable string in reference field at all (See patch attached).
I'm not very familiar with the Xero and probably missed something, so feel free to suggest better way.
Closed: outdated
1.0
Code
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
I'm sorry I never got to this. Currently this got switched to using the order entity id in 8.x-1.x and 2.0.x.