From ac342b847e434add0d7ef6932d87fbdc01546d7d Mon Sep 17 00:00:00 2001 From: bMancone Date: Wed, 18 Jan 2012 17:29:31 +0000 Subject: [PATCH] // Fixed #PSTEST-518 --- controllers/admin/AdminSupplyOrdersController.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index 197fb5fc0..550dc4cfe 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -359,6 +359,20 @@ class AdminSupplyOrdersControllerCore extends AdminController parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop); + // adds colors depending on the receipt state + if ($order_by == 'quantity_expected') + { + $nb_items = count($this->_list); + for ($i = 0; $i < $nb_items; ++$i) + { + $item = &$this->_list[$i]; + if ($item['quantity_received'] == $item['quantity_expected']) + $item['color'] = '#00bb35'; + else if ($item['quantity_received'] > $item['quantity_expected']) + $item['color'] = '#fb0008'; + } + } + // actions filters on supply orders list if ($this->table == 'supply_order') { @@ -723,6 +737,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $this->className = 'SupplyOrderDetail'; $this->list_simple_header = true; $this->list_no_link = true; + $this->colorOnBackground = true; $this->bulk_actions = array('Update' => array('text' => $this->l('Update selected'), 'confirm' => $this->l('Update selected items?'))); $this->addRowAction('details');