diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php index 41e570591a7..b0247ad25aa 100644 --- a/htdocs/core/class/html.formcompany.class.php +++ b/htdocs/core/class/html.formcompany.class.php @@ -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 = ''; diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index ad05ee10535..030f70c01d8 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -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; diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 5f581d3b69b..0cfc7033369 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -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)) diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 39ce333b8ea..27f08174a4f 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -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 '['.$langs->trans("Check").']'; 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; diff --git a/htdocs/societe/lien.php b/htdocs/societe/lien.php index 80ef3db594e..ffd72051172 100644 --- a/htdocs/societe/lien.php +++ b/htdocs/societe/lien.php @@ -147,7 +147,7 @@ if ($socid) if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -156,7 +156,7 @@ if ($socid) if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -167,7 +167,7 @@ if ($socid) if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index ea8237c36cc..4b67646c901 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -802,7 +802,7 @@ else if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -811,7 +811,7 @@ else if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -822,7 +822,7 @@ else if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -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 ''.$idprof.''; - 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 ''; } else print '  '; @@ -1256,7 +1256,7 @@ else if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -1267,7 +1267,7 @@ else if ($idprof!='-') { print ''.$idprof.''; - 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 ''; } else print '  '; @@ -1567,8 +1567,8 @@ else if ($profid!='-') { print ''.$profid.''; - print $object->siren; - if ($object->siren) + print $object->idprof1; + if ($object->idprof1) { if ($object->id_prof_check(1,$object) > 0) print '   '.$object->id_prof_url(1,$object); else print ' ('.$langs->trans("ErrorWrongValue").')'; @@ -1581,8 +1581,8 @@ else if ($profid!='-') { print ''.$profid.''; - print $object->siret; - if ($object->siret) + print $object->idprof2; + if ($object->idprof2) { if ($object->id_prof_check(2,$object) > 0) print '   '.$object->id_prof_url(2,$object); else print ' ('.$langs->trans("ErrorWrongValue").')'; @@ -1596,8 +1596,8 @@ else if ($profid!='-') { print ''.$profid.''; - print $object->ape; - if ($object->ape) + print $object->idprof3; + if ($object->idprof3) { if ($object->id_prof_check(3,$object) > 0) print '   '.$object->id_prof_url(3,$object); else print ' ('.$langs->trans("ErrorWrongValue").')'; diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index e2550e32a46..023d3a15a7a 100755 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -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,