Fix: mssql: rcupration du dernire ID
Fix: le type d'entreprise et et son effectif n'tait plus rcupr
This commit is contained in:
parent
e865d706fd
commit
45c98f1d0d
@ -573,11 +573,16 @@ class DoliDb
|
||||
*/
|
||||
function last_insert_id($tab)
|
||||
{
|
||||
return query("SELECT @@identity ");
|
||||
|
||||
//return mssql_insert_id($this->db);
|
||||
}
|
||||
|
||||
$res = $this->query("SELECT @@IDENTITY as id");
|
||||
if ($data = $this->fetch_array($res))
|
||||
{
|
||||
return $data["id"];
|
||||
}
|
||||
else
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Next function are not required. Only minor features use them.
|
||||
|
||||
@ -489,10 +489,10 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>'."\n";
|
||||
$form->select_array("typent_id",$soc->typent_array(1), $soc->typent_id);
|
||||
$form->select_array("typent_id",$soc->typent_array(0), $soc->typent_id);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Staff").'</td><td>';
|
||||
$form->select_array("effectif_id",$soc->effectif_array(1), $soc->effectif_id);
|
||||
$form->select_array("effectif_id",$soc->effectif_array(0), $soc->effectif_id);
|
||||
print '</td></tr>';
|
||||
|
||||
// Assujeti TVA
|
||||
@ -828,10 +828,10 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>';
|
||||
$form->select_array("typent_id",$soc->typent_array(), $soc->typent_id);
|
||||
$form->select_array("typent_id",$soc->typent_array(0), $soc->typent_id);
|
||||
print '</td>';
|
||||
print '<td>'.$langs->trans("Staff").'</td><td>';
|
||||
$form->select_array("effectif_id",$soc->effectif_array(), $soc->effectif_id);
|
||||
$form->select_array("effectif_id",$soc->effectif_array(0), $soc->effectif_id);
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td align="center" colspan="4">';
|
||||
|
||||
@ -1356,28 +1356,28 @@ class Societe
|
||||
*/
|
||||
function effectif_array($mode=0)
|
||||
{
|
||||
$effs = array();
|
||||
$effs = array();
|
||||
|
||||
$sql = "SELECT id, code, libelle";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_effectif";
|
||||
$sql .= " ORDER BY id ASC";
|
||||
if ($this->db->query($sql))
|
||||
$sql = "SELECT id, code, libelle";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_effectif";
|
||||
$sql .= " ORDER BY id ASC";
|
||||
if ($this->db->query($sql))
|
||||
{
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$num = $this->db->num_rows();
|
||||
$i = 0;
|
||||
$objp = $this->db->fetch_object();
|
||||
if (! $mode) $key=$objp->id;
|
||||
else $key=$objp->code;
|
||||
|
||||
while ($i < $num)
|
||||
{
|
||||
$objp = $this->db->fetch_object();
|
||||
if (! $mode) $key=$objp->id;
|
||||
else $key=$objp->code;
|
||||
|
||||
$effs[$key] = $objp->libelle!='-'?$objp->libelle:'';
|
||||
$i++;
|
||||
}
|
||||
$this->db->free();
|
||||
$effs[$key] = $objp->libelle!='-'?$objp->libelle:'';
|
||||
$i++;
|
||||
}
|
||||
return $effs;
|
||||
$this->db->free();
|
||||
}
|
||||
return $effs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user