// Improved StockInstantState / StockMvt
This commit is contained in:
@@ -312,7 +312,7 @@ class AdminImportControllerCore extends AdminController
|
|||||||
//Overwrite validators AS name is not MultiLangField
|
//Overwrite validators AS name is not MultiLangField
|
||||||
self::$validators = array(
|
self::$validators = array(
|
||||||
'description' => array('AdminImportController', 'createMultiLangField'),
|
'description' => array('AdminImportController', 'createMultiLangField'),
|
||||||
'description_short' => array('AdminImportController', 'createMultiLangField'),
|
'short_description' => array('AdminImportController', 'createMultiLangField'),
|
||||||
'meta_title' => array('AdminImportController', 'createMultiLangField'),
|
'meta_title' => array('AdminImportController', 'createMultiLangField'),
|
||||||
'meta_keywords' => array('AdminImportController', 'createMultiLangField'),
|
'meta_keywords' => array('AdminImportController', 'createMultiLangField'),
|
||||||
'meta_description' => array('AdminImportController', 'createMultiLangField'),
|
'meta_description' => array('AdminImportController', 'createMultiLangField'),
|
||||||
|
|||||||
@@ -202,6 +202,8 @@ class AdminStockInstantStateControllerCore extends AdminController
|
|||||||
$query->select('SUM(price_te * physical_quantity) as valuation');
|
$query->select('SUM(price_te * physical_quantity) as valuation');
|
||||||
$query->from('stock');
|
$query->from('stock');
|
||||||
$query->where('id_product = '.(int)$item['id_product'].' AND id_product_attribute = '.(int)$item['id_product_attribute']);
|
$query->where('id_product = '.(int)$item['id_product'].' AND id_product_attribute = '.(int)$item['id_product_attribute']);
|
||||||
|
if ($this->getCurrentCoverageWarehouse() != -1)
|
||||||
|
$query->where('id_warehouse = '.(int)$this->getCurrentCoverageWarehouse());
|
||||||
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
|
$res = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($query);
|
||||||
|
|
||||||
$item['physical_quantity'] = $res['physical_quantity'];
|
$item['physical_quantity'] = $res['physical_quantity'];
|
||||||
|
|||||||
@@ -61,6 +61,12 @@ class AdminStockMvtControllerCore extends AdminController
|
|||||||
'title' => $this->l('Name'),
|
'title' => $this->l('Name'),
|
||||||
'havingFilter' => true
|
'havingFilter' => true
|
||||||
),
|
),
|
||||||
|
'warehouse_name' => array(
|
||||||
|
'title' => $this->l('Warehouse'),
|
||||||
|
'havingFilter' => false,
|
||||||
|
'orderby' => true,
|
||||||
|
'search' => false,
|
||||||
|
),
|
||||||
'sign' => array(
|
'sign' => array(
|
||||||
'title' => $this->l('Sign'),
|
'title' => $this->l('Sign'),
|
||||||
'width' => 100,
|
'width' => 100,
|
||||||
@@ -123,12 +129,13 @@ class AdminStockMvtControllerCore extends AdminController
|
|||||||
// overrides select
|
// overrides select
|
||||||
$this->_select = '
|
$this->_select = '
|
||||||
CONCAT(pl.name, \' \', GROUP_CONCAT(IFNULL(al.name, \'\'), \'\')) product_name,
|
CONCAT(pl.name, \' \', GROUP_CONCAT(IFNULL(al.name, \'\'), \'\')) product_name,
|
||||||
CONCAT(a.employee_lastname, \' \', a.employee_firstname) AS employee,
|
CONCAT(a.employee_lastname, \' \', a.employee_firstname) as employee,
|
||||||
mrl.name AS reason,
|
mrl.name as reason,
|
||||||
stock.reference AS product_reference,
|
stock.reference as product_reference,
|
||||||
stock.ean13 AS product_ean13,
|
stock.ean13 as product_ean13,
|
||||||
stock.upc AS product_upc,
|
stock.upc as product_upc,
|
||||||
w.id_currency AS id_currency';
|
w.id_currency as id_currency,
|
||||||
|
w.name as warehouse_name';
|
||||||
|
|
||||||
// overrides join
|
// overrides join
|
||||||
$this->_join = 'INNER JOIN '._DB_PREFIX_.'stock stock ON a.id_stock = stock.id_stock
|
$this->_join = 'INNER JOIN '._DB_PREFIX_.'stock stock ON a.id_stock = stock.id_stock
|
||||||
|
|||||||
Reference in New Issue
Block a user