[-] BO : Fix carrier association listing on warehouse form
This commit is contained in:
@@ -132,12 +132,15 @@ class WarehouseCore extends ObjectModel
|
|||||||
*
|
*
|
||||||
* @return array Ids of the associated carriers
|
* @return array Ids of the associated carriers
|
||||||
*/
|
*/
|
||||||
public function getCarriers()
|
public function getCarriers($return_reference = false)
|
||||||
{
|
{
|
||||||
$ids_carrier = array();
|
$ids_carrier = array();
|
||||||
|
|
||||||
$query = new DbQuery();
|
$query = new DbQuery();
|
||||||
$query->select('c.id_carrier');
|
if ($return_reference)
|
||||||
|
$query->select('wc.id_carrier');
|
||||||
|
else
|
||||||
|
$query->select('c.id_carrier');
|
||||||
$query->from('warehouse_carrier', 'wc');
|
$query->from('warehouse_carrier', 'wc');
|
||||||
$query->innerJoin('carrier', 'c', 'c.id_reference = wc.id_carrier');
|
$query->innerJoin('carrier', 'c', 'c.id_reference = wc.id_carrier');
|
||||||
$query->where($this->def['primary'].' = '.(int)$this->id);
|
$query->where($this->def['primary'].' = '.(int)$this->id);
|
||||||
|
|||||||
@@ -349,7 +349,7 @@ class AdminWarehousesControllerCore extends AdminController
|
|||||||
$ids_shop[] = $shop['id_shop'];
|
$ids_shop[] = $shop['id_shop'];
|
||||||
|
|
||||||
// loads current carriers associated with this warehouse
|
// loads current carriers associated with this warehouse
|
||||||
$carriers = $obj->getCarriers();
|
$carriers = $obj->getCarriers(true);
|
||||||
|
|
||||||
// if an address is available : force specific fields values
|
// if an address is available : force specific fields values
|
||||||
if ($address != null)
|
if ($address != null)
|
||||||
|
|||||||
Reference in New Issue
Block a user