Lookup product barcodes case insensitive (fixes #1734)

This commit is contained in:
Bernd Bestel
2022-01-06 13:42:38 +01:00
parent 8455b5a64a
commit ad0dbdfc22
2 changed files with 2 additions and 1 deletions

View File

@@ -4,3 +4,4 @@
- Fixed that stock entry labels on purchase were printed, even when "No label" was selected (was only a problem when running label printer WebHooks server side)
- Fixed that formatted (HTML) text for the (hidden by default) product description column on the stock overview page was not correctly displayed
- Fixed that numeric and date-time sorting of table columns on the stock entries page did not work correctly (thanks @MasterofJOKers)
- Fixed that the barcode lookup for the "Stock by-barcode" API endpoints was case sensitive

View File

@@ -775,7 +775,7 @@ class StockService extends BaseService
return intval($gc->GetId());
}
$potentialProduct = $this->getDatabase()->product_barcodes()->where('barcode = :1', $barcode)->fetch();
$potentialProduct = $this->getDatabase()->product_barcodes()->where('barcode = :1 COLLATE NOCASE', $barcode)->fetch();
if ($potentialProduct === null)
{
throw new \Exception("No product with barcode $barcode found");