Fix: When there is an error to update a thirdparty, the number for
supplier and customer code is kept to old value.
This commit is contained in:
parent
977300c653
commit
ee3f92a168
@ -1069,7 +1069,6 @@ else
|
|||||||
$res=$object->fetch_optionals($object->id,$extralabels);
|
$res=$object->fetch_optionals($object->id,$extralabels);
|
||||||
//if ($res < 0) { dol_print_error($db); exit; }
|
//if ($res < 0) { dol_print_error($db); exit; }
|
||||||
|
|
||||||
|
|
||||||
$head = societe_prepare_head($object);
|
$head = societe_prepare_head($object);
|
||||||
|
|
||||||
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
|
dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company');
|
||||||
@ -1111,6 +1110,8 @@ else
|
|||||||
$prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed();
|
$prefixSupplierIsUsed = $modCodeFournisseur->verif_prefixIsUsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$object->oldcopy=dol_clone($object);
|
||||||
|
|
||||||
if (GETPOST('nom'))
|
if (GETPOST('nom'))
|
||||||
{
|
{
|
||||||
// We overwrite with values if posted
|
// We overwrite with values if posted
|
||||||
@ -1247,6 +1248,7 @@ else
|
|||||||
if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
|
if ((!$object->code_fournisseur || $object->code_fournisseur == -1) && $modCodeFournisseur->code_auto)
|
||||||
{
|
{
|
||||||
$tmpcode=$object->code_fournisseur;
|
$tmpcode=$object->code_fournisseur;
|
||||||
|
if (empty($tmpcode) && ! empty($object->oldcopy->code_fournisseur)) $tmpcode=$object->oldcopy->code_fournisseur;
|
||||||
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
|
if (empty($tmpcode) && ! empty($modCodeFournisseur->code_auto)) $tmpcode=$modCodeFournisseur->getNextValue($object,1);
|
||||||
print '<input type="text" name="code_fournisseur" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
print '<input type="text" name="code_fournisseur" size="16" value="'.dol_escape_htmltag($tmpcode).'" maxlength="15">';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user