

===============================================================================
User: 12  |  Time: 12:37:48  |  URL: /customers/apple_clinic/POSAjax/searchBarcodeforPOS?barcode=%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C%5C&class_id=1&type=1&customer_id=0&_=1728545132412

Array
(
    [0] => 42000
    [1] => 1064
    [2] => You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'P","1",((substr("\\\\\\\\\\\\\\\\\",8,5)+0))) as unit_qty,
                 ...' at line 18
)

SELECT                                         p.Product_ID AS ID,                                         p.is_rate ,                                         p.Product_Code AS Code,                                         p.Product_Name AS Name,                                         p.Product_Quantity AS Quantity,                                         p.Product_VAT AS VAT,                                         p.vat_percent,p.vat2_percent,                                         p.Category_ID,                                         p.is_tax,p.is_lot,p.is_serial,                                         p.UOM_ID,                                         u.Bar_Code,                                         p.Product_Limit_Discount,                                         u.conversion_amount,def_uom.UOM_Name as default_uom_name,                                         p.is_expiry,p.PLU_Type,p.force_change_price,p.duration_reservation,                                          p.Product_Quantity AS stock_qty,                                         GROUP_CONCAT(uom_from separator "/") AS Product_UOM,                                         if(p.PLU_Type <> "P",0,(substr("\\\\\\\\\\\\\\\\\",8,5)+0)) as unit_price,                                         if(p.PLU_Type <> "P","1",((substr("\\\\\\\\\\\\\\\\\",8,5)+0))) as unit_qty,                                         p.branch_id,                                         p.is_service,p.recipe_qty,def_view_uom.UOM_Name as def_view_uom_name                                     from                                         tbl_stock_products p	                                         inner join tbl_stock_uom def_uom on def_uom.UOM_ID = p.UOM_ID                                         inner join tbl_stock_uom def_view_uom on def_view_uom.UOM_ID = p.default_view_uom_id                                     LEFT JOIN                                         uom_conversions u                                     ON                                          u.Product_ID = p.Product_ID                                     left  join tbl_stock_product_location l                                      on l.Location_Product_ID = p.Product_ID                                      and l.Product_Depot_ID = ""                                     WHERE                                     ((                                         concat(",",u.Bar_Code,",",u.additional_barcodes,",") LIKE "%,\\\\\\\\\\\\\\\\\,%"                                         and p.PLU_Type <> "P"                                     )                                     or                                     (                                         u.Bar_Code = (substr("\\\\\\\\\\\\\\\\\",3,5)+0)                                         and p.PLU_Type = "P"                                     ))                                      and p.Product_Type in(0,1)                                     GROUP BY p.Product_ID                                     order by p.PLU_Type asc /*make priority to non weightable products*/                                 
