From 9af607fbb739a8bb6a3c7dc24fe3a24aa5eaf2bf Mon Sep 17 00:00:00 2001 From: Vincent Cardillo Date: Tue, 1 Dec 2015 22:32:30 +0000 Subject: [PATCH] Closing out Generic Orders on reset, too. --- app/controllers/admin/StatusCtrl.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/StatusCtrl.php b/app/controllers/admin/StatusCtrl.php index 71d15ec..2198654 100755 --- a/app/controllers/admin/StatusCtrl.php +++ b/app/controllers/admin/StatusCtrl.php @@ -54,9 +54,13 @@ public function getReset() { // Take all drivers off shift DB::update('update Driver set on_shift = 0, order_queue = NULL', array()); - // Close any open orders + // Close any open Orders DB::update('update OrderStatus set `status` = "Delivered" where `status` IN (?,?,?) AND fk_Driver IS NOT NULL', array('Open', 'En Route', 'Assigned')); DB::update('update OrderStatus set `status` = "Cancelled" where `status` IN (?,?,?) AND fk_Driver IS NULL', array('Open', 'En Route', 'Assigned')); + + // Close any open generic_Orders + DB::update('update generic_Order set `status` = "Delivered" where `status` IN (?,?,?) AND fk_Driver IS NOT NULL', array('Open', 'En Route', 'Assigned')); + DB::update('update generic_Order set `status` = "Cancelled" where `status` IN (?,?,?) AND fk_Driver IS NULL', array('Open', 'En Route', 'Assigned')); return Redirect::back() ->with('msg',