// Updated Supply Order + import CSV

This commit is contained in:
bMancone
2011-12-28 15:08:07 +00:00
parent 83440e0742
commit 72b26a5633
2 changed files with 48 additions and 1 deletions
+20
View File
@@ -447,6 +447,26 @@ class SupplyOrderCore extends ObjectModel
return ($res > 0);
}
/**
* For a given reference, returns the corresponding supply order
*
* @param striing $reference
* @return bool|SupplyOrder
*/
public static function getSupplyOrderByReference($reference)
{
if (!$reference)
return false;
$query = new DbQuery();
$query->select('id_supply_order');
$query->from('supply_order', 'so');
$query->where('so.reference = "'.pSQL($match).'"');
$id = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($query);
return (new SupplyOrder((int)$id));
}
/**
* Webservice : gets the ids supply_order_detail associated to this order
* @return array