You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are using the API to query supplier orders based on the ref_supplier field like this:
https://example.com/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&sqlfilters=t.billed=0 and t.ref_supplier like '%<REF_SUPPLIER>%'
When the <REF_SUPPLIER> happens to contain digits only, however, the requests always produces a 404.
Environment Version
16.0.4
Environment OS
Debian 10
Environment Web server
nginx 1.14
Environment PHP
PHP 7.3
Environment Database
MariaDB 10.3
Environment URL(s)
/api/index.php/supplierorders
Expected and actual behavior
Expected: The requests works regardless whether the query contains digits only or a combination of digits and letters.
Actual: The supplier order is not found, a 404 is produced. A letter (or space) has to be added to ref_supplier in order to find the order.
Steps to reproduce the behavior
Create a supplier order with a ref_supplier of "XYZ Supplier 12345".
Query orders with https://example.com/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&sqlfilters=t.billed=0 and t.ref_supplier like '%12345%' => Nothing found.
Query orders instead with https://example.com/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&sqlfilters=t.billed=0 and t.ref_supplier like '% 12345%' (note the space before 12345) => Order found.
Attached files
No response
The text was updated successfully, but these errors were encountered:
On Dolibarr v18.0.6 you should use a filter such as :
(t.billed%3A%3D%3A0%20and%20t.ref_supplier%3Alike%3A'%2512345%25')
The url request is :
DOLIBARR_URL/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&limit=100&sqlfilters=(t.billed%3A%3D%3A0%20and%20t.ref_supplier%3Alike%3A'%2512345%25')
On Dolibarr v18.0.6 you should use a filter such as : (t.billed%3A%3D%3A0%20and%20t.ref_supplier%3Alike%3A'%2512345%25')
The url request is : DOLIBARR_URL/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&limit=100&sqlfilters=(t.billed%3A%3D%3A0%20and%20t.ref_supplier%3Alike%3A'%2512345%25')
Could check if it works for you ?
Indeed, with the new syntax fetching supplier orders whose supplier refs contain digits only seems to work! Thanks for the hint.
Bug
We are using the API to query supplier orders based on the ref_supplier field like this:
When the <REF_SUPPLIER> happens to contain digits only, however, the requests always produces a 404.
Environment Version
16.0.4
Environment OS
Debian 10
Environment Web server
nginx 1.14
Environment PHP
PHP 7.3
Environment Database
MariaDB 10.3
Environment URL(s)
/api/index.php/supplierorders
Expected and actual behavior
Expected: The requests works regardless whether the query contains digits only or a combination of digits and letters.
Actual: The supplier order is not found, a 404 is produced. A letter (or space) has to be added to ref_supplier in order to find the order.
Steps to reproduce the behavior
https://example.com/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&sqlfilters=t.billed=0 and t.ref_supplier like '%12345%'
=> Nothing found.https://example.com/api/index.php/supplierorders?sortfield=t.rowid&sortorder=ASC&sqlfilters=t.billed=0 and t.ref_supplier like '% 12345%'
(note the space before 12345) => Order found.Attached files
No response
The text was updated successfully, but these errors were encountered: