This commit is contained in:
Regis Houssin 2007-09-29 20:31:41 +00:00
parent f73db03e53
commit 028d875bbb

View File

@ -881,21 +881,25 @@ class Product
{ {
$this->barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE; $this->barcode_type = $conf->global->PRODUIT_DEFAULT_BARCODE_TYPE;
} }
$sql = "SELECT code, libelle, coder";
$sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type"; if ($this->barcode_type > 0)
$sql.= " WHERE rowid = ".$this->barcode_type;
$result = $this->db->query($sql);
if ($result)
{ {
$result = $this->db->fetch_array(); $sql = "SELECT code, libelle, coder";
$this->barcode_type_code = $result["code"]; $sql.= " FROM ".MAIN_DB_PREFIX."c_barcode_type";
$this->barcode_type_label = $result["libelle"]; $sql.= " WHERE rowid = ".$this->barcode_type;
$this->barcode_type_coder = $result["coder"]; $result = $this->db->query($sql);
} if ($result)
else {
{ $result = $this->db->fetch_array();
dolibarr_print_error($this->db); $this->barcode_type_code = $result["code"];
return -1; $this->barcode_type_label = $result["libelle"];
$this->barcode_type_coder = $result["coder"];
}
else
{
dolibarr_print_error($this->db);
return -1;
}
} }
} }