);
return $this->update_databases($company, $updates, $check_only)
+ && update_order_detail_defaults(true)
&& update_queue_quantities()
&& update_qoh_for_item()
- && update_order_detail_defaults(true)
;
}
NATURAL JOIN ".TB_PREF."sales_orders
WHERE stk_code = \"$stock_id\"
AND quantity > qty_sent
- ORDER BY IF(hold_until_date < NOW(), 1, 0), IF(priority IS NULL, CONCAT(ord_date, ' 23:59:59'), priority)
+ ORDER BY IF(expiry_date < NOW(), 1, 0), IF(priority IS NULL, CONCAT(ord_date, ' 23:59:59'), priority), hold_until_date, id
) AS d
";