Merge branch 'develop' of gitlab.antadis.net:dev-antadis/bebeboutik into develop
This commit is contained in:
commit
92a15a42cf
@ -37,6 +37,7 @@ class AdminOrders extends AdminTab
|
||||
$this->colorOnBackground = true;
|
||||
$this->_select = '
|
||||
a.id_order AS id_pdf,
|
||||
a.id_carrier,
|
||||
CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) AS `customer`,
|
||||
osl.`name` AS `osname`,
|
||||
os.`color`,
|
||||
@ -73,13 +74,26 @@ class AdminOrders extends AdminTab
|
||||
|
||||
foreach ($states AS $state)
|
||||
$statesArray[$state['id_order_state']] = $state['name'];
|
||||
|
||||
$carriers = Db::getInstance()->ExecuteS('
|
||||
SELECT c.`id_carrier`, IF(c.`name` = "0", "'.Configuration::get('PS_SHOP_NAME').'", c.`name`) AS `name`'.($this->cursale !== NULL? ', (
|
||||
SELECT IFNULL(p.`id_sale`, NULL) FROM `'._DB_PREFIX_.'privatesale_carrier` p WHERE c.`id_carrier` = p.`id_carrier` AND p.`id_sale` = '.$this->cursale->id.'
|
||||
) AS `id_sale`': '').'
|
||||
FROM `'._DB_PREFIX_.'carrier` c
|
||||
WHERE c.`deleted` != 1 AND c.active =1
|
||||
');
|
||||
$carriersArray = array();
|
||||
foreach ($carriers as $row) {
|
||||
$carriersArray[(int)$row['id_carrier']] = $row['name'];
|
||||
}
|
||||
$this->fieldsDisplay = array(
|
||||
'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'new' => array('title' => $this->l('New'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'filter_key' => 'new', 'tmpTableFilter' => true, 'icon' => array(0 => 'blank.gif', 1 => 'news-new.gif'), 'orderby' => false),
|
||||
'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 160, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true),
|
||||
'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 100, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true),
|
||||
'total_paid' => array('title' => $this->l('Total'), 'width' => 70, 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'price' => true, 'currency' => true),
|
||||
'payment' => array('title' => $this->l('Payment'), 'width' => 100),
|
||||
'payment' => array('title' => $this->l('Payment'), 'width' => 80),
|
||||
'osname' => array('title' => $this->l('Status'), 'widthColumn' => 230, 'type' => 'select', 'select' => $statesArray, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'width' => 200),
|
||||
'id_carrier' => array('title' => $this->l('Carrier'), 'align' => 'center', 'width' => 80, 'callback' => 'printCarrier', 'orderby' => false, 'type' => 'select', 'select' => $carriersArray, 'filter_key' => 'a!id_carrier', 'filter_type' => 'int'),
|
||||
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add'),
|
||||
//'mixed' => array('title' => $this->l('Mixed'), 'callback' => 'printMixedSale', 'orderby' => false, 'search' => false),
|
||||
'id_pdf' => array('title' => $this->l('PDF'), 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false),
|
||||
|
@ -16,6 +16,18 @@ class Order extends OrderCore {
|
||||
return '<img src="/img/flags/'.(int) $value.'.png" alt="" />';
|
||||
}
|
||||
|
||||
public function printCarrier($value, $params)
|
||||
{
|
||||
$laposte_carriers = unserialize(Configuration::get('LAPOSTEWS_CARRIERS', serialize(array())));
|
||||
$mondialrelay_carriers = unserialize(Configuration::get('MONDIALRELAYWS_CARRIERS', serialize(array())));
|
||||
$carriers_drop = explode(',',Configuration::get('ANT_CARRIER_DROP'));
|
||||
if(in_array($value,$mondialrelay_carriers)){
|
||||
return '<img width="18px" src="/img/carriers/logo_mr.png" alt="" />';
|
||||
}elseif(in_array($value,$laposte_carriers) || in_array($value,$carriers_drop)){
|
||||
return '<img width="18px" src="/img/carriers/logo_socol.png" alt="" />';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function getTotalbyDate($date_start, $date_end, $state = 0){
|
||||
if($state == 0){
|
||||
|
Loading…
Reference in New Issue
Block a user