// Some bugs fix

This commit is contained in:
dSevere
2011-12-02 16:22:45 +00:00
parent fc8e67fe37
commit 9ad6e0bfd4
5 changed files with 10 additions and 5 deletions
@@ -49,7 +49,7 @@
<thead> <thead>
<tr> <tr>
<th>{l s='product name'}</th> <th>{l s='Product name'}</th>
<th width="150">{l s='Supplier reference'}</th> <th width="150">{l s='Supplier reference'}</th>
<th width="150">{l s='Unit price tax excluded'}</th> <th width="150">{l s='Unit price tax excluded'}</th>
<th width="150">{l s='Unit price currency'}</th> <th width="150">{l s='Unit price currency'}</th>
+3 -1
View File
@@ -166,7 +166,9 @@ class ProductSupplierCore extends ObjectModel
{ {
$suppliers = new Collection('ProductSupplier'); $suppliers = new Collection('ProductSupplier');
$suppliers->where('a.id_product = '.(int)$id_product); $suppliers->where('a.id_product = '.(int)$id_product);
$suppliers->groupBy('a.id_supplier');
if ($group_by_supplier)
$suppliers->groupBy('a.id_supplier');
return $suppliers; return $suppliers;
} }
+2
View File
@@ -90,6 +90,7 @@ class StockCore extends ObjectModel
public function getFields() public function getFields()
{ {
$this->validateFields(); $this->validateFields();
$fields['id_warehouse'] = (int)$this->id_warehouse; $fields['id_warehouse'] = (int)$this->id_warehouse;
$fields['id_product'] = (int)$this->id_product; $fields['id_product'] = (int)$this->id_product;
$fields['id_product_attribute'] = (int)$this->id_product_attribute; $fields['id_product_attribute'] = (int)$this->id_product_attribute;
@@ -99,6 +100,7 @@ class StockCore extends ObjectModel
$fields['physical_quantity'] = (int)$this->physical_quantity; $fields['physical_quantity'] = (int)$this->physical_quantity;
$fields['usable_quantity'] = (int)$this->usable_quantity; $fields['usable_quantity'] = (int)$this->usable_quantity;
$fields['price_te'] = (float)round($this->price_te, 6); $fields['price_te'] = (float)round($this->price_te, 6);
return $fields; return $fields;
} }
+2 -1
View File
@@ -210,7 +210,8 @@ class StockManagerCore implements StockManagerInterface
$products_pack = Pack::getItems($id_product, (int)Configuration::get('PS_LANG_DEFAULT')); $products_pack = Pack::getItems($id_product, (int)Configuration::get('PS_LANG_DEFAULT'));
foreach ($products_pack as $product_pack) foreach ($products_pack as $product_pack)
{ {
$pack_id_product_attribute = Product::getDefaultAttribute($id_product_attribute, 1); //@TODO is there a better way to retrieve the product attribute assciated to the pack ? //@TODO is there a better way to retrieve the product attribute assciated to the pack ?
$pack_id_product_attribute = Product::getDefaultAttribute($id_product_attribute, 1);
$this->removeProduct($product_pack->id, $pack_id_product_attribute, $product_pack->pack_quantity * $quantity, $warehouse, $id_order); $this->removeProduct($product_pack->id, $pack_id_product_attribute, $product_pack->pack_quantity * $quantity, $warehouse, $id_order);
} }
} }
@@ -1994,7 +1994,7 @@ public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0,
$suppliers_to_associate[] = $supplier['id_supplier']; $suppliers_to_associate[] = $supplier['id_supplier'];
// Delete already associated suppliers if needed // Delete already associated suppliers if needed
foreach ($associated_suppliers as $key => &$associated_supplier) foreach ($associated_suppliers as $key => $associated_supplier)
if (!in_array($associated_supplier->id_supplier, $suppliers_to_associate)) if (!in_array($associated_supplier->id_supplier, $suppliers_to_associate))
{ {
$associated_supplier->delete(); $associated_supplier->delete();
@@ -3266,7 +3266,7 @@ public function getList($id_lang, $orderBy = null, $orderWay = null, $start = 0,
$supplier['is_selected'] = false; $supplier['is_selected'] = false;
$supplier['is_default'] = false; $supplier['is_default'] = false;
foreach ($associated_suppliers as &$associated_supplier) foreach ($associated_suppliers as $associated_supplier)
if ($associated_supplier->id_supplier == $supplier['id_supplier']) if ($associated_supplier->id_supplier == $supplier['id_supplier'])
{ {
$associated_supplier->name = $supplier['name']; $associated_supplier->name = $supplier['name'];