* @copyright 2001-2014 Oxileo SAS * @license Proprietary - no redistribution without authorization */ class AdminBordereauChronopost extends AdminTab { public function __construct() { $this->table = 'order'; $this->className = 'AdminBordereauChronopost'; $this->view = false; $this->noLink = true; $this->delete = true; $this->colorOnBackground = true; /* // set default filtering state if(!isset($_POST) || !array_key_exists('submitFilter', $_POST)) { $this->_filter=" AND os.`id_order_state` = 3 "; $_POST['orderFilter_os!id_order_state']='3'; } */ $this->_select = ' a.id_order AS id_pdf, CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`, osl.`name` AS `osname`, os.`color`, IF((SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1, 0, 1) as new, (SELECT COUNT(od.`id_order`) FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = a.`id_customer`) LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (oh.`id_order` = a.`id_order`) LEFT JOIN `'._DB_PREFIX_.'order_state` os ON (os.`id_order_state` = oh.`id_order_state`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (os.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)($this->context->language->id).')'; $this->_where = 'AND oh.`id_order_history` = (SELECT MAX(`id_order_history`) FROM `'._DB_PREFIX_.'order_history` moh WHERE moh.`id_order` = a.`id_order` GROUP BY moh.`id_order`) ' .' AND (a.id_carrier='.((int)Configuration::get('CHRONOPOST_CARRIER_ID')) .' OR a.id_carrier='.((int)Configuration::get('CHRONORELAIS_CARRIER_ID')) .' OR a.id_carrier='.((int)Configuration::get('CHRONOEXPRESS_CARRIER_ID')) .' OR a.id_carrier='.((int)Configuration::get('CHRONO10_CARRIER_ID')) .' OR a.id_carrier='.((int)Configuration::get('CHRONO18_CARRIER_ID')) .' OR a.id_carrier='.((int)Configuration::get('CHRONOCLASSIC_CARRIER_ID')) .') '; $statesArray = array(); $states = OrderState::getOrderStates((int)($this->context->language->id)); foreach ($states AS $state) $statesArray[$state['id_order_state']] = $state['name']; $this->fieldsDisplay = array( //'id_pdf' => array('title' => $this->l('Export'), 'callback' => 'selectButton', 'orderby' => false, 'search' => false), 'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 160, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true), 'total_paid' => array('title' => $this->l('Total'), 'width' => 70, 'align' => 'right', 'prefix' => '', 'suffix' => '', 'price' => true, 'currency' => true), 'payment' => array('title' => $this->l('Payment'), 'width' => 100), 'osname' => array('title' => $this->l('Status'), 'widthColumn' => 230, 'type' => 'select', 'select' => $statesArray, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'width' => 200), 'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add') ); parent::__construct(); } public function display() { echo ' '; echo '
N’oubliez pas d\'imprimer le bordereau de remise en deux exemplaires, un doit être remis lors de l\'enlèvement ou du dépôt ; l\'autre est à conserver. Les deux doivent être signés.