Qual: idprof are all renamed to idprof1,2,3,4 (removed old name siren,

siret, ...)
This commit is contained in:
Laurent Destailleur 2011-12-28 17:30:30 +01:00
parent 2daa5a516f
commit 498c1b1b41
7 changed files with 35 additions and 48 deletions

View File

@ -662,9 +662,9 @@ class FormCompany
}
$selected=$preselected;
if (! $selected && $idprof==1) $selected=$this->siren;
if (! $selected && $idprof==2) $selected=$this->siret;
if (! $selected && $idprof==3) $selected=$this->ape;
if (! $selected && $idprof==1) $selected=$this->idprof1;
if (! $selected && $idprof==2) $selected=$this->idprof2;
if (! $selected && $idprof==3) $selected=$this->idprof3;
if (! $selected && $idprof==4) $selected=$this->idprof4;
$out = '<input type="text" name="'.$htmlname.'" size="'.($formlength+1).'" maxlength="'.$formlength.'" value="'.$selected.'">';

View File

@ -152,7 +152,7 @@ if (! defined('NOREQUIREDB'))
$conf->entity = $lastentity;
}
}
//print "Will work with data into entity instance number '".$conf->entity."'";
// Here we read database (llx_const table) and define $conf->global->XXX var.
@ -245,11 +245,6 @@ if (! defined('NOREQUIREDB') && ! defined('NOREQUIRESOC'))
$mysoc->phone=empty($conf->global->MAIN_INFO_SOCIETE_TEL)?'':$conf->global->MAIN_INFO_SOCIETE_TEL;
$mysoc->fax=empty($conf->global->MAIN_INFO_SOCIETE_FAX)?'':$conf->global->MAIN_INFO_SOCIETE_FAX;
$mysoc->url=empty($conf->global->MAIN_INFO_SOCIETE_WEB)?'':$conf->global->MAIN_INFO_SOCIETE_WEB;
// Anciens id prof
$mysoc->siren=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN;
$mysoc->siret=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;
$mysoc->ape=empty($conf->global->MAIN_INFO_APE)?'':$conf->global->MAIN_INFO_APE;
$mysoc->rcs=empty($conf->global->MAIN_INFO_RCS)?'':$conf->global->MAIN_INFO_RCS;
// Id prof generiques
$mysoc->idprof1=empty($conf->global->MAIN_INFO_SIREN)?'':$conf->global->MAIN_INFO_SIREN;
$mysoc->idprof2=empty($conf->global->MAIN_INFO_SIRET)?'':$conf->global->MAIN_INFO_SIRET;

View File

@ -107,9 +107,9 @@ class ActionsCardCompany extends ActionsCardCommon
$this->tpl['title'] = $this->getTitle($action);
$this->tpl['profid1'] = $this->object->siren;
$this->tpl['profid2'] = $this->object->siret;
$this->tpl['profid3'] = $this->object->ape;
$this->tpl['profid1'] = $this->object->idprof1;
$this->tpl['profid2'] = $this->object->idprof2;
$this->tpl['profid3'] = $this->object->idprof3;
$this->tpl['profid4'] = $this->object->idprof4;
if ($conf->use_javascript_ajax && empty($conf->global->MAIN_DISABLEVATCHECK))

View File

@ -417,9 +417,6 @@ class Societe extends CommonObject
$this->fax = preg_replace("/\./","",$this->fax);
$this->email = trim($this->email);
$this->url = $this->url?clean_url($this->url,0):'';
$this->siren=trim($this->siren); // TODO obsolete
$this->siret=trim($this->siret); // TODO obsolete
$this->ape=trim($this->ape); // TODO obsolete
$this->idprof1 = trim($this->idprof1);
$this->idprof2 = trim($this->idprof2);
$this->idprof3 = trim($this->idprof3);
@ -725,11 +722,8 @@ class Societe extends CommonObject
$this->parent = $obj->parent;
$this->siren = $obj->idprof1; // TODO obsolete
$this->idprof1 = $obj->idprof1;
$this->siret = $obj->idprof2; // TODO obsolete
$this->idprof2 = $obj->idprof2;
$this->ape = $obj->idprof3; // TODO obsolete
$this->idprof3 = $obj->idprof3;
$this->idprof4 = $obj->idprof4;
@ -1988,7 +1982,7 @@ class Societe extends CommonObject
// Verifie SIREN si pays FR
if ($idprof == 1 && $soc->pays_code == 'FR')
{
$chaine=trim($this->siren);
$chaine=trim($this->idprof1);
$chaine=preg_replace('/(\s)/','',$chaine);
if (dol_strlen($chaine) != 9) return -1;
@ -1997,12 +1991,12 @@ class Societe extends CommonObject
for ($i = 0 ; $i < 10 ; $i = $i+2)
{
$sum = $sum + substr($this->siren, (8 - $i), 1);
$sum = $sum + substr($this->idprof1, (8 - $i), 1);
}
for ($i = 1 ; $i < 9 ; $i = $i+2)
{
$ps = 2 * substr($this->siren, (8 - $i), 1);
$ps = 2 * substr($this->idprof1, (8 - $i), 1);
if ($ps > 9)
{
@ -2017,7 +2011,7 @@ class Societe extends CommonObject
// Verifie SIRET si pays FR
if ($idprof == 2 && $soc->pays_code == 'FR')
{
$chaine=trim($this->siret);
$chaine=trim($this->idprof1);
$chaine=preg_replace('/(\s)/','',$chaine);
if (dol_strlen($chaine) != 14) return -1;
@ -2027,7 +2021,7 @@ class Societe extends CommonObject
//Returns: 1 if NIF ok, 2 if CIF ok, 3 if NIE ok, -1 if NIF bad, -2 if CIF bad, -3 if NIE bad, 0 if unexpected bad
if ($idprof == 1 && $soc->pays_code == 'ES')
{
$string=trim($this->siren);
$string=trim($this->idprof1);
$string=preg_replace('/(\s)/','',$string);
$string = strtoupper($string);
@ -2101,9 +2095,9 @@ class Societe extends CommonObject
$url='';
if ($idprof == 1 && $soc->pays_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->siren;
if ($idprof == 1 && $soc->pays_code == 'FR') $url='http://www.societe.com/cgi-bin/recherche?rncs='.$soc->idprof1;
if ($idprof == 1 && $soc->pays_code == 'GB') $url='http://www.companieshouse.gov.uk/WebCHeck/findinfolink/';
if ($idprof == 1 && $soc->pays_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$soc->siren;
if ($idprof == 1 && $soc->pays_code == 'ES') $url='http://www.e-informa.es/servlet/app/portal/ENTP/screen/SProducto/prod/ETIQUETA_EMPRESA/nif/'.$soc->idprof1;
if ($url) return '<a target="_blank" href="'.$url.'">['.$langs->trans("Check").']</a>';
return '';
@ -2407,8 +2401,6 @@ class Societe extends CommonObject
$this->code_client='CC-'.dol_print_date($now,'dayhourlog');
$this->code_fournisseur='SC-'.dol_print_date($now,'dayhourlog');
$this->siren='123456789';
$this->siret='ABCDE';
$this->capital=10000;
$this->client=1;
$this->prospect=1;

View File

@ -147,7 +147,7 @@ if ($socid)
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(1,'idprof1',$object->siren,$object->pays_code);
print $formcompany->get_input_id_prof(1,'idprof1',$object->idprof1,$object->pays_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -156,7 +156,7 @@ if ($socid)
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(2,'idprof2',$object->siret,$object->pays_code);
print $formcompany->get_input_id_prof(2,'idprof2',$object->idprof2,$object->pays_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -167,7 +167,7 @@ if ($socid)
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(3,'idprof3',$object->ape,$object->pays_code);
print $formcompany->get_input_id_prof(3,'idprof3',$object->idprof3,$object->pays_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';

View File

@ -802,7 +802,7 @@ else
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(1,'idprof1',$object->siren,$object->pays_code);
print $formcompany->get_input_id_prof(1,'idprof1',$object->idprof1,$object->pays_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -811,7 +811,7 @@ else
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(2,'idprof2',$object->siret,$object->pays_code);
print $formcompany->get_input_id_prof(2,'idprof2',$object->idprof2,$object->pays_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -822,7 +822,7 @@ else
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(3,'idprof3',$object->ape,$object->pays_code);
print $formcompany->get_input_id_prof(3,'idprof3',$object->idprof3,$object->pays_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -1035,9 +1035,9 @@ else
$object->email = $_POST["email"];
$object->url = $_POST["url"];
$object->capital = $_POST["capital"];
$object->siren = $_POST["idprof1"];
$object->siret = $_POST["idprof2"];
$object->ape = $_POST["idprof3"];
$object->idprof1 = $_POST["idprof1"];
$object->idprof2 = $_POST["idprof2"];
$object->idprof3 = $_POST["idprof3"];
$object->idprof4 = $_POST["idprof4"];
$object->typent_id = $_POST["typent_id"];
$object->effectif_id = $_POST["effectif_id"];
@ -1247,7 +1247,7 @@ else
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(1,'idprof1',$object->siren,$object->country_code);
print $formcompany->get_input_id_prof(1,'idprof1',$object->idprof1,$object->country_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -1256,7 +1256,7 @@ else
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(2,'idprof2',$object->siret,$object->country_code);
print $formcompany->get_input_id_prof(2,'idprof2',$object->idprof2,$object->country_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -1267,7 +1267,7 @@ else
if ($idprof!='-')
{
print '<td>'.$idprof.'</td><td>';
print $formcompany->get_input_id_prof(3,'idprof3',$object->ape,$object->country_code);
print $formcompany->get_input_id_prof(3,'idprof3',$object->idprof3,$object->country_code);
print '</td>';
}
else print '<td>&nbsp;</td><td>&nbsp;</td>';
@ -1567,8 +1567,8 @@ else
if ($profid!='-')
{
print '<tr><td>'.$profid.'</td><td>';
print $object->siren;
if ($object->siren)
print $object->idprof1;
if ($object->idprof1)
{
if ($object->id_prof_check(1,$object) > 0) print ' &nbsp; '.$object->id_prof_url(1,$object);
else print ' <font class="error">('.$langs->trans("ErrorWrongValue").')</font>';
@ -1581,8 +1581,8 @@ else
if ($profid!='-')
{
print '<td>'.$profid.'</td><td>';
print $object->siret;
if ($object->siret)
print $object->idprof2;
if ($object->idprof2)
{
if ($object->id_prof_check(2,$object) > 0) print ' &nbsp; '.$object->id_prof_url(2,$object);
else print ' <font class="error">('.$langs->trans("ErrorWrongValue").')</font>';
@ -1596,8 +1596,8 @@ else
if ($profid!='-')
{
print '<tr><td>'.$profid.'</td><td>';
print $object->ape;
if ($object->ape)
print $object->idprof3;
if ($object->idprof3)
{
if ($object->id_prof_check(3,$object) > 0) print ' &nbsp; '.$object->id_prof_url(3,$object);
else print ' <font class="error">('.$langs->trans("ErrorWrongValue").')</font>';

View File

@ -193,9 +193,9 @@ function getThirdParty($authentication,$id='',$ref='',$ref_ext='')
'fax' => $thirdparty->fax,
'email' => $thirdparty->email,
'url' => $thirdparty->url,
'profid1' => $thirdparty->siren,
'profid2' => $thirdparty->siret,
'profid3' => $thirdparty->ape,
'profid1' => $thirdparty->idprof1,
'profid2' => $thirdparty->idprof2,
'profid3' => $thirdparty->idprof3,
'profid4' => $thirdparty->idprof4,
'prefix' => $thirdparty->prefix_comm,
'vat_used' => $thirdparty->tva_assuj,