

===============================================================================
User: 17  |  Time: 09:31:43  |  URL: /customers/apple_clinic/Inventory

Array
(
    [0] => HY000
    [1] => 2013
    [2] => Lost connection to server during query
)

SELECT             trans.Transaction_ID,             trans.Product_ID,             (                 trans.Product_Quantity / products.default_view_rate             ) AS Product_Quantity,             trans.lot_nb,             trans.serial_nb,             SUM(                 IF(                     trans.Operation_Type = "-",                     trans.Product_Quantity *(-1),                     trans.Product_Quantity                 ) / products.default_view_rate             ) AS sum_quantity,             trans.expiry_date,             products.Product_Code,             products.Product_Name,             products.Category_ID,             uom.UOM_Name,             Operation_Type         FROM             tbl_stock_product_transactions trans         INNER JOIN tbl_stock_products products USING(Product_id)         INNER JOIN tbl_stock_uom uom ON             products.default_view_uom_id = uom.UOM_ID         WHERE             trans.expiry_date <> ""  and CURDATE() >= DATE_SUB(trans.expiry_date, INTERVAL 10 DAY)         GROUP BY              trans.Product_ID,             trans.expiry_date         HAVING             sum_quantity <> 0


===============================================================================
User: 17  |  Time: 09:31:43  |  URL: /customers/apple_clinic/Inventory

Array
(
    [0] => HY000
    [1] => 2006
    [2] => Server has gone away
)

SELECT             trans.Transaction_ID,             trans.Product_ID,             (                 trans.Product_Quantity / products.default_view_rate             ) AS Product_Quantity,             trans.lot_nb,             trans.serial_nb,             SUM(                 IF(                     trans.Operation_Type = "-",                     trans.Product_Quantity *(-1),                     trans.Product_Quantity                 ) / products.default_view_rate             ) AS sum_quantity,             trans.expiry_date,             products.Product_Code,             products.Product_Name,             products.Category_ID,             uom.UOM_Name,             Operation_Type         FROM             tbl_stock_product_transactions trans         INNER JOIN tbl_stock_products products USING(Product_id)         INNER JOIN tbl_stock_uom uom ON             products.default_view_uom_id = uom.UOM_ID         WHERE             trans.expiry_date <> ""  and CURDATE() >= DATE_SUB(trans.expiry_date, INTERVAL 10 DAY)         GROUP BY              trans.Product_ID,             trans.expiry_date         HAVING             sum_quantity <> 0


===============================================================================
User: 17  |  Time: 09:31:43  |  URL: /customers/apple_clinic/Inventory

Array
(
    [0] => HY000
    [1] => 2006
    [2] => Server has gone away
)

SELECT                                         o.Organization_ID,                                         o.Organization_Name,                                         o.Organization_Legal_Name,                                         o.Organization_Commercial_Registry,                                         o.Organization_Business_Line,                                          o.Organization_Building_no,                                         o.Organization_Street_no,                                         o.Organization_District,                                         o.edit_Organization_Postal_Code,                                         o.Organization_Additional_no,                                         o.Organization_vat_num,                                         o.organization_Other_Seller_ID,                                          o.org_address_ar,                                         o.org_address_en,                                         o.org_cr_en,                                         o.org_vat_en,                                         o.org_phone_en,                                         o.organiaztion_name_en,                                          o.org_des_ar,                                         o.org_des_en,                                         o.org_logo,                                           o.Organization_Phone,                                         o.Organization_Email,                                         o.Organization_Fax,                                         o.VAT_Type_ID,                                         t.Organization_Type_Name,                                         l.Organization_Legal_Entity_Name,                                         p.*,                                         f.*,                                         h.*,                                         ct.Name as city_name,                                         ct.ID ,                                         ct.CountryCode,                                         ct.District,                                         ct.Population,                                         c.*,                                         b.*                                     FROM                                         tbl_organization o                                     LEFT JOIN                                         tbl_organization_legal_entity l                                     ON                                         l.Organization_Legal_Entity_ID = o.Organization_Legal_Entity_ID                                     LEFT JOIN                                         tbl_organization_type t                                     ON                                         t.Organization_Type_ID = o.Organization_Type_ID                                     LEFT JOIN                                         tbl_organization_postal_address p                                     ON                                         p.Organization_ID = o.Organization_ID                                     LEFT JOIN                                         tbl_organization_financial_settings f                                     ON                                         f.Organization_ID = o.Organization_ID                                     LEFT JOIN                                         tbl_organization_social_links h                                     ON                                         h.Organization_ID = o.Organization_ID                                     LEFT JOIN                                         tbl_all_cities ct                                     ON                                         p.Organization_City = ct.ID                                     LEFT JOIN                                         tbl_all_countries c                                     ON                                         p.Organization_Country = c.Country_ID                                     LEFT JOIN                                         tbl_accounting_bank_accounts b                                     ON                                         b.Bank_Account_ID = f.Bank_Account_ID                 
