Skip to content

Commit

Permalink
Closing out Generic Orders on reset, too.
Browse files Browse the repository at this point in the history
  • Loading branch information
vcardillo committed Dec 1, 2015
1 parent 17d4827 commit 9af607f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/controllers/admin/StatusCtrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 9af607f

Please sign in to comment.