mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Ajout module numrotation automatique tigre
This commit is contained in:
parent
55567a161e
commit
6350848ec5
|
|
@ -383,9 +383,10 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
|
|||
* \param $db Handler acces base
|
||||
* \param $code Code a vérifier/corriger
|
||||
* \param $soc Objet societe
|
||||
* \param $type 0 = client/prospect , 1 = fournisseur
|
||||
* \return int <0 si KO, 0 si OK
|
||||
*/
|
||||
function verif($db, &$code, $soc)
|
||||
function verif($db, &$code, $soc, $type)
|
||||
{
|
||||
$result=0;
|
||||
$code = strtoupper(trim($code));
|
||||
|
|
@ -403,11 +404,11 @@ class mod_codeclient_tigre extends ModeleThirdPartyCode
|
|||
{
|
||||
$result=-3;
|
||||
}
|
||||
else if ($soc->prefixCustomerIsRequired && !$soc->prefix_comm)
|
||||
else if ($type == 0 && $soc->prefixCustomerIsRequired && !$soc->prefix_comm)
|
||||
{
|
||||
$result=-4;
|
||||
}
|
||||
else if ($soc->prefixSupplierIsRequired && !$soc->prefix_comm)
|
||||
else if ($type == 1 && $soc->prefixSupplierIsRequired && !$soc->prefix_comm)
|
||||
{
|
||||
$result=-5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -672,7 +672,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
|||
print '<td width="25%">'.$langs->trans('CustomerCode').'</td><td width="25%">';
|
||||
|
||||
print '<table class="nobordernopadding"><tr><td>';
|
||||
if (((!$soc->client && !$soc->code_client)|| $soc->code_client == -1) && $modCodeClient->code_auto == 1)
|
||||
if ((!$soc->code_client || $soc->code_client == -1) && $modCodeClient->code_auto == 1)
|
||||
{
|
||||
print '<input type="hidden" name="code_client" value="-1">';
|
||||
print $langs->trans('AutomaticallyGenerated').' ';
|
||||
|
|
@ -701,7 +701,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
|
|||
print '<td>'.$langs->trans('SupplierCode').'</td><td>';
|
||||
|
||||
print '<table class="nobordernopadding"><tr><td>';
|
||||
if (((!$soc->fournisseur && !$soc->code_fournisseur) || $soc->code_fournisseur == -1) && $modCodeFournisseur->code_auto == 1)
|
||||
if ((!$soc->code_fournisseur || $soc->code_fournisseur == -1) && $modCodeFournisseur->code_auto == 1)
|
||||
{
|
||||
print '<input type="hidden" name="code_fournisseur" value="-1">';
|
||||
print $langs->trans('AutomaticallyGenerated').' ';
|
||||
|
|
|
|||
|
|
@ -1549,7 +1549,8 @@ class Societe
|
|||
$mod = new $var;
|
||||
|
||||
dolibarr_syslog("Societe::check_codeclient code_client=".$this->code_client." module=".$var);
|
||||
return $mod->verif($this->db, $this->code_client, $this);
|
||||
$result = $mod->verif($this->db, $this->code_client, $this, 0);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1573,7 +1574,8 @@ class Societe
|
|||
$mod = new $var;
|
||||
|
||||
dolibarr_syslog("Societe::check_codefournisseur code_fournisseur=".$this->code_fournisseur." module=".$var);
|
||||
return $mod->verif($this->db, $this->code_fournisseur, $this);
|
||||
$result = $mod->verif($this->db, $this->code_fournisseur, $this ,1);
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user