diff --git a/htdocs/adherents/canvas/actions_adherentcard_common.class.php b/htdocs/adherents/canvas/actions_adherentcard_common.class.php index e7c07c23b4c..50a24ea907a 100644 --- a/htdocs/adherents/canvas/actions_adherentcard_common.class.php +++ b/htdocs/adherents/canvas/actions_adherentcard_common.class.php @@ -423,7 +423,6 @@ abstract class ActionsAdherentCardCommon { dol_print_error($this->db); } - $this->object->pays_code = $obj->code; $this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country_code = $obj->code; $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 42391155e80..97eae475b55 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -63,7 +63,6 @@ class Adherent extends CommonObject var $country_id; var $country_code; var $country; - var $pays_code; // deprecated var $pays; // deprecated var $email; @@ -1068,7 +1067,6 @@ class Adherent extends CommonObject $this->country = $langs->transnoentitiesnoconv("Country".$obj->country_code); else $this->country=$obj->country; - $this->pays_code = $obj->country_code; // deprecated $this->pays = $this->country; // deprecated $this->phone = $obj->phone; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 44947730e00..59b2a6e2402 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -728,7 +728,6 @@ else if ($object->country_id) { $tmparray=getCountry($object->country_id,'all'); - $object->pays_code=$tmparray['code']; $object->pays=$tmparray['code']; $object->country_code=$tmparray['code']; $object->country=$tmparray['label']; @@ -957,7 +956,6 @@ else { dol_print_error($db); } - $object->pays_code=$obj->code; $object->pays=$langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label; $object->country_id=$obj->rowid; $object->country_code=$obj->code; diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php index bea9df93c65..4bd5a1029c8 100644 --- a/htdocs/admin/dict.php +++ b/htdocs/admin/dict.php @@ -128,20 +128,20 @@ $tablib[24]= "DictionnaryAccountancysystem"; // Requete pour extraction des donnees des dictionnaires $tabsql=array(); -$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; -$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as pays_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1"; -$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as pays_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; +$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid"; +$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1"; +$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1"; $tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays"; $tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c"; $tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a"; -$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; +$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as pays, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1"; $tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent"; $tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; -$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; +$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c'; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c"; -$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as pays_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; +$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1"; $tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; @@ -151,7 +151,7 @@ $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREF $tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c"; $tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason"; $tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount"; -$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as pays_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1"; +$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1"; // Critere de tri du dictionnaire $tabsqlsort=array(); @@ -183,7 +183,7 @@ $tabsqlsort[24]="pcg_version ASC"; // Nom des champs en resultat de select pour affichage du dictionnaire $tabfield=array(); $tabfield[1] = "code,libelle,pays"; -$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,pays_code-pays" +$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,country_code-pays" $tabfield[3] = "code,libelle,country_id,pays"; $tabfield[4] = "code,libelle"; $tabfield[5] = "code,libelle"; @@ -673,8 +673,8 @@ if ($id) if ($sortfield) { - // If sort order is "pays", we use pays_code instead - if ($sortfield == 'pays') $sortfield='pays_code'; + // If sort order is "pays", we use country_code instead + if ($sortfield == 'pays') $sortfield='country_code'; $sql.= " ORDER BY ".$sortfield; if ($sortorder) { @@ -923,14 +923,14 @@ if ($id) $valuetoshow=$langs->trans('All'); } else if ($fieldlist[$field]=='pays') { - if (empty($obj->pays_code)) + if (empty($obj->country_code)) { $valuetoshow='-'; } else { - $key=$langs->trans("Country".strtoupper($obj->pays_code)); - $valuetoshow=($key != "Country".strtoupper($obj->pays_code)?$obj->pays_code." - ".$key:$obj->pays); + $key=$langs->trans("Country".strtoupper($obj->country_code)); + $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->pays); } } else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') { @@ -1196,7 +1196,7 @@ function fieldList($fieldlist,$obj='',$tabname='') if ($fieldlist[$field] == 'pays') { if (in_array('region_id',$fieldlist)) { print '
| '; -print_titre($langs->transcountry("LT2Summary",$mysoc->pays_code)); +print_titre($langs->transcountry("LT2Summary",$mysoc->country_code)); print ' | '; -print_titre($langs->transcountry("LT2Paid",$mysoc->pays_code)); +print_titre($langs->transcountry("LT2Paid",$mysoc->country_code)); print ' | ||||||||
| '; diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index af621b7a53a..bc918816dc6 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -459,7 +459,6 @@ abstract class ActionsContactCardCommon { dol_print_error($this->db); } - $this->object->pays_code = $obj->code; $this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country_code = $obj->code; $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 47d1db8ae39..7b605130995 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -54,7 +54,6 @@ class Contact extends CommonObject var $state; // Label of department var $fk_pays; // deprecated - var $pays_code; // deprecated var $pays; // deprecated var $country_id; // Id of country var $country_code; // Code of country @@ -525,7 +524,6 @@ class Contact extends CommonObject $this->fk_pays = $obj->country_id; $this->country_id = $obj->country_id; - $this->pays_code = $obj->country_id?$obj->country_code:''; $this->country_code = $obj->country_id?$obj->country_code:''; $this->pays = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; $this->country = ($obj->country_id > 0)?$langs->transnoentitiesnoconv("Country".$obj->country_code):''; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index cc6cdec4b51..1bd291b5f25 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -585,7 +585,6 @@ else if (isset($_POST["country_id"]) || $object->country_id) { $tmparray=getCountry($object->country_id,'all'); - $object->pays_code = $tmparray['code']; $object->pays = $tmparray['label']; $object->country_code = $tmparray['code']; $object->country = $tmparray['label']; diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 50853260350..950244c5b45 100755 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -116,7 +116,7 @@ $form=new Form($db); $sql = "SELECT s.rowid as socid, s.nom as name,"; $sql.= " p.rowid as cidp, p.name as lastname, p.firstname, p.poste, p.email,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; -$sql.= " cp.code as pays_code"; +$sql.= " cp.code as country_code"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; @@ -368,16 +368,16 @@ if ($result) if ($view == 'phone') { // Phone - print ' | '.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; + print ''.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; // Phone mobile - print ''.dol_print_phone($obj->phone_mobile,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; + print ''.dol_print_phone($obj->phone_mobile,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; // Fax - print ''.dol_print_phone($obj->fax,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; + print ''.dol_print_phone($obj->fax,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; } else { // Phone - print ''.dol_print_phone($obj->phone,$obj->pays_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; + print ''.dol_print_phone($obj->phone,$obj->country_code,$obj->cidp,$obj->socid,'AC_TEL').' | '; // EMail print ''.dol_print_email($obj->email,$obj->cidp,$obj->socid,'AC_EMAIL',18).' | '; } diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 195c5942e5e..be1b820cb60 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -54,8 +54,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE"); $v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE"); $v->setPhoneNumber($contact->fax, "WORK;FAX"); -$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->pays_code?$contact->pays:''), "WORK;POSTAL"); -$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->pays_code?$contact->pays:''), "WORK"); +$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK;POSTAL"); +$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK"); $v->setEmail($contact->email,'internet,pref'); $v->setNote($contact->note); @@ -67,7 +67,7 @@ if ($company->id) $v->setURL($company->url, "WORK"); if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE"); if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX"); - if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->pays_code, "WORK;POSTAL"); + if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL"); if ($company->email != $contact->email) $v->setEmail($company->email,'internet'); // Si contact lie a un tiers non de type "particulier" if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom); diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 72bcfc58acb..596e8320671 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -293,7 +293,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1)); $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; // Country - if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->pays_code))."\n"; + if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->pays_code))."\n"; if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { @@ -311,7 +311,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; // Country - if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->pays_code))."\n"; + if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->country_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->pays_code))."\n"; if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) { diff --git a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php index c2023f10924..bc190ab0f5b 100644 --- a/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/core/modules/cheque/pdf/pdf_blochet.class.php @@ -67,7 +67,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts // Recupere emmetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'�tait pas d�fini + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined // Defini position des colonnes $this->line_height = 5; diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php index fff62466958..4ba2a560f5d 100644 --- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php +++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php @@ -82,7 +82,7 @@ class doc_generic_order_odt extends ModelePDFCommandes // Recupere emetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined } diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php index 386179fe16d..4475f3ad8db 100644 --- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php @@ -541,7 +541,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetFont('','', $default_font_size - 1); // If France, show VAT mention if not applicable - if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) + if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); @@ -740,7 +740,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -774,7 +774,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -832,7 +832,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -872,7 +872,7 @@ class pdf_einstein extends ModelePDFCommandes $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php index c2f8da7c0e2..56e0d90fdb3 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php @@ -65,7 +65,7 @@ class pdf_expedition_merou extends ModelePdfExpedition // Recupere emmetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // By default if not defined + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined } diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php index b458a5a3a42..172966b89cf 100644 --- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php +++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php @@ -64,7 +64,7 @@ class pdf_expedition_rouget extends ModelePdfExpedition // Recupere emmetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // By default if not defined + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined // Defini position des colonnes $this->posxdesc=$this->marge_gauche+1; diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php index 37e2b7e32b6..dc00f4370fa 100644 --- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php +++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php @@ -82,7 +82,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures // Recupere emetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini } diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php index b7836301c64..3ca242e68c2 100755 --- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php +++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php @@ -668,7 +668,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetFont('','', $default_font_size - 1); // If France, show VAT mention if not applicable - if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) + if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); @@ -872,7 +872,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -907,7 +907,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -965,7 +965,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -1006,7 +1006,7 @@ class pdf_crabe extends ModelePDFFactures $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php index 0e65800698a..c4a1150d505 100644 --- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php @@ -77,7 +77,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder // Recupere emmetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'�tait pas d�fini + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined // Defini position des colonnes $this->posxdesc=$this->marge_gauche+1; diff --git a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php index 1befddf2168..2ccd63ab81a 100644 --- a/htdocs/core/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/core/modules/project/pdf/pdf_baleine.modules.php @@ -73,7 +73,7 @@ class pdf_baleine extends ModelePDFProjects // Recupere emmetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'�tait pas d�fini + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined // Defini position des colonnes $this->posxref=$this->marge_gauche+1; diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php index d18c17735ae..e6103f5a802 100644 --- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php +++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php @@ -82,7 +82,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales // Recupere emetteur $this->emetteur=$mysoc; - if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini + if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined } diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php index 41a1068721d..06272e24983 100644 --- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php +++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php @@ -537,7 +537,7 @@ class pdf_azur extends ModelePDFPropales $pdf->SetFont('','', $default_font_size - 1); // If France, show VAT mention if not applicable - if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) + if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); @@ -769,7 +769,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -804,7 +804,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -862,7 +862,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); @@ -902,7 +902,7 @@ class pdf_azur extends ModelePDFPropales $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; if ($localtax_type == '7') { // amount on order $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php index 38d244ddc38..bd2b3c10507 100755 --- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php +++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php @@ -586,7 +586,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices $tvakey=str_replace('*','',$tvakey); $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; } - $totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; + $totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); diff --git a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php index 882c2610775..67c96890f49 100644 --- a/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/core/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -491,7 +491,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetFont('','', $default_font_size - 1); // If France, show VAT mention if not applicable - /*if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1) + /*if ($this->emetteur->country_code == 'FR' && $this->franchise == 1) { $pdf->SetFont('','B', $default_font_size - 2); $pdf->SetXY($this->marge_gauche, $posy); diff --git a/htdocs/install/mysql/tables/llx_c_pays.key.sql b/htdocs/install/mysql/tables/llx_c_pays.key.sql index d77707da347..6714a0644b2 100644 --- a/htdocs/install/mysql/tables/llx_c_pays.key.sql +++ b/htdocs/install/mysql/tables/llx_c_pays.key.sql @@ -17,6 +17,6 @@ -- ======================================================================== -ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_pays_code (code); -ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_pays_code_iso (code_iso); +ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code (code); +ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code_iso (code_iso); ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_pays_libelle (libelle); diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php index 372122940f4..9d799128c4b 100755 --- a/htdocs/paypal/lib/paypal.lib.php +++ b/htdocs/paypal/lib/paypal.lib.php @@ -116,7 +116,7 @@ function html_print_paypal_footer($fromcompany,$langs) $line1.=($line1?" - ":"").$langs->transnoentities("CapitalOf",$fromcompany->capital)." ".$langs->transnoentities("Currency".$conf->currency); } // Prof Id 1 - if ($fromcompany->idprof1 && ($fromcompany->pays_code != 'FR' || ! $fromcompany->idprof2)) + if ($fromcompany->idprof1 && ($fromcompany->country_code != 'FR' || ! $fromcompany->idprof2)) { $field=$langs->transcountrynoentities("ProfId1",$fromcompany->country_code); if (preg_match('/\((.*)\)/i',$field,$reg)) $field=$reg[1]; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index f8b23ab0c73..d26d20059fc 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -280,7 +280,6 @@ class Entrepot extends CommonObject include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; $tmp=getCountry($this->country_id,'all'); $this->pays=$tmp['label']; // deprecated - $this->pays_code=$tmp['code']; // deprecated $this->country=$tmp['label']; $this->country_code=$tmp['code']; diff --git a/htdocs/public/paypal/newpayment.php b/htdocs/public/paypal/newpayment.php index 6ed4562a54d..85cae53fa2c 100755 --- a/htdocs/public/paypal/newpayment.php +++ b/htdocs/public/paypal/newpayment.php @@ -775,7 +775,7 @@ if (GETPOST("source") == 'contractline' && $valid) $shipToStreet=$contract->thirdparty->address; $shipToCity=$contract->thirdparty->town; $shipToState=$contract->thirdparty->state_code; - $shipToCountryCode=$contract->thirdparty->pays_code; + $shipToCountryCode=$contract->thirdparty->country_code; $shipToZip=$contract->thirdparty->zip; $shipToStreet2=''; $phoneNum=$contract->thirdparty->tel; diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index ce0c1d8de51..1cfeb4efe3f 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -558,7 +558,7 @@ abstract class ActionsCardCommon $this->tpl['checksuppliercode'] = $this->object->check_codefournisseur(); $this->tpl['address'] = dol_nl2br($this->object->address); - $img=picto_from_langcode($this->object->pays_code); + $img=picto_from_langcode($this->object->country_code); if ($this->object->isInEEC()) $this->tpl['country'] = $form->textwithpicto(($img?$img.' ':'').$this->object->country,$langs->trans("CountryIsInEEC"),1,0); $this->tpl['country'] = ($img?$img.' ':'').$this->object->country; @@ -701,7 +701,7 @@ abstract class ActionsCardCommon $this->object->localtax1_assuj = $_POST["localtax1assuj_value"]; $this->object->localtax2_assuj = $_POST["localtax2assuj_value"]; - // We set country_id, and pays_code label of the chosen country + // We set country_id, and country_code label of the chosen country if ($this->object->country_id) { $tmparray=getCountry($this->object->country_id,'all',$this->db,$langs,0); diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php index 2df0c2ca7f5..911a69c710c 100644 --- a/htdocs/societe/class/address.class.php +++ b/htdocs/societe/class/address.class.php @@ -41,7 +41,6 @@ class Address var $zip; var $town; var $country_id; - var $pays_code; // deprecated var $country_code; var $tel; // deprecated var $phone; @@ -301,7 +300,6 @@ class Address $line->note = $objp->note; // deprecated - $line->pays_code = $line->country_code; $line->pays = $line->country; $line->tel = $line->phone; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 356216c0ab2..73395fdec1e 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -60,7 +60,6 @@ class Societe extends CommonObject var $departement_code; // deprecated var $departement; // deprecated - var $pays_code; // deprecated var $pays; // deprecated var $country_id; var $country_code; @@ -757,7 +756,6 @@ class Societe extends CommonObject $this->town = $obj->town; $this->country_id = $obj->country_id; - $this->pays_code = $obj->country_id?$obj->country_code:''; // TODO obsolete $this->country_code = $obj->country_id?$obj->country_code:''; $this->pays = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->trans('Country'.$obj->country_code):$obj->country):''; // TODO obsolete $this->country = $obj->country_id?($langs->trans('Country'.$obj->country_code)!='Country'.$obj->country_code?$langs->trans('Country'.$obj->country_code):$obj->country):''; @@ -2434,7 +2432,6 @@ class Societe extends CommonObject $this->address=$member->address; $this->zip=$member->zip; $this->town=$member->town; - $this->pays_code=$member->country_code; // TODO obsolete $this->country_code=$member->country_code; $this->country_id=$member->country_id; $this->tel=$member->phone; // deprecated @@ -2521,7 +2518,6 @@ class Societe extends CommonObject } } $this->country_id=$country_id; - $this->pays_code=$country_code; // TODO deprecated $this->country_code=$country_code; $this->country=$country_label; if (is_object($langs)) $this->country=($langs->trans('Country'.$country_code)!='Country'.$country_code)?$langs->trans('Country'.$country_code):$country_label; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index ed46bde9ba6..6ddb35b270b 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1114,7 +1114,7 @@ else $object->localtax1_assuj = GETPOST('localtax1assuj_value'); $object->localtax2_assuj = GETPOST('localtax2assuj_value'); - // We set country_id, and pays_code label of the chosen country + // We set country_id, and country_code label of the chosen country // TODO move to DAO class if ($object->country_id) { diff --git a/htdocs/webservices/server_contact.php b/htdocs/webservices/server_contact.php index 282fed25f2e..fefb218114b 100644 --- a/htdocs/webservices/server_contact.php +++ b/htdocs/webservices/server_contact.php @@ -535,7 +535,6 @@ function getContactsForThirdParty($authentication,$idthirdparty) 'fk_pays' => $contact->fk_pays?$contact->fk_pays:'', 'country_id' => $contact->country_id?$contact->country_id:'', - 'pays_code' => $contact->pays_code?$contact->pays_code:'', 'country_code' => $contact->country_code?$contact->country_code:'', 'pays' => $contact->pays?$contact->pays:'', 'country' => $contact->country?$contact->country:'', diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 8b38f98f7ab..91feba6bddf 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -199,7 +199,6 @@ if ($result >= 0) $member->pays=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; // deprecated $member->country=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; $member->country_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; - $member->pays_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; // deprecated $member->country_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; $member->phone=$ldapuser[$conf->global->LDAP_FIELD_PHONE];