Fix: la variable stock_reel n'était pas remise à 0

This commit is contained in:
Regis Houssin 2007-11-12 19:02:37 +00:00
parent 62cac982cb
commit cb023f4345

View File

@ -63,6 +63,7 @@ class Product extends CommonObject
//! Type 0 for regural product, 1 for service, 2 for assembly kit, 3 for stock kit //! Type 0 for regural product, 1 for service, 2 for assembly kit, 3 for stock kit
var $type; var $type;
var $typestring; var $typestring;
var $stock_reel;
var $seuil_stock_alerte; var $seuil_stock_alerte;
//! Duree de validite du service //! Duree de validite du service
var $duration_value; var $duration_value;
@ -119,6 +120,7 @@ class Product extends CommonObject
$this->db = $DB; $this->db = $DB;
$this->id = $id ; $this->id = $id ;
$this->status = 0; $this->status = 0;
$this->stock_reel = 0;
$this->seuil_stock_alerte = 0; $this->seuil_stock_alerte = 0;
$this->canvas = ''; $this->canvas = '';
@ -2117,6 +2119,8 @@ class Product extends CommonObject
*/ */
function load_stock() function load_stock()
{ {
$this->stock_reel = 0;
$sql = "SELECT reel, fk_entrepot"; $sql = "SELECT reel, fk_entrepot";
$sql.= " FROM ".MAIN_DB_PREFIX."product_stock"; $sql.= " FROM ".MAIN_DB_PREFIX."product_stock";
$sql.= " WHERE fk_product = '".$this->id."'"; $sql.= " WHERE fk_product = '".$this->id."'";