Fix: Error when duplicate ref
This commit is contained in:
parent
0a7cdf53e7
commit
3617a36f06
@ -307,7 +307,13 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$facid = $facfou->create($user);
|
$facid = $facfou->create($user);
|
||||||
|
if ($facid < 0)
|
||||||
|
{
|
||||||
|
$error++;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! $error)
|
||||||
|
{
|
||||||
for ($i = 1 ; $i < 9 ; $i++)
|
for ($i = 1 ; $i < 9 ; $i++)
|
||||||
{
|
{
|
||||||
$label = $_POST['label'.$i];
|
$label = $_POST['label'.$i];
|
||||||
@ -332,11 +338,13 @@ if ($_POST['action'] == 'add' && $user->rights->fournisseur->facture->creer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($error)
|
if ($error)
|
||||||
{
|
{
|
||||||
|
$langs->load("errors");
|
||||||
$db->rollback();
|
$db->rollback();
|
||||||
$mesg='<div class="error">'.$facfou->error.'</div>';
|
$mesg='<div class="error">'.$langs->trans($facfou->error).'</div>';
|
||||||
$_GET['action']='create';
|
$_GET['action']='create';
|
||||||
$_GET['socid']=$_POST['socid'];
|
$_GET['socid']=$_POST['socid'];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user