48 |
var $seuil_stock_alerte; |
var $seuil_stock_alerte; |
49 |
var $duration_value; |
var $duration_value; |
50 |
var $duration_unit; |
var $duration_unit; |
51 |
|
var $status; |
52 |
|
|
53 |
var $stats_propale=array(); |
var $stats_propale=array(); |
54 |
var $stats_commande=array(); |
var $stats_commande=array(); |
67 |
{ |
{ |
68 |
$this->db = $DB; |
$this->db = $DB; |
69 |
$this->id = $id ; |
$this->id = $id ; |
70 |
$this->envente = 0; |
$this->envente = 0; // deprecated |
71 |
|
$this->status = 0; |
72 |
$this->seuil_stock_alerte = 0; |
$this->seuil_stock_alerte = 0; |
73 |
} |
} |
74 |
|
|
112 |
|
|
113 |
if (strlen($this->tva_tx)==0) $this->tva_tx = 0; |
if (strlen($this->tva_tx)==0) $this->tva_tx = 0; |
114 |
if (strlen($this->price)==0) $this->price = 0; |
if (strlen($this->price)==0) $this->price = 0; |
115 |
if (strlen($this->envente)==0) $this->envente = 0; |
if (strlen($this->envente)==0) $this->envente = 0; // deprecated |
116 |
|
if (strlen($this->status)==0) $this->status = 0; |
117 |
$this->price = ereg_replace(",",".",$this->price); |
$this->price = ereg_replace(",",".",$this->price); |
118 |
|
|
119 |
dolibarr_syslog("Product::Create ref=".$this->ref." Categorie : ".$this->catid); |
dolibarr_syslog("Product::Create ref=".$this->ref." Categorie : ".$this->catid); |
428 |
$this->tva_tx = $result["tva_tx"]; |
$this->tva_tx = $result["tva_tx"]; |
429 |
$this->type = $result["fk_product_type"]; |
$this->type = $result["fk_product_type"]; |
430 |
$this->nbvente = $result["nbvente"]; |
$this->nbvente = $result["nbvente"]; |
431 |
$this->envente = $result["envente"]; |
$this->envente = $result["envente"]; // deprecated |
432 |
|
$this->status = $result["envente"]; |
433 |
$this->duration = $result["duration"]; |
$this->duration = $result["duration"]; |
434 |
$this->duration_value = substr($result["duration"],0,strlen($result["duration"])-1); |
$this->duration_value = substr($result["duration"],0,strlen($result["duration"])-1); |
435 |
$this->duration_unit = substr($result["duration"],-1); |
$this->duration_unit = substr($result["duration"],-1); |
951 |
return 1; |
return 1; |
952 |
} |
} |
953 |
|
|
954 |
|
/** |
955 |
|
* \brief Retourne le libellé du statut d'une facture (brouillon, validée, abandonnée, payée) |
956 |
|
* \param mode 0=libellé long, 1=libellé court |
957 |
|
* \return string Libelle |
958 |
|
*/ |
959 |
|
function getLibStatut($mode=0) |
960 |
|
{ |
961 |
|
return $this->LibStatut($this->status,$mode); |
962 |
|
} |
963 |
|
|
964 |
|
/** |
965 |
|
* \brief Renvoi le libellé d'un statut donne |
966 |
|
* \param status Statut |
967 |
|
* \param mode 0=libellé long, 1=libellé court |
968 |
|
* \return string Libellé du statut |
969 |
|
*/ |
970 |
|
function LibStatut($status,$mode=0) |
971 |
|
{ |
972 |
|
global $langs; |
973 |
|
$langs->load('products'); |
974 |
|
if ($status == 0) return $langs->trans('ProductStatusNotOnSell'.($mode?'Short':'')); |
975 |
|
if ($status == 1) return $langs->trans('ProductStatusOnSell'.($mode?'Short':'')); |
976 |
|
return $langs->trans('Unknown'); |
977 |
|
} |
978 |
|
|
979 |
/** |
/** |
980 |
* \brief Entre un nombre de piece du produit en stock dans un entrepôt |
* \brief Entre un nombre de piece du produit en stock dans un entrepôt |
981 |
* \param id_entrepot id de l'entrepot |
* \param id_entrepot id de l'entrepot |