2
0
forked from Wavyzz/dolibarr

Renamed llx_c_pays to llx_c_country & field "libelle" to "label"

This commit is contained in:
aspangaro
2014-08-10 13:37:39 +02:00
parent ebcc68cdfa
commit 0738103da8
53 changed files with 488 additions and 491 deletions

View File

@@ -72,6 +72,7 @@ For developers:
- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE. - New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE.
- New: Added hook "formConfirm" and "doActions" for supplier invoice card - New: Added hook "formConfirm" and "doActions" for supplier invoice card
- New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card - New: [ task #1511, #1426 ] Added hook "doActions" for supplier card and supplier order card
- New: renamed table llx_c_pays to llx_c_country & libelle field to label
WARNING: Following change may create regression for some external modules, but was necessary to make WARNING: Following change may create regression for some external modules, but was necessary to make
Dolibarr better: Dolibarr better:

View File

@@ -412,7 +412,7 @@ abstract class ActionsAdherentCardCommon
// We set country_id, and country_code label of the chosen country // We set country_id, and country_code label of the chosen country
if ($this->object->country_id) if ($this->object->country_id)
{ {
$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_pays WHERE rowid = ".$this->object->country_id; $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_country WHERE rowid = ".$this->object->country_id;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {

View File

@@ -64,9 +64,9 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
$sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,"; $sql = "SELECT d.rowid, d.firstname, d.lastname, d.login, d.societe as company, d.datefin,";
$sql.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,"; $sql.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
$sql.= " t.libelle as type,"; $sql.= " t.libelle as type,";
$sql.= " p.code as country_code, p.libelle as country"; $sql.= " c.code as country_code, c.label as country";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = c.rowid";
$sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1"; $sql.= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1";
if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid; if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid;
if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'"; if ($foruserlogin) $sql.=" AND d.login='".$db->escape($foruserlogin)."'";

View File

@@ -1058,12 +1058,12 @@ class Adherent extends CommonObject
$sql.= " d.datevalid as datev,"; $sql.= " d.datevalid as datev,";
$sql.= " d.country,"; $sql.= " d.country,";
$sql.= " d.state_id,"; $sql.= " d.state_id,";
$sql.= " p.rowid as country_id, p.code as country_code, p.libelle as country,"; $sql.= " c.rowid as country_id, c.code as country_code, c.label as country,";
$sql.= " dep.nom as state, dep.code_departement as state_code,"; $sql.= " dep.nom as state, dep.code_departement as state_code,";
$sql.= " t.libelle as type, t.cotisation as cotisation,"; $sql.= " t.libelle as type, t.cotisation as cotisation,";
$sql.= " u.rowid as user_id, u.login as user_login"; $sql.= " u.rowid as user_id, u.login as user_login";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent_type as t, ".MAIN_DB_PREFIX."adherent as d";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON d.country = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON d.country = p.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as dep ON d.state_id = dep.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON d.rowid = u.fk_member";
$sql.= " WHERE d.fk_adherent_type = t.rowid"; $sql.= " WHERE d.fk_adherent_type = t.rowid";

View File

@@ -945,7 +945,7 @@ else
$country=GETPOST('country','int'); $country=GETPOST('country','int');
if (!empty($country) || $object->country_id) if (!empty($country) || $object->country_id)
{ {
$sql = "SELECT rowid, code, libelle as label from ".MAIN_DB_PREFIX."c_pays where rowid = ".(!empty($country)?$country:$object->country_id); $sql = "SELECT rowid, code, label from ".MAIN_DB_PREFIX."c_country where rowid = ".(!empty($country)?$country:$object->country_id);
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {

View File

@@ -76,11 +76,11 @@ if ($mode)
$tab='statscountry'; $tab='statscountry';
$data = array(); $data = array();
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.libelle as label"; $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label";
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_pays as c on d.country = c.rowid"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" WHERE d.entity IN (".getEntity().")";
$sql.=" AND d.statut = 1"; $sql.=" AND d.statut = 1";
$sql.=" GROUP BY c.libelle, c.code"; $sql.=" GROUP BY c.label, c.code";
//print $sql; //print $sql;
} }
@@ -91,29 +91,29 @@ if ($mode)
$tab='statsstate'; $tab='statsstate';
$data = array(); $data = array();
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, c.nom as label2"; // $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, c.nom as label2"; //
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
$sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" WHERE d.entity IN (".getEntity().")";
$sql.=" AND d.statut = 1"; $sql.=" AND d.statut = 1";
$sql.=" GROUP BY p.libelle, p.code, c.nom"; $sql.=" GROUP BY co.label, co.code, c.nom";
//print $sql; //print $sql;
} }
if ($mode == 'memberbyregion') // if ($mode == 'memberbyregion') //
{ {
$label=$langs->trans("Country"); //pays $label=$langs->trans("Country");
$label2=$langs->trans("Region"); //département $label2=$langs->trans("Region"); //département
$tab='statsregion'; //onglet $tab='statsregion'; //onglet
$data = array(); //tableau de donnée $data = array(); //tableau de donnée
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, r.nom as label2"; $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, co.code, co.label, r.nom as label2";
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d LEFT JOIN ".MAIN_DB_PREFIX."c_departements as c on d.state_id = c.rowid";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r on c.fk_region = r.code_region";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as co on d.country = co.rowid";
$sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" WHERE d.entity IN (".getEntity().")";
$sql.=" AND d.statut = 1"; $sql.=" AND d.statut = 1";
$sql.=" GROUP BY p.libelle, p.code, r.nom"; //+ $sql.=" GROUP BY co.label, co.code, r.nom"; //+
//print $sql; //print $sql;
} }
if ($mode == 'memberbytown') if ($mode == 'memberbytown')
@@ -123,12 +123,12 @@ if ($mode)
$tab='statstown'; $tab='statstown';
$data = array(); $data = array();
$sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2"; $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, c.code, c.label, d.town as label2";
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d"; $sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.country = p.rowid"; $sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_country as c on d.country = c.rowid";
$sql.=" WHERE d.entity IN (".getEntity().")"; $sql.=" WHERE d.entity IN (".getEntity().")";
$sql.=" AND d.statut = 1"; $sql.=" AND d.statut = 1";
$sql.=" GROUP BY p.libelle, p.code, d.town"; $sql.=" GROUP BY c.label, c.code, d.town";
//print $sql; //print $sql;
} }

View File

@@ -318,7 +318,7 @@ if ($action == 'edit' || $action == 'updateedit')
// Country // Country
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">'; print '<tr '.$bc[$var].'><td class="fieldrequired"><label for="selectcountry_id">'.$langs->trans("Country").'</label></td><td class="maxwidthonsmartphone">';
//if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // Par defaut, pays de la localisation //if (empty($country_selected)) $country_selected=substr($langs->defaultlang,-2); // By default, country of localization
print $form->select_country($mysoc->country_id,'country_id'); print $form->select_country($mysoc->country_id,'country_id');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td></tr>'."\n"; print '</td></tr>'."\n";

View File

@@ -77,7 +77,7 @@ $tabname=array();
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique"; $tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
$tabname[2] = MAIN_DB_PREFIX."c_departements"; $tabname[2] = MAIN_DB_PREFIX."c_departements";
$tabname[3] = MAIN_DB_PREFIX."c_regions"; $tabname[3] = MAIN_DB_PREFIX."c_regions";
$tabname[4] = MAIN_DB_PREFIX."c_pays"; $tabname[4] = MAIN_DB_PREFIX."c_country";
$tabname[5] = MAIN_DB_PREFIX."c_civilite"; $tabname[5] = MAIN_DB_PREFIX."c_civilite";
$tabname[6] = MAIN_DB_PREFIX."c_actioncomm"; $tabname[6] = MAIN_DB_PREFIX."c_actioncomm";
$tabname[7] = MAIN_DB_PREFIX."c_chargesociales"; $tabname[7] = MAIN_DB_PREFIX."c_chargesociales";
@@ -132,20 +132,20 @@ $tablib[26]= "DictionaryResourceType";
// Requests to extract data // Requests to extract data
$tabsql=array(); $tabsql=array();
$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as country, 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[1] = "SELECT f.rowid as rowid, f.code, f.libelle, c.code as country_code, c.label as country, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c WHERE f.fk_pays=c.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 country, 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[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, c.code as country_code, c.label as country, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid and r.active=1 and c.active=1";
$tabsql[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as country, 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[3] = "SELECT r.rowid as rowid, r.code_region as code, r.nom as libelle, r.fk_pays as country_id, c.code as country_code, c.label as country, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c WHERE r.fk_pays=c.rowid and c.active=1";
$tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays"; $tabsql[4] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_country";
$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[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[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 country_code, p.libelle as country, 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, c.code as country_code, c.label as country, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_country as c WHERE a.fk_pays=c.rowid and c.active=1";
$tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, p.code as country_code, p.libelle as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON t.fk_country=p.rowid"; $tabsql[8] = "SELECT t.id as rowid, t.code as code, t.libelle, t.fk_country as country_id, c.code as country_code, c.label as country, t.active FROM ".MAIN_DB_PREFIX."c_typent as t LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON t.fk_country=c.rowid";
$tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies"; $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 country, 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, ".MAIN_DB_PREFIX."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, c.label as country, c.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, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t"; $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[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, accountancy_code FROM ".MAIN_DB_PREFIX."c_paiement AS c"; $tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active, accountancy_code 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 country_code, p.libelle as country, 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, c.code as country_code, c.label as country, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_country as c WHERE e.fk_pays=c.rowid and c.active=1";
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format"; $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, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel"; $tabsql[16]= "SELECT code, label as libelle, sortorder, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees"; $tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
@@ -155,8 +155,8 @@ $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[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[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[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 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"; $tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, c.code as country_code, c.label as country, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_country as c WHERE s.fk_pays=c.rowid and c.active=1";
$tabsql[25]= "SELECT t.rowid, t.taux, p.libelle as country, p.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_pays as p WHERE t.fk_pays=p.rowid"; $tabsql[25]= "SELECT t.rowid, t.taux, c.label as country, c.code as country_code, t.fk_pays as country_id, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_revenuestamp as t, ".MAIN_DB_PREFIX."c_country as c WHERE t.fk_pays=c.rowid";
$tabsql[26]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource"; $tabsql[26]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_type_resource";
// Criteria to sort dictionaries // Criteria to sort dictionaries
@@ -193,7 +193,7 @@ $tabfield=array();
$tabfield[1] = "code,libelle,country"; $tabfield[1] = "code,libelle,country";
$tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country" $tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country"
$tabfield[3] = "code,libelle,country_id,country"; $tabfield[3] = "code,libelle,country_id,country";
$tabfield[4] = "code,libelle"; $tabfield[4] = "code,label";
$tabfield[5] = "code,libelle"; $tabfield[5] = "code,libelle";
$tabfield[6] = "code,libelle,type,position"; $tabfield[6] = "code,libelle,type,position";
$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible"; $tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible";
@@ -222,7 +222,7 @@ $tabfieldvalue=array();
$tabfieldvalue[1] = "code,libelle,country"; $tabfieldvalue[1] = "code,libelle,country";
$tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region" $tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
$tabfieldvalue[3] = "code,libelle,country"; $tabfieldvalue[3] = "code,libelle,country";
$tabfieldvalue[4] = "code,libelle"; $tabfieldvalue[4] = "code,label";
$tabfieldvalue[5] = "code,libelle"; $tabfieldvalue[5] = "code,libelle";
$tabfieldvalue[6] = "code,libelle,type,position"; $tabfieldvalue[6] = "code,libelle,type,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible"; $tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
@@ -251,7 +251,7 @@ $tabfieldinsert=array();
$tabfieldinsert[1] = "code,libelle,fk_pays"; $tabfieldinsert[1] = "code,libelle,fk_pays";
$tabfieldinsert[2] = "code_departement,nom,fk_region"; $tabfieldinsert[2] = "code_departement,nom,fk_region";
$tabfieldinsert[3] = "code_region,nom,fk_pays"; $tabfieldinsert[3] = "code_region,nom,fk_pays";
$tabfieldinsert[4] = "code,libelle"; $tabfieldinsert[4] = "code,label";
$tabfieldinsert[5] = "code,civilite"; $tabfieldinsert[5] = "code,civilite";
$tabfieldinsert[6] = "code,libelle,type,position"; $tabfieldinsert[6] = "code,libelle,type,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible"; $tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
@@ -1019,7 +1019,7 @@ if ($id)
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]); $valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
$valuetoshow=nl2br($valuetoshow); $valuetoshow=nl2br($valuetoshow);
} }
else if ($fieldlist[$field]=='libelle' && $tabname[$id]==MAIN_DB_PREFIX.'c_pays') { else if ($fieldlist[$field]=='label' && $tabname[$id]==MAIN_DB_PREFIX.'c_country') {
$key=$langs->trans("Country".strtoupper($obj->code)); $key=$langs->trans("Country".strtoupper($obj->code));
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]); $valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
} }

View File

@@ -205,8 +205,8 @@ else
$vat_rates=array(); $vat_rates=array();
$sql.="SELECT taux as vat_rate"; $sql.="SELECT taux as vat_rate";
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.=" WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$mysoc->country_code."' AND taux != 0"; $sql.=" WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$mysoc->country_code."' AND taux != 0";
$sql.=" ORDER BY t.taux ASC"; $sql.=" ORDER BY t.taux ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)

View File

@@ -156,10 +156,10 @@ $i=0;
$sql = "SELECT t.rowid, t.taux"; $sql = "SELECT t.rowid, t.taux";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t";
$sql.= ", ".MAIN_DB_PREFIX."c_pays as p"; $sql.= ", ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = p.rowid"; $sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active = 1"; $sql.= " AND c.active = 1";
$sql.= " AND p.code = '".$mysoc->country_code."'"; $sql.= " AND c.code = '".$mysoc->country_code."'";
//print $request; //print $request;
$resql = $db->query($sql); $resql = $db->query($sql);

View File

@@ -607,10 +607,10 @@ class Account extends CommonObject
$sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.state_id, ba.fk_pays as country_id,"; $sql.= " ba.domiciliation, ba.proprio, ba.owner_address, ba.state_id, ba.fk_pays as country_id,";
$sql.= " ba.account_number, ba.accountancy_journal, ba.currency_code,"; $sql.= " ba.account_number, ba.accountancy_journal, ba.currency_code,";
$sql.= " ba.min_allowed, ba.min_desired, ba.comment,"; $sql.= " ba.min_allowed, ba.min_desired, ba.comment,";
$sql.= ' p.code as country_code, p.libelle as country,'; $sql.= ' c.code as country_code, c.label as country,';
$sql.= ' d.code_departement as state_code, d.nom as state'; $sql.= ' d.code_departement as state_code, d.nom as state';
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON ba.fk_pays = p.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON ba.fk_pays = c.rowid';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid'; $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON ba.state_id = d.rowid';
$sql.= " WHERE entity IN (".getEntity($this->element, 1).")"; $sql.= " WHERE entity IN (".getEntity($this->element, 1).")";
if ($id) $sql.= " AND ba.rowid = ".$id; if ($id) $sql.= " AND ba.rowid = ".$id;

View File

@@ -1260,7 +1260,7 @@ class BonPrelevement extends CommonObject
/* /*
* section Debiteur (sepa Debiteurs bloc lines) * section Debiteur (sepa Debiteurs bloc lines)
*/ */
$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, p.code as country_code,"; $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, c.code as country_code,";
$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
$sql.= " FROM"; $sql.= " FROM";
@@ -1268,12 +1268,12 @@ class BonPrelevement extends CommonObject
$sql.= " ".MAIN_DB_PREFIX."facture as f,"; $sql.= " ".MAIN_DB_PREFIX."facture as f,";
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf,"; $sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf,";
$sql.= " ".MAIN_DB_PREFIX."societe as soc,"; $sql.= " ".MAIN_DB_PREFIX."societe as soc,";
$sql.= " ".MAIN_DB_PREFIX."c_pays as p,"; $sql.= " ".MAIN_DB_PREFIX."c_country as c,";
$sql.= " ".MAIN_DB_PREFIX."societe_rib as rib"; $sql.= " ".MAIN_DB_PREFIX."societe_rib as rib";
$sql.= " WHERE pl.fk_prelevement_bons = ".$this->id; $sql.= " WHERE pl.fk_prelevement_bons = ".$this->id;
$sql.= " AND pl.rowid = pf.fk_prelevement_lignes"; $sql.= " AND pl.rowid = pf.fk_prelevement_lignes";
$sql.= " AND pf.fk_facture = f.rowid"; $sql.= " AND pf.fk_facture = f.rowid";
$sql.= " AND soc.fk_pays = p.rowid"; $sql.= " AND soc.fk_pays = c.rowid";
$sql.= " AND soc.rowid = f.fk_soc"; $sql.= " AND soc.rowid = f.fk_soc";
$sql.= " AND rib.fk_soc = f.fk_soc"; $sql.= " AND rib.fk_soc = f.fk_soc";
$sql.= " AND rib.default_rib = 1"; $sql.= " AND rib.default_rib = 1";
@@ -1493,7 +1493,7 @@ class BonPrelevement extends CommonObject
* @param string $row_address soc.address AS adr, * @param string $row_address soc.address AS adr,
* @param string $row_zip soc.zip * @param string $row_zip soc.zip
* @param string $row_town soc.town * @param string $row_town soc.town
* @param string $row_country_code p.code AS pays, * @param string $row_country_code c.code AS country,
* @param string $row_cb pl.code_banque AS cb, * @param string $row_cb pl.code_banque AS cb,
* @param string $row_cg pl.code_guichet AS cg, * @param string $row_cg pl.code_guichet AS cg,
* @param string $row_cc pl.number AS cc, * @param string $row_cc pl.number AS cc,
@@ -1648,7 +1648,7 @@ class BonPrelevement extends CommonObject
$obj = $this->db->fetch_object($resql); $obj = $this->db->fetch_object($resql);
// DONNEES BRUTES : par la suite Rows['XXX'] de la requete au dessus // DONNEES BRUTES : par la suite Rows['XXX'] de la requete au dessus
$pays = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY); $country = explode(':', $configuration->global->MAIN_INFO_SOCIETE_COUNTRY);
$IdBon = sprintf("%05d", $obj->rowid); $IdBon = sprintf("%05d", $obj->rowid);
$RefBon = $obj->ref; $RefBon = $obj->ref;
$type = ($nombre == 1) ? 'FRST' : 'RCUR' ; $type = ($nombre == 1) ? 'FRST' : 'RCUR' ;
@@ -1673,7 +1673,7 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Cdtr>'.$CrLf; $XML_SEPA_INFO .= ' <Cdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.'</Nm>'.$CrLf; $XML_SEPA_INFO .= ' <Nm>'.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$pays[1].'</Ctry>'.$CrLf; $XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$configuration->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$configuration->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$configuration->global->MAIN_INFO_SOCIETE_ZIP.' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$configuration->global->MAIN_INFO_SOCIETE_ZIP.' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
@@ -1691,7 +1691,7 @@ class BonPrelevement extends CommonObject
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf; /* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.'</Nm>'.$CrLf; $XML_SEPA_INFO .= ' <Nm>'.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.'</Nm>'.$CrLf;
$XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' <PstlAdr>'.$CrLf;
$XML_SEPA_INFO .= ' <Ctry>'.$pays[1].'</Ctry>'.$CrLf; $XML_SEPA_INFO .= ' <Ctry>'.$country[1].'</Ctry>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ADDRESS.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf; $XML_SEPA_INFO .= ' <AdrLine>'.$conf->global->MAIN_INFO_SOCIETE_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf; $XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;

View File

@@ -450,7 +450,7 @@ abstract class ActionsContactCardCommon
// We set country_id, and country_code label of the chosen country // We set country_id, and country_code label of the chosen country
if ($this->object->country_id) if ($this->object->country_id)
{ {
$sql = "SELECT code, libelle FROM ".MAIN_DB_PREFIX."c_pays WHERE rowid = ".$this->object->country_id; $sql = "SELECT code, label FROM ".MAIN_DB_PREFIX."c_country WHERE rowid = ".$this->object->country_id;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
@@ -460,9 +460,9 @@ abstract class ActionsContactCardCommon
{ {
dol_print_error($this->db); dol_print_error($this->db);
} }
$this->object->country_id = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country_id = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label;
$this->object->country_code = $obj->code; $this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle; $this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->label;
} }
} }

View File

@@ -506,12 +506,12 @@ class Contact extends CommonObject
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,"; $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid, c.skype,";
$sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,"; $sql.= " c.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
$sql.= " c.import_key,"; $sql.= " c.import_key,";
$sql.= " p.libelle as country, p.code as country_code,"; $sql.= " co.label as country, co.code as country_code,";
$sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " d.nom as state, d.code_departement as state_code,";
$sql.= " u.rowid as user_id, u.login as user_login,"; $sql.= " u.rowid as user_id, u.login as user_login,";
$sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang"; $sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON c.fk_pays = co.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";

View File

@@ -124,9 +124,9 @@ $formother=new FormOther($db);
$sql = "SELECT s.rowid as socid, s.nom as name,"; $sql = "SELECT s.rowid as socid, s.nom as name,";
$sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,"; $sql.= " p.rowid as cidp, p.lastname as lastname, p.statut, p.firstname, p.poste, p.email, p.skype,";
$sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,"; $sql.= " p.phone, p.phone_mobile, p.fax, p.fk_pays, p.priv, p.tms,";
$sql.= " cp.code as country_code"; $sql.= " co.code as country_code";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; $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."c_country as co ON co.rowid = p.fk_pays";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = p.fk_soc";
if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cs ON p.rowid = cs.fk_socpeople"; // We need this table joined to the select in order to filter by categ if (! empty($search_categ)) $sql.= ' LEFT JOIN '.MAIN_DB_PREFIX."categorie_contact as cs ON p.rowid = cs.fk_socpeople"; // We need this table joined to the select in order to filter by categ
if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc"; if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";

View File

@@ -63,13 +63,13 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table if (! empty($conf->global->MAIN_USE_ZIPTOWN_DICTIONNARY)) // Use zip-town table
{ {
$sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country"; $sql = "SELECT z.rowid, z.zip, z.town, z.fk_county, z.fk_pays as fk_country";
$sql.= ", p.rowid as fk_country, p.code as country_code, p.libelle as country"; $sql.= ", c.rowid as fk_country, c.code as country_code, c.label as country";
$sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county"; $sql.= ", d.rowid as fk_county, d.code_departement as county_code, d.nom as county";
$sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_pays as p)"; $sql.= " FROM (".MAIN_DB_PREFIX."c_ziptown as z,".MAIN_DB_PREFIX."c_country as c)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON z.fk_county = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_regions as r ON d.fk_region = r.code_region";
$sql.= " WHERE z.fk_pays = p.rowid"; $sql.= " WHERE z.fk_pays = c.rowid";
$sql.= " AND z.active = 1 AND p.active = 1"; $sql.= " AND z.active = 1 AND c.active = 1";
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'"; if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'"; if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($town) . "%'";
$sql.= " ORDER BY z.zip, z.town"; $sql.= " ORDER BY z.zip, z.town";
@@ -78,11 +78,11 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
else // Use table of third parties else // Use table of third parties
{ {
$sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country"; $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
$sql.= ", p.code as country_code, p.libelle as country"; $sql.= ", c.code as country_code, c.label as country";
$sql.= ", d.code_departement as county_code , d.nom as county"; $sql.= ", d.code_departement as county_code , d.nom as county";
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s'; $sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_pays as p ON fk_pays = p.rowid'; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_country as c ON fk_pays = c.rowid';
$sql.= " WHERE"; $sql.= " WHERE";
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'"; if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'"; if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";

View File

@@ -16,9 +16,9 @@
*/ */
/** /**
* \file htdocs/core/class/cpays.class.php * \file htdocs/core/class/ccountry.class.php
* \ingroup core * \ingroup core
* \brief This file is a CRUD class file (Create/Read/Update/Delete) for c_pays dictionary * \brief This file is a CRUD class file (Create/Read/Update/Delete) for c_country dictionary
*/ */
// Put here all includes required by your class file // Put here all includes required by your class file
@@ -30,18 +30,18 @@
/** /**
* Class to manage dictionary Countries (used by imports) * Class to manage dictionary Countries (used by imports)
*/ */
class Cpays // extends CommonObject class Ccountry // extends CommonObject
{ {
var $db; //!< To store db handler var $db; //!< To store db handler
var $error; //!< To return error code (or message) var $error; //!< To return error code (or message)
var $errors=array(); //!< To return several error codes (or messages) var $errors=array(); //!< To return several error codes (or messages)
//var $element='cpays'; //!< Id that identify managed objects //var $element='ccountry'; //!< Id that identify managed objects
//var $table_element='cpays'; //!< Name of table without prefix where object is stored //var $table_element='ccountry'; //!< Name of table without prefix where object is stored
var $id; var $id;
var $code; var $code;
var $code_iso; var $code_iso;
var $libelle; var $label;
var $active; var $active;
@@ -74,24 +74,24 @@ class Cpays // extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->code)) $this->code=trim($this->code); if (isset($this->code)) $this->code=trim($this->code);
if (isset($this->code_iso)) $this->code_iso=trim($this->code_iso); if (isset($this->code_iso)) $this->code_iso=trim($this->code_iso);
if (isset($this->libelle)) $this->libelle=trim($this->libelle); if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->active)) $this->active=trim($this->active); if (isset($this->active)) $this->active=trim($this->active);
// Check parameters // Check parameters
// Put here code to add control on parameters values // Put here code to add control on parameters values
// Insert request // Insert request
$sql = "INSERT INTO ".MAIN_DB_PREFIX."c_pays("; $sql = "INSERT INTO ".MAIN_DB_PREFIX."c_country(";
$sql.= "rowid,"; $sql.= "rowid,";
$sql.= "code,"; $sql.= "code,";
$sql.= "code_iso,"; $sql.= "code_iso,";
$sql.= "libelle,"; $sql.= "label,";
$sql.= "active"; $sql.= "active";
$sql.= ") VALUES ("; $sql.= ") VALUES (";
$sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").","; $sql.= " ".(! isset($this->rowid)?'NULL':"'".$this->rowid."'").",";
$sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").","; $sql.= " ".(! isset($this->code)?'NULL':"'".$this->db->escape($this->code)."'").",";
$sql.= " ".(! isset($this->code_iso)?'NULL':"'".$this->db->escape($this->code_iso)."'").","; $sql.= " ".(! isset($this->code_iso)?'NULL':"'".$this->db->escape($this->code_iso)."'").",";
$sql.= " ".(! isset($this->libelle)?'NULL':"'".$this->db->escape($this->libelle)."'").","; $sql.= " ".(! isset($this->label)?'NULL':"'".$this->db->escape($this->label)."'").",";
$sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'").""; $sql.= " ".(! isset($this->active)?'NULL':"'".$this->active."'")."";
$sql.= ")"; $sql.= ")";
@@ -103,7 +103,7 @@ class Cpays // extends CommonObject
if (! $error) if (! $error)
{ {
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_pays"); $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."c_country");
if (! $notrigger) if (! $notrigger)
{ {
@@ -152,9 +152,9 @@ class Cpays // extends CommonObject
$sql.= " t.rowid,"; $sql.= " t.rowid,";
$sql.= " t.code,"; $sql.= " t.code,";
$sql.= " t.code_iso,"; $sql.= " t.code_iso,";
$sql.= " t.libelle,"; $sql.= " t.label,";
$sql.= " t.active"; $sql.= " t.active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays as t"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country as t";
if ($id) $sql.= " WHERE t.rowid = ".$id; if ($id) $sql.= " WHERE t.rowid = ".$id;
elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'"; elseif ($code) $sql.= " WHERE t.code = '".$this->db->escape($code)."'";
@@ -169,7 +169,7 @@ class Cpays // extends CommonObject
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->code = $obj->code; $this->code = $obj->code;
$this->code_iso = $obj->code_iso; $this->code_iso = $obj->code_iso;
$this->libelle = $obj->libelle; $this->label = $obj->label;
$this->active = $obj->active; $this->active = $obj->active;
} }
$this->db->free($resql); $this->db->free($resql);
@@ -199,7 +199,7 @@ class Cpays // extends CommonObject
// Clean parameters // Clean parameters
if (isset($this->code)) $this->code=trim($this->code); if (isset($this->code)) $this->code=trim($this->code);
if (isset($this->code_iso)) $this->code_iso=trim($this->code_iso); if (isset($this->code_iso)) $this->code_iso=trim($this->code_iso);
if (isset($this->libelle)) $this->libelle=trim($this->libelle); if (isset($this->label)) $this->label=trim($this->label);
if (isset($this->active)) $this->active=trim($this->active); if (isset($this->active)) $this->active=trim($this->active);
@@ -207,10 +207,10 @@ class Cpays // extends CommonObject
// Put here code to add control on parameters values // Put here code to add control on parameters values
// Update request // Update request
$sql = "UPDATE ".MAIN_DB_PREFIX."c_pays SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."c_country SET";
$sql.= " code=".(isset($this->code)?"'".$this->db->escape($this->code)."'":"null").","; $sql.= " code=".(isset($this->code)?"'".$this->db->escape($this->code)."'":"null").",";
$sql.= " code_iso=".(isset($this->code_iso)?"'".$this->db->escape($this->code_iso)."'":"null").","; $sql.= " code_iso=".(isset($this->code_iso)?"'".$this->db->escape($this->code_iso)."'":"null").",";
$sql.= " libelle=".(isset($this->libelle)?"'".$this->db->escape($this->libelle)."'":"null").","; $sql.= " label=".(isset($this->label)?"'".$this->db->escape($this->label)."'":"null").",";
$sql.= " active=".(isset($this->active)?$this->active:"null").""; $sql.= " active=".(isset($this->active)?$this->active:"null")."";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
@@ -267,7 +267,7 @@ class Cpays // extends CommonObject
global $conf, $langs; global $conf, $langs;
$error=0; $error=0;
$sql = "DELETE FROM ".MAIN_DB_PREFIX."c_pays"; $sql = "DELETE FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE rowid=".$this->id; $sql.= " WHERE rowid=".$this->id;
$this->db->begin(); $this->db->begin();

View File

@@ -449,19 +449,6 @@ class Form
return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext); return $this->textwithtooltip($text, $htmltext, 2, $direction, $img, $extracss, $notabs, '', $noencodehtmltext);
} }
/**
* Return combo list of activated countries, into language of user
*
* @param string $selected Id or Code or Label of preselected country
* @param string $htmlname Name of html select object
* @param string $htmloption Options html on select object
* @return void
*/
function select_pays($selected='',$htmlname='country_id',$htmloption='')
{
print $this->select_country($selected,$htmlname,$htmloption);
}
/** /**
* Return combo list of activated countries, into language of user * Return combo list of activated countries, into language of user
* *
@@ -481,8 +468,8 @@ class Form
$countryArray=array(); $countryArray=array();
$label=array(); $label=array();
$sql = "SELECT rowid, code as code_iso, libelle as label"; $sql = "SELECT rowid, code as code_iso, label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
//$sql.= " ORDER BY code ASC"; //$sql.= " ORDER BY code ASC";
@@ -490,7 +477,7 @@ class Form
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)
{ {
$out.= '<select id="select'.$htmlname.'" class="flat selectpays" name="'.$htmlname.'" '.$htmloption.'>'; $out.= '<select id="select'.$htmlname.'" class="flat selectcountry" name="'.$htmlname.'" '.$htmloption.'>';
$num = $this->db->num_rows($resql); $num = $this->db->num_rows($resql);
$i = 0; $i = 0;
if ($num) if ($num)
@@ -3436,10 +3423,10 @@ class Form
if ($num > 0) return $num; // Cache deja charge if ($num > 0) return $num; // Cache deja charge
$sql = "SELECT DISTINCT t.taux, t.recuperableonly"; $sql = "SELECT DISTINCT t.taux, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = p.rowid"; $sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active = 1"; $sql.= " AND t.active = 1";
$sql.= " AND p.code IN (".$country_code.")"; $sql.= " AND c.code IN (".$country_code.")";
$sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC"; $sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@@ -3523,14 +3510,14 @@ class Form
//exit; //exit;
// Define list of countries to use to search VAT rates to show // Define list of countries to use to search VAT rates to show
// First we defined code_pays to use to find list // First we defined code_country to use to find list
if (is_object($societe_vendeuse)) if (is_object($societe_vendeuse))
{ {
$code_pays="'".$societe_vendeuse->country_code."'"; $code_country="'".$societe_vendeuse->country_code."'";
} }
else else
{ {
$code_pays="'".$mysoc->country_code."'"; // Pour compatibilite ascendente $code_country="'".$mysoc->country_code."'"; // Pour compatibilite ascendente
} }
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) // If option to have vat for end customer for services is on if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC)) // If option to have vat for end customer for services is on
{ {
@@ -3541,12 +3528,12 @@ class Form
{ {
if ($type == 1) // We know product is a service if ($type == 1) // We know product is a service
{ {
$code_pays.=",'".$societe_acheteuse->country_code."'"; $code_country.=",'".$societe_acheteuse->country_code."'";
} }
} }
else if (! $idprod) // We don't know type of product else if (! $idprod) // We don't know type of product
{ {
$code_pays.=",'".$societe_acheteuse->country_code."'"; $code_country.=",'".$societe_acheteuse->country_code."'";
} }
else else
{ {
@@ -3554,14 +3541,14 @@ class Form
$prodstatic->fetch($idprod); $prodstatic->fetch($idprod);
if ($prodstatic->type == 1) // We know product is a service if ($prodstatic->type == 1) // We know product is a service
{ {
$code_pays.=",'".$societe_acheteuse->country_code."'"; $code_country.=",'".$societe_acheteuse->country_code."'";
} }
} }
} }
} }
// Now we get list // Now we get list
$num = $this->load_cache_vatrates($code_pays); $num = $this->load_cache_vatrates($code_country);
if ($num > 0) if ($num > 0)
{ {
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '') // Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')

View File

@@ -222,13 +222,13 @@ class FormCompany
$out=''; $out='';
// On recherche les departements/cantons/province active d'une region et pays actif // On recherche les departements/cantons/province active d'une region et pays actif
$sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, p.libelle as country, p.code as country_code FROM"; $sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, c.label as country, c.code as country_code FROM";
$sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_pays as p"; $sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid"; $sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
$sql .= " AND d.active = 1 AND r.active = 1 AND p.active = 1"; $sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
if ($country_codeid && is_numeric($country_codeid)) $sql .= " AND p.rowid = '".$country_codeid."'"; if ($country_codeid && is_numeric($country_codeid)) $sql .= " AND c.rowid = '".$country_codeid."'";
if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND p.code = '".$country_codeid."'"; if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND c.code = '".$country_codeid."'";
$sql .= " ORDER BY p.code, d.code_departement"; $sql .= " ORDER BY c.code, d.code_departement";
dol_syslog(get_class($this)."::select_departement", LOG_DEBUG); dol_syslog(get_class($this)."::select_departement", LOG_DEBUG);
$result=$this->db->query($sql); $result=$this->db->query($sql);
@@ -303,9 +303,10 @@ class FormCompany
global $conf,$langs; global $conf,$langs;
$langs->load("dict"); $langs->load("dict");
$sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, p.code as country_code, p.libelle as country FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p"; $sql = "SELECT r.rowid, r.code_region as code, r.nom as libelle, r.active, c.code as country_code, c.label as country";
$sql.= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1"; $sql.= " FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " ORDER BY p.code, p.libelle ASC"; $sql.= " WHERE r.fk_pays=c.rowid AND r.active = 1 and c.active = 1";
$sql.= " ORDER BY c.code, c.label ASC";
dol_syslog(get_class($this)."::select_region", LOG_DEBUG); dol_syslog(get_class($this)."::select_region", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@@ -335,11 +336,11 @@ class FormCompany
if ($selected > 0 && $selected == $obj->code) if ($selected > 0 && $selected == $obj->code)
{ {
print '<option value="'.$obj->code.'" selected="selected">'.$obj->libelle.'</option>'; print '<option value="'.$obj->code.'" selected="selected">'.$obj->label.'</option>';
} }
else else
{ {
print '<option value="'.$obj->code.'">'.$obj->libelle.'</option>'; print '<option value="'.$obj->code.'">'.$obj->label.'</option>';
} }
} }
$i++; $i++;
@@ -440,13 +441,13 @@ class FormCompany
$out=''; $out='';
// On recherche les formes juridiques actives des pays actifs // On recherche les formes juridiques actives des pays actifs
$sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, p.libelle as country, p.code as country_code"; $sql = "SELECT f.rowid, f.code as code , f.libelle as label, f.active, c.label as country, c.code as country_code";
$sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE f.fk_pays=p.rowid"; $sql .= " WHERE f.fk_pays=c.rowid";
$sql .= " AND f.active = 1 AND p.active = 1"; $sql .= " AND f.active = 1 AND c.active = 1";
if ($country_codeid) $sql .= " AND p.code = '".$country_codeid."'"; if ($country_codeid) $sql .= " AND c.code = '".$country_codeid."'";
if ($filter) $sql .= " ".$filter; if ($filter) $sql .= " ".$filter;
$sql .= " ORDER BY p.code"; $sql .= " ORDER BY c.code";
dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG); dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@@ -164,10 +164,10 @@ class FormOther
global $langs; global $langs;
$sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,"; $sql = "SELECT e.rowid, e.code, e.libelle, e.price, e.organization,";
$sql.= " p.libelle as pays"; $sql.= " c.label as country";
$sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_ecotaxe as e,".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE e.active = 1 AND e.fk_pays = p.rowid"; $sql.= " WHERE e.active = 1 AND e.fk_pays = c.rowid";
$sql.= " ORDER BY pays, e.organization ASC, e.code ASC"; $sql.= " ORDER BY country, e.organization ASC, e.code ASC";
dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG); dol_syslog(get_class($this).'::select_ecotaxes', LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@@ -223,9 +223,9 @@ class FormOther
$out=''; $out='';
$sql = "SELECT r.taux"; $sql = "SELECT r.taux";
$sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r,".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE r.active = 1 AND r.fk_pays = p.rowid"; $sql.= " WHERE r.active = 1 AND r.fk_pays = c.rowid";
$sql.= " AND p.code = '".$country_code."'"; $sql.= " AND c.code = '".$country_code."'";
dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG); dol_syslog(get_class($this).'::select_revenue_stamp', LOG_DEBUG);
$resql=$this->db->query($sql); $resql=$this->db->query($sql);

View File

@@ -73,9 +73,9 @@ class FormSocialContrib
else else
{ {
$sql = "SELECT c.id, c.libelle as type"; $sql = "SELECT c.id, c.libelle as type";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c, ".MAIN_DB_PREFIX."c_country as co";
$sql.= " WHERE c.active = 1 AND c.fk_pays = p.rowid"; $sql.= " WHERE c.active = 1 AND c.fk_pays = co.rowid";
$sql.= " AND p.code = '".$mysoc->country_code."'"; $sql.= " AND co.code = '".$mysoc->country_code."'";
$sql.= " ORDER BY c.libelle ASC"; $sql.= " ORDER BY c.libelle ASC";
} }

View File

@@ -262,10 +262,10 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv=
if (! is_object($dbtouse)) $dbtouse=$db; if (! is_object($dbtouse)) $dbtouse=$db;
if (! is_object($outputlangs)) $outputlangs=$langs; if (! is_object($outputlangs)) $outputlangs=$langs;
$sql = "SELECT rowid, code, libelle FROM ".MAIN_DB_PREFIX."c_pays"; $sql = "SELECT rowid, code, label FROM ".MAIN_DB_PREFIX."c_country";
if (is_numeric($searchkey)) $sql.= " WHERE rowid=".$searchkey; if (is_numeric($searchkey)) $sql.= " WHERE rowid=".$searchkey;
elseif (! empty($searchkey)) $sql.= " WHERE code='".$db->escape($searchkey)."'"; elseif (! empty($searchkey)) $sql.= " WHERE code='".$db->escape($searchkey)."'";
else $sql.= " WHERE libelle='".$db->escape($searchlabel)."'"; else $sql.= " WHERE label='".$db->escape($searchlabel)."'";
dol_syslog("Company.lib::getCountry", LOG_DEBUG); dol_syslog("Company.lib::getCountry", LOG_DEBUG);
$resql=$dbtouse->query($sql); $resql=$dbtouse->query($sql);
@@ -274,7 +274,7 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv=
$obj = $dbtouse->fetch_object($resql); $obj = $dbtouse->fetch_object($resql);
if ($obj) if ($obj)
{ {
$label=((! empty($obj->libelle) && $obj->libelle!='-')?$obj->libelle:''); $label=((! empty($obj->label) && $obj->label!='-')?$obj->label:'');
if (is_object($outputlangs)) if (is_object($outputlangs))
{ {
$outputlangs->load("dict"); $outputlangs->load("dict");

View File

@@ -2989,8 +2989,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
$sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".$tva." AND t.active = 1"; $sql .= " AND t.taux = ".$tva." AND t.active = 1";
dol_syslog("get_localtax", LOG_DEBUG); dol_syslog("get_localtax", LOG_DEBUG);
@@ -3037,11 +3037,11 @@ function isOnlyOneLocalTax($local)
function get_localtax_by_third($local) function get_localtax_by_third($local)
{ {
global $db, $mysoc; global $db, $mysoc;
$sql="SELECT t.localtax1, t.localtax2 "; $sql ="SELECT t.localtax1, t.localtax2 ";
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_pays as p ON p.rowid=t.fk_pays"; $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as t inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=t.fk_pays";
$sql.=" WHERE p.code = '".$mysoc->country_code."' AND t.taux=(SELECT max(tt.taux)"; $sql.=" WHERE c.code = '".$mysoc->country_code."' AND t.taux=(SELECT max(tt.taux)";
$sql.=" FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_pays as p ON p.rowid=tt.fk_pays"; $sql.=" FROM ".MAIN_DB_PREFIX."c_tva as tt inner join ".MAIN_DB_PREFIX."c_country as c ON c.rowid=tt.fk_pays";
$sql.= " WHERE p.code = '".$mysoc->country_code."')"; $sql.=" WHERE c.code = '".$mysoc->country_code."')";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@@ -3077,8 +3077,8 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller)
// Search local taxes // Search local taxes
$sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$buyer->country_code."'"; $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1"; $sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
$resql=$db->query($sql); $resql=$db->query($sql);
@@ -3212,8 +3212,8 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
{ {
// If vat of product for the country not found or not defined, we return higher vat of country. // If vat of product for the country not found or not defined, we return higher vat of country.
$sql = "SELECT taux as vat_rate"; $sql = "SELECT taux as vat_rate";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
$sql.= $db->plimit(1); $sql.= $db->plimit(1);
@@ -3282,8 +3282,8 @@ function get_product_localtax_for_country($idprod, $local, $thirdparty_seller)
{ {
// If vat of product for the country not found or not defined, we return higher vat of country. // If vat of product for the country not found or not defined, we return higher vat of country.
$sql = "SELECT taux as vat_rate, localtax1, localtax2"; $sql = "SELECT taux as vat_rate, localtax1, localtax2";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC"; $sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
$sql.= $db->plimit(1); $sql.= $db->plimit(1);

View File

@@ -192,7 +192,7 @@ class modAdherent extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as extra ON a.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'adherent_extrafields as extra ON a.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'cotisation as c ON c.fk_adherent = a.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'cotisation as c ON c.fk_adherent = a.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON a.state_id = d.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.country = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON a.country = c.rowid';
$this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid'; $this->export_sql_end[$r] .=' WHERE a.fk_adherent_type = ta.rowid';
$this->export_dependencies_array[$r]=array('subscription'=>'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('subscription'=>'c.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@@ -371,20 +371,20 @@ class modAgenda extends DolibarrModules
'ac.datep2'=>"DateActionEnd",'ac.label'=>"Title",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp", 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Title",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp",
'cac.libelle'=>"ActionType", 'cac.libelle'=>"ActionType",
's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town', 's.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town',
'cp.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4', 'co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4',
's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra'); 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra');
$this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date", $this->export_TypeFields_array[$r]=array('ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date",
'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Number", 'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Number",
'ac.durationp'=>"Duree", 'ac.durationp'=>"Duree",
'cac.libelle'=>"List:c_actioncomm:libelle:rowid", 'cac.libelle'=>"List:c_actioncomm:libelle:rowid",
's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text', 's.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text',
'cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text', 'co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text',
's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text'); 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text');
$this->export_entities_array[$r]=array('ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action", $this->export_entities_array[$r]=array('ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action",
'ac.datep2'=>"action",'ac.label'=>"action",'ac.note'=>"action",'ac.percent'=>"action",'ac.durationp'=>"action", 'ac.datep2'=>"action",'ac.label'=>"action",'ac.note'=>"action",'ac.percent'=>"action",'ac.durationp'=>"action",
'cac.libelle'=>"action", 'cac.libelle'=>"action",
's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company', 's.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company',
'cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company', 'co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company',
's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',); 's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',);
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
@@ -392,7 +392,7 @@ class modAgenda extends DolibarrModules
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as cp on s.fk_pays = cp.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co on s.fk_pays = co.rowid';
$this->export_sql_end[$r] .=' Where ac.entity = '.$conf->entity; $this->export_sql_end[$r] .=' Where ac.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' ORDER BY datep'; $this->export_sql_end[$r] .=' ORDER BY datep';

View File

@@ -116,11 +116,11 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r]='category'; $this->export_icon[$r]='category';
$this->export_enabled[$r]='$conf->fournisseur->enabled'; $this->export_enabled[$r]='$conf->fournisseur->enabled';
$this->export_permission[$r]=array(array("categorie","lire"),array("fournisseur","lire")); $this->export_permission[$r]=array(array("categorie","lire"),array("fournisseur","lire"));
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic"); $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'c.label'=>"Country",'c.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic");
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text"); $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company"); // We define here only fields that use another picto $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'c.label'=>"company",'c.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company"); // We define here only fields that use another picto
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_fournisseur as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories $this->export_sql_end[$r] .=' AND u.type = 1'; // Supplier categories
@@ -131,11 +131,11 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r]='category'; $this->export_icon[$r]='category';
$this->export_enabled[$r]='$conf->societe->enabled'; $this->export_enabled[$r]='$conf->societe->enabled';
$this->export_permission[$r]=array(array("categorie","lire"),array("societe","lire")); $this->export_permission[$r]=array(array("categorie","lire"),array("societe","lire"));
$this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus'); $this->export_fields_array[$r]=array('u.rowid'=>"CategId",'u.label'=>"Label",'u.description'=>"Description",'s.rowid'=>'IdThirdParty','s.nom'=>'Name','s.prefix_comm'=>"Prefix",'s.client'=>"Customer",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'c.country'=>"Country",'c.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_public'=>"NotePublic",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus');
$this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code'); $this->export_TypeFields_array[$r]=array('u.label'=>"Text",'u.description'=>"Text",'s.rowid'=>'List:societe:nom','s.nom'=>'Text','s.prefix_comm'=>"Text",'s.client'=>"Text",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'c.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Numeric",'s.note_public'=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code');
$this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'p.libelle'=>"company",'p.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company",'s.fk_prospectlevel'=>'company','s.fk_stcomm'=>'company'); // We define here only fields that use another picto $this->export_entities_array[$r]=array('s.rowid'=>'company','s.nom'=>'company','s.prefix_comm'=>"company",'s.client'=>"company",'s.datec'=>"company",'s.tms'=>"company",'s.code_client'=>"company",'s.address'=>"company",'s.zip'=>"company",'s.town'=>"company",'c.label'=>"company",'c.code'=>"company",'s.phone'=>"company",'s.fax'=>"company",'s.url'=>"company",'s.email'=>"company",'s.siret'=>"company",'s.siren'=>"company",'s.ape'=>"company",'s.idprof4'=>"company",'s.tva_intra'=>"company",'s.capital'=>"company",'s.note_public'=>"company",'s.fk_prospectlevel'=>'company','s.fk_stcomm'=>'company'); // We define here only fields that use another picto
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'categorie as u, '.MAIN_DB_PREFIX.'categorie_societe as cf, '.MAIN_DB_PREFIX.'societe as s LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid'; $this->export_sql_end[$r] .=' WHERE u.rowid = cf.fk_categorie AND cf.fk_societe = s.rowid';
$this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity; $this->export_sql_end[$r] .=' AND u.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories $this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories
@@ -231,7 +231,7 @@ class modCategorie extends DolibarrModules
); // We define here only fields that use another picto ); // We define here only fields that use another picto
$this->export_sql_start[$r] = 'SELECT DISTINCT '; $this->export_sql_start[$r] = 'SELECT DISTINCT ';
$this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p'; $this->export_sql_end[$r] = ' FROM ' . MAIN_DB_PREFIX . 'categorie as u, '.MAIN_DB_PREFIX . 'categorie_contact as cp, '.MAIN_DB_PREFIX . 'socpeople as p';
$this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_pays as country ON p.fk_pays = country.rowid'; $this->export_sql_end[$r] .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'c_country as country ON p.fk_pays = country.rowid';
$this->export_sql_end[$r] .= ' WHERE u.rowid = cp.fk_categorie AND cp.fk_socpeople = p.rowid AND u.entity = ' . $conf->entity; $this->export_sql_end[$r] .= ' WHERE u.rowid = cp.fk_categorie AND cp.fk_socpeople = p.rowid AND u.entity = ' . $conf->entity;
$this->export_sql_end[$r] .= ' AND u.type = 4'; // contact categories $this->export_sql_end[$r] .= ' AND u.type = 4'; // contact categories

View File

@@ -173,15 +173,15 @@ class modCommande extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='CustomersOrdersAndOrdersLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("commande","commande","export")); $this->export_permission[$r]=array(array("commande","commande","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.libelle'=>'Country','co.code'=>"CountryCode",'s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.label'=>'Country','co.code'=>"CountryCode",'s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_commande'=>"OrderDate",'c.amount_ht'=>"Amount",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total_ttc'=>"TotalTTC",'c.facture'=>"Billed",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Number",'cd.qty'=>"Number",'cd.total_ht'=>"Number",'cd.total_tva'=>"Number",'cd.total_ttc'=>"Number",'p.rowid'=>'List:Product:ref','p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','co.libelle'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','co.label'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"order",'c.ref'=>"order",'c.ref_client'=>"order",'c.fk_soc'=>"order",'c.date_creation'=>"order",'c.date_commande'=>"order",'c.amount_ht'=>"order",'c.remise_percent'=>"order",'c.total_ht'=>"order",'c.total_ttc'=>"order",'c.facture'=>"order",'c.fk_statut'=>"order",'c.note'=>"order",'c.date_livraison'=>"order",'cd.rowid'=>'order_line','cd.label'=>"order_line",'cd.description'=>"order_line",'cd.product_type'=>'order_line','cd.tva_tx'=>"order_line",'cd.qty'=>"order_line",'cd.total_ht'=>"order_line",'cd.total_tva'=>"order_line",'cd.total_ttc'=>"order_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('order_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'commande as c, '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'commande as c, '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_commande';

View File

@@ -216,15 +216,15 @@ class modExpedition extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='Shipments'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("expedition","shipment","export")); $this->export_permission[$r]=array(array("expedition","shipment","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.libelle'=>'Country','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note_public'=>"NotePublic",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.label'=>'Country','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.idprof5'=>'ProfId5','s.idprof6'=>'ProfId6','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_customer'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.date_creation'=>"DateCreation",'c.date_delivery'=>"DateSending",'c.tracking_number'=>"TrackingNumber",'c.height'=>"Height",'c.width'=>"Width",'c.size'=>"Depth",'c.size_units'=>'SizeUnits','c.weight'=>"Weight",'c.weight_units'=>"WeightUnits",'c.fk_statut'=>'Status','c.note_public'=>"NotePublic",'ed.rowid'=>'LineId','cd.description'=>'Description','ed.qty'=>"Qty",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text"); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.date_creation'=>"Date",'c.date_commande'=>"Date",'c.amount_ht'=>"Number",'c.remise_percent'=>"Number",'c.total_ht'=>"Number",'c.total_ttc'=>"Number",'c.facture'=>"Boolean",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','ed.qty'=>"Text");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.libelle'=>'List:c_pays:libelle:libelle','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note_public'=>"Text",'ed.qty'=>"Number"); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.label'=>'List:c_country:label:label','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_customer'=>"Text",'c.date_creation'=>"Date",'c.date_delivery'=>"Date",'c.tracking_number'=>"Number",'c.height'=>"Number",'c.width'=>"Number",'c.weight'=>"Number",'c.fk_statut'=>'Status','c.note_public'=>"Text",'ed.qty'=>"Number");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note_public'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.siret'=>'company','s.idprof4'=>'company','s.idprof5'=>'company','s.idprof6'=>'company','c.rowid'=>"shipment",'c.ref'=>"shipment",'c.ref_customer'=>"shipment",'c.fk_soc'=>"shipment",'c.date_creation'=>"shipment",'c.date_delivery'=>"shipment",'c.tracking_number'=>'shipment','c.height'=>"shipment",'c.width'=>"shipment",'c.size'=>'shipment','c.size_units'=>'shipment','c.weight'=>"shipment",'c.weight_units'=>'shipment','c.fk_statut'=>"shipment",'c.note_public'=>"shipment",'ed.rowid'=>'shipment_line','cd.description'=>'shipment_line','ed.qty'=>"shipment_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('shipment_line'=>'ed.rowid','product'=>'ed.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c, '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'expedition as c, '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as co ON s.fk_pays = co.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'expeditiondet as ed, '.MAIN_DB_PREFIX.'commandedet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on cd.fk_product = p.rowid';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = ed.fk_expedition AND ed.fk_origin_line = cd.rowid';

View File

@@ -219,7 +219,7 @@ class modFacture extends DolibarrModules
// End add axtra fields // End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid';
@@ -275,7 +275,7 @@ class modFacture extends DolibarrModules
// End add axtra fields // End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c on s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c on s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uc ON f.fk_user_author = uc.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'user as uv ON f.fk_user_valid = uc.rowid';

View File

@@ -139,8 +139,8 @@ class modFicheinter extends DolibarrModules
$this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='InterventionCardsAndInterventionLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("ficheinter","export")); $this->export_permission[$r]=array(array("ficheinter","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc"); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','s.fk_pays'=>'Country','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','s.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','f.rowid'=>"InterId",'f.ref'=>"InterRef",'f.datec'=>"InterDateCreation",'f.duree'=>"InterDuration",'f.fk_statut'=>'InterStatus','f.description'=>"InterNote",'fd.rowid'=>'InterLineId','fd.date'=>"InterLineDate",'fd.duree'=>"InterLineDuration",'fd.description'=>"InterLineDesc");
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric");
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric"); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','f.ref'=>"Text",'f.datec'=>"Date",'f.duree'=>"Duree",'f.fk_statut'=>'Statut','f.description'=>"Text",'f.datee'=>"Date",'f.dateo'=>"Date",'f.fulldayevent'=>"Boolean",'fd.date'=>"Date",'fd.duree'=>"Duree",'fd.description'=>"Text",'fd.total_ht'=>"Numeric");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','s.fk_pays'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.code_compta'=>'company','s.code_compta_fournisseur'=>'company','f.rowid'=>"intervention",'f.ref'=>"intervention",'f.datec'=>"intervention",'f.duree'=>"intervention",'f.fk_statut'=>"intervention",'f.description'=>"intervention",'fd.rowid'=>"inter_line",'fd.date'=>"inter_line",'fd.duree'=>'inter_line','fd.description'=>'inter_line');
$this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('inter_line'=>'fd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them

View File

@@ -291,7 +291,7 @@ class modFournisseur extends DolibarrModules
// End add axtra fields // End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd'; $this->export_sql_end[$r] .=' , '.MAIN_DB_PREFIX.'facture_fourn_det as fd';
@@ -345,7 +345,7 @@ class modFournisseur extends DolibarrModules
// End add axtra fields // End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'facture_fourn as f';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'facture_fourn_extrafields as extra ON f.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid';
@@ -365,7 +365,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as c ON s.fk_pays = c.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f, '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'commande_fournisseur as f, '.MAIN_DB_PREFIX.'commande_fournisseurdet as fd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (fd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande'; $this->export_sql_end[$r] .=' WHERE f.fk_soc = s.rowid AND f.rowid = fd.fk_commande';

View File

@@ -190,7 +190,7 @@ class modProjet extends DolibarrModules
$this->export_permission[$r]=array(array("projet","export")); $this->export_permission[$r]=array(array("projet","export"));
$this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid'); $this->export_dependencies_array[$r]=array('task_time'=>'ppt.rowid');
$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_pays:libelle', $this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','s.fk_pays'=>'List:c_country:label',
's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text', 's.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','s.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text',
'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text", 'p.rowid'=>"List:projet:ref",'p.ref'=>"Text",'p.datec'=>"Date",'p.dateo'=>"Date",'p.datee'=>"Date",'p.fk_statut'=>'Status','p.description'=>"Text",
'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Number",'pt.progress'=>"Number",'pt.description'=>"Text", 'pt.dateo'=>"Date",'pt.datee'=>"Date",'pt.duration_effective'=>"Duree",'pt.planned_workload'=>"Number",'pt.progress'=>"Number",'pt.description'=>"Text",

View File

@@ -169,15 +169,15 @@ class modPropale extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_label[$r]='ProposalsAndProposalsLines'; // Translation key (used only if key ExportDataset_xxx_z not found)
$this->export_permission[$r]=array(array("propale","export")); $this->export_permission[$r]=array(array("propale","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','cp.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel'); $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town','co.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4','c.rowid'=>"Id",'c.ref'=>"Ref",'c.ref_client'=>"RefCustomer",'c.fk_soc'=>"IdCompany",'c.datec'=>"DateCreation",'c.datep'=>"DatePropal",'c.fin_validite'=>"DateEndPropal",'c.remise_percent'=>"GlobalDiscount",'c.total_ht'=>"TotalHT",'c.total'=>"TotalTTC",'c.fk_statut'=>'Status','c.note_public'=>"Note",'c.date_livraison'=>'DeliveryDate','cd.rowid'=>'LineId','cd.label'=>"Label",'cd.description'=>"LineDescription",'cd.product_type'=>'TypeOfLineServiceOrProduct','cd.tva_tx'=>"LineVATRate",'cd.qty'=>"LineQty",'cd.total_ht'=>"LineTotalHT",'cd.total_tva'=>"LineTotalVAT",'cd.total_ttc'=>"LineTotalTTC",'p.rowid'=>'ProductId','p.ref'=>'ProductRef','p.label'=>'ProductLabel');
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.rowid'=>'List:Product:label','p.ref'=>'Text','p.label'=>'Text');
$this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text','co.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text','c.ref'=>"Text",'c.ref_client'=>"Text",'c.datec'=>"Date",'c.datep'=>"Date",'c.fin_validite'=>"Date",'c.remise_percent'=>"Numeric",'c.total_ht'=>"Numeric",'c.total'=>"Numeric",'c.fk_statut'=>'Status','c.note_public'=>"Text",'c.date_livraison'=>'Date','cd.description'=>"Text",'cd.product_type'=>'Boolean','cd.tva_tx'=>"Numeric",'cd.qty'=>"Numeric",'cd.total_ht'=>"Numeric",'cd.total_tva'=>"Numeric",'cd.total_ttc'=>"Numeric",'p.ref'=>'Text','p.label'=>'Text');
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note_public'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product'); $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company','co.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.ape'=>'company','s.idprof4'=>'company','s.siret'=>'company','c.rowid'=>"propal",'c.ref'=>"propal",'c.ref_client'=>"propal",'c.fk_soc'=>"propal",'c.datec'=>"propal",'c.datep'=>"propal",'c.fin_validite'=>"propal",'c.remise_percent'=>"propal",'c.total_ht'=>"propal",'c.total'=>"propal",'c.fk_statut'=>"propal",'c.note_public'=>"propal",'c.date_livraison'=>"propal",'cd.rowid'=>'propal_line','cd.label'=>"propal_line",'cd.description'=>"propal_line",'cd.product_type'=>'propal_line','cd.tva_tx'=>"propal_line",'cd.qty'=>"propal_line",'cd.total_ht'=>"propal_line",'cd.total_tva'=>"propal_line",'cd.total_ttc'=>"propal_line",'p.rowid'=>'product','p.ref'=>'product','p.label'=>'product');
$this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them $this->export_dependencies_array[$r]=array('propal_line'=>'cd.rowid','product'=>'cd.rowid'); // To add unique key if we ask a field of a child to avoid the DISTINCT to discard them
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s ';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as cp ON s.fk_pays = cp.rowid,'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON s.fk_pays = co.rowid,';
$this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'propal as c, '.MAIN_DB_PREFIX.'propaldet as cd'; $this->export_sql_end[$r] .=' '.MAIN_DB_PREFIX.'propal as c, '.MAIN_DB_PREFIX.'propaldet as cd';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'product as p on (cd.fk_product = p.rowid)';
$this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal'; $this->export_sql_end[$r] .=' WHERE c.fk_soc = s.rowid AND c.rowid = cd.fk_propal';

View File

@@ -266,8 +266,8 @@ class modSociete extends DolibarrModules
$this->export_permission[$r]=array(array("societe","export")); $this->export_permission[$r]=array(array("societe","export"));
$this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','st.code'=>'ProspectStatus','d.nom'=>'State'); $this->export_fields_array[$r]=array('s.rowid'=>"Id",'s.nom'=>"Name",'s.status'=>"Status",'s.client'=>"Customer",'s.fournisseur'=>"Supplier",'s.datec'=>"DateCreation",'s.tms'=>"DateLastModification",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"AccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'p.libelle'=>"Country",'p.code'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.default_lang'=>"DefaultLang",'s.siren'=>"ProfId1",'s.siret'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.idprof5'=>"ProfId5",'s.idprof6'=>"ProfId6",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'t.libelle'=>"ThirdPartyType",'ce.code'=>"Staff","cfj.libelle"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','st.code'=>'ProspectStatus','d.nom'=>'State');
if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix'; if (! empty($conf->global->SOCIETE_USEPREFIX)) $this->export_fields_array[$r]['s.prefix']='Prefix';
//$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid'); //$this->export_TypeFields_array[$r]=array('s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Text",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'List:c_departements:nom:rowid');
$this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:libelle",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text'); $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'c.label'=>"List:c_country:label:label",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','st.code'=>'List:c_stcomm:libelle:code','d.nom'=>'Text');
$this->export_entities_array[$r]=array(); // We define here only fields that use another picto $this->export_entities_array[$r]=array(); // We define here only fields that use another picto
// Add extra fields // Add extra fields
$sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe'"; $sql="SELECT name, label, type, param FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'societe'";
@@ -307,7 +307,7 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'societe as s';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra ON s.rowid = extra.fk_object'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe_extrafields as extra ON s.rowid = extra.fk_object';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_typent as t ON s.fk_typent = t.id';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as ce ON s.fk_effectif = ce.id';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as cfj ON s.fk_forme_juridique = cfj.code';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
@@ -320,8 +320,8 @@ class modSociete extends DolibarrModules
$this->export_label[$r]='ExportDataset_company_2'; $this->export_label[$r]='ExportDataset_company_2';
$this->export_icon[$r]='contact'; $this->export_icon[$r]='contact';
$this->export_permission[$r]=array(array("societe","contact","export")); $this->export_permission[$r]=array(array("societe","contact","export"));
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','p.libelle'=>"Country",'p.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1'); $this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civilite'=>"CivilityCode",'c.lastname'=>'Lastname','c.firstname'=>'Firstname','c.poste'=>'PostOrFunction','c.datec'=>"DateCreation",'c.tms'=>"DateLastModification",'c.priv'=>"ContactPrivate",'c.address'=>"Address",'c.zip'=>"Zip",'c.town'=>"Town",'d.nom'=>'State','co.label'=>"Country",'c.code'=>"CountryCode",'c.phone'=>"Phone",'c.fax'=>"Fax",'c.phone_mobile'=>"Mobile",'c.email'=>"EMail",'s.rowid'=>"IdCompany",'s.nom'=>"CompanyName",'s.status'=>"Status",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode", 's.client'=>'Customer 0 (no customer no prospect)/1 (customer)/2 (prospect)/3 (customer and prospect)','s.fournisseur'=>'Supplier 0 or 1');
$this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text"); $this->export_TypeFields_array[$r]=array('c.civilite'=>"List:c_civilite:civilite:code",'c.lastname'=>'Text','c.firstname'=>'Text','c.poste'=>'Text','c.datec'=>"Date",'c.priv'=>"Boolean",'c.address'=>"Text",'c.cp'=>"Text",'c.ville'=>"Text",'d.nom'=>'Text','co.label'=>"List:c_country:label:rowid",'co.code'=>"Text",'c.phone'=>"Text",'c.fax'=>"Text",'c.email'=>"Text",'s.rowid'=>"List:societe:nom",'s.nom'=>"Text",'s.status'=>"Status",'s.client'=>"Text",'s.fournisseur'=>"Text");
$this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>"company",'s.code_client'=>"company",'s.code_fournisseur'=>"company", 's.client'=>"company", 's.fournisseur'=>"company"); // We define here only fields that use another picto
if (empty($conf->fournisseur->enabled)) if (empty($conf->fournisseur->enabled))
{ {
@@ -366,7 +366,7 @@ class modSociete extends DolibarrModules
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'socpeople as c';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s ON c.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON c.fk_departement = d.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON c.fk_pays = p.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON c.fk_pays = co.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid'; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople_extrafields as extra ON extra.fk_object = c.rowid';
$this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')'; $this->export_sql_end[$r] .=' WHERE c.entity IN ('.getEntity("societe", 1).')';
@@ -399,7 +399,7 @@ class modSociete extends DolibarrModules
$this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'societe'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'societe'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
's.fk_typent'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ctypent.class.php','class'=>'Ctypent','method'=>'fetch','dict'=>'DictionaryCompanyType'), 's.fk_typent'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ctypent.class.php','class'=>'Ctypent','method'=>'fetch','dict'=>'DictionaryCompanyType'),
's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry'), 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
's.fk_stcomm'=>array('rule'=>'zeroifnull'), 's.fk_stcomm'=>array('rule'=>'zeroifnull'),
's.code_client'=>array('rule'=>'getcustomercodeifauto'), 's.code_client'=>array('rule'=>'getcustomercodeifauto'),
's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'), 's.code_fournisseur'=>array('rule'=>'getsuppliercodeifauto'),
@@ -434,7 +434,7 @@ class modSociete extends DolibarrModules
$this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'socpeople'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent) $this->import_fieldshidden_array[$r]=array('s.fk_user_creat'=>'user->id','extra.fk_object'=>'lastrowid-'.MAIN_DB_PREFIX.'socpeople'); // aliastable.field => ('user->id' or 'lastrowid-'.tableparent)
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
's.fk_soc'=>array('rule'=>'fetchidfromref','file'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'), 's.fk_soc'=>array('rule'=>'fetchidfromref','file'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty'),
's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry'), 's.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry'),
); );
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t'); //$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); $this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');

View File

@@ -154,7 +154,7 @@ class modStock extends DolibarrModules
); );
$this->import_convertvalue_array[$r]=array( $this->import_convertvalue_array[$r]=array(
'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/cpays.class.php','class'=>'Cpays','method'=>'fetch','dict'=>'DictionaryCountry') 'e.fk_pays'=>array('rule'=>'fetchidfromcodeid','classfile'=>'/core/class/ccountry.class.php','class'=>'Ccountry','method'=>'fetch','dict'=>'DictionaryCountry')
); );
$this->import_regex_array[$r]=array('e.statut'=>'^[0|1]'); $this->import_regex_array[$r]=array('e.statut'=>'^[0|1]');
$this->import_examplevalues_array[$r]=array('e.label'=>"ALM001", $this->import_examplevalues_array[$r]=array('e.label'=>"ALM001",

View File

@@ -732,7 +732,7 @@ if ($step == 3 && $datatoexport)
// Filter value // Filter value
print '<td>'; print '<td>';
if (! empty($Typefieldsarray[$code])) // Example: Text, List:c_pays:libelle:rowid, Number, Boolean if (! empty($Typefieldsarray[$code])) // Example: Text, List:c_country:label:rowid, Number, Boolean
{ {
$szInfoFiltre=$objexport->genDocFilter($Typefieldsarray[$code]); $szInfoFiltre=$objexport->genDocFilter($Typefieldsarray[$code]);
if ($szInfoFiltre) // Is there an info help for this filter ? if ($szInfoFiltre) // Is there an info help for this filter ?

View File

@@ -25,248 +25,248 @@
-- Countries -- Countries
-- --
-- delete from llx_c_pays; -- delete from llx_c_country;
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (0,'',NULL,'-',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (0,'',NULL,'-',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (1,'FR','FRA','France',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (1,'FR','FRA','France',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (2,'BE','BEL','Belgium',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (2,'BE','BEL','Belgium',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (3,'IT','ITA','Italy',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (3,'IT','ITA','Italy',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (4,'ES','ESP','Spain',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (4,'ES','ESP','Spain',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (5,'DE','DEU','Germany',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (5,'DE','DEU','Germany',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (6,'CH','CHE','Switzerland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (6,'CH','CHE','Switzerland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (7,'GB','GBR','United Kingdom',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (7,'GB','GBR','United Kingdom',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (8,'IE','IRL','Irland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (8,'IE','IRL','Irland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (9,'CN','CHN','China',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (9,'CN','CHN','China',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (10,'TN','TUN','Tunisia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (10,'TN','TUN','Tunisia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (11,'US','USA','United States',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (11,'US','USA','United States',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (12,'MA','MAR','Maroc',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (12,'MA','MAR','Maroc',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (13,'DZ','DZA','Algeria',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (13,'DZ','DZA','Algeria',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (14,'CA','CAN','Canada',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (14,'CA','CAN','Canada',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (15,'TG','TGO','Togo',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (15,'TG','TGO','Togo',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (16,'GA','GAB','Gabon',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (16,'GA','GAB','Gabon',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (17,'NL','NLD','Nerderland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (17,'NL','NLD','Nerderland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (18,'HU','HUN','Hongrie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (18,'HU','HUN','Hongrie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (19,'RU','RUS','Russia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (19,'RU','RUS','Russia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (20,'SE','SWE','Sweden',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (20,'SE','SWE','Sweden',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (21,'CI','CIV','Côte d''Ivoire',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (21,'CI','CIV','Côte d''Ivoire',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (22,'SN','SEN','Senegal',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (22,'SN','SEN','Senegal',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (23,'AR','ARG','Argentine',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (23,'AR','ARG','Argentine',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (24,'CM','CMR','Cameroun',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (24,'CM','CMR','Cameroun',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (25,'PT','PRT','Portugal',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (25,'PT','PRT','Portugal',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (26,'SA','SAU','Saudi Arabia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (26,'SA','SAU','Saudi Arabia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (27,'MC','MCO','Monaco',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (27,'MC','MCO','Monaco',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (28,'AU','AUS','Australia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (28,'AU','AUS','Australia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (29,'SG','SGP','Singapour',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (29,'SG','SGP','Singapour',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (30,'AF','AFG','Afghanistan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (30,'AF','AFG','Afghanistan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (31,'AX','ALA','Iles Aland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (31,'AX','ALA','Iles Aland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (32,'AL','ALB','Albanie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (32,'AL','ALB','Albanie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (33,'AS','ASM','Samoa américaines',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (33,'AS','ASM','Samoa américaines',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (34,'AD','AND','Andorre',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (34,'AD','AND','Andorre',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (35,'AO','AGO','Angola',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (35,'AO','AGO','Angola',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (36,'AI','AIA','Anguilla',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (36,'AI','AIA','Anguilla',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (37,'AQ','ATA','Antarctique',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (37,'AQ','ATA','Antarctique',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (38,'AG','ATG','Antigua-et-Barbuda',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (39,'AM','ARM','Arménie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (39,'AM','ARM','Arménie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (40,'AW','ABW','Aruba',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (40,'AW','ABW','Aruba',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (41,'AT','AUT','Autriche',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (41,'AT','AUT','Autriche',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (42,'AZ','AZE','Azerbaïdjan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (42,'AZ','AZE','Azerbaïdjan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (43,'BS','BHS','Bahamas',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (43,'BS','BHS','Bahamas',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (44,'BH','BHR','Bahreïn',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (44,'BH','BHR','Bahreïn',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (45,'BD','BGD','Bangladesh',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (45,'BD','BGD','Bangladesh',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (46,'BB','BRB','Barbade',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (46,'BB','BRB','Barbade',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (47,'BY','BLR','Biélorussie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (47,'BY','BLR','Biélorussie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (48,'BZ','BLZ','Belize',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (48,'BZ','BLZ','Belize',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (49,'BJ','BEN','Bénin',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (49,'BJ','BEN','Bénin',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (50,'BM','BMU','Bermudes',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (50,'BM','BMU','Bermudes',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (51,'BT','BTN','Bhoutan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (51,'BT','BTN','Bhoutan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (52,'BO','BOL','Bolivie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (52,'BO','BOL','Bolivie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (53,'BA','BIH','Bosnie-Herzégovine',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (54,'BW','BWA','Botswana',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (54,'BW','BWA','Botswana',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (55,'BV','BVT','Ile Bouvet',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (55,'BV','BVT','Ile Bouvet',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (56,'BR','BRA','Brazil',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (56,'BR','BRA','Brazil',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (57,'IO','IOT','Territoire britannique de l''Océan Indien',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (58,'BN','BRN','Brunei',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (58,'BN','BRN','Brunei',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (59,'BG','BGR','Bulgarie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (59,'BG','BGR','Bulgarie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (60,'BF','BFA','Burkina Faso',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (60,'BF','BFA','Burkina Faso',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (61,'BI','BDI','Burundi',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (61,'BI','BDI','Burundi',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (62,'KH','KHM','Cambodge',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (62,'KH','KHM','Cambodge',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (63,'CV','CPV','Cap-Vert',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (63,'CV','CPV','Cap-Vert',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (64,'KY','CYM','Iles Cayman',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (64,'KY','CYM','Iles Cayman',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (65,'CF','CAF','République centrafricaine',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (65,'CF','CAF','République centrafricaine',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (66,'TD','TCD','Tchad',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (66,'TD','TCD','Tchad',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (67,'CL','CHL','Chili',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (67,'CL','CHL','Chili',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (68,'CX','CXR','Ile Christmas',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (68,'CX','CXR','Ile Christmas',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (69,'CC','CCK','Iles des Cocos (Keeling)',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (70,'CO','COL','Colombie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (70,'CO','COL','Colombie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (71,'KM','COM','Comores',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (71,'KM','COM','Comores',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (72,'CG','COG','Congo',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (72,'CG','COG','Congo',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (73,'CD','COD','République démocratique du Congo',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (73,'CD','COD','République démocratique du Congo',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (74,'CK','COK','Iles Cook',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (74,'CK','COK','Iles Cook',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (75,'CR','CRI','Costa Rica',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (75,'CR','CRI','Costa Rica',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (76,'HR','HRV','Croatie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (76,'HR','HRV','Croatie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (77,'CU','CUB','Cuba',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (77,'CU','CUB','Cuba',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (78,'CY','CYP','Chypre',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (78,'CY','CYP','Chypre',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (79,'CZ','CZE','République Tchèque',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (79,'CZ','CZE','République Tchèque',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (80,'DK','DNK','Danemark',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (80,'DK','DNK','Danemark',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (81,'DJ','DJI','Djibouti',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (81,'DJ','DJI','Djibouti',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (82,'DM','DMA','Dominique',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (82,'DM','DMA','Dominique',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (83,'DO','DOM','République Dominicaine',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (83,'DO','DOM','République Dominicaine',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (84,'EC','ECU','Equateur',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (84,'EC','ECU','Equateur',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (85,'EG','EGY','Egypte',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (85,'EG','EGY','Egypte',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (86,'SV','SLV','Salvador',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (86,'SV','SLV','Salvador',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (87,'GQ','GNQ','Guinée Equatoriale',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (88,'ER','ERI','Erythrée',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (88,'ER','ERI','Erythrée',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (89,'EE','EST','Estonia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (89,'EE','EST','Estonia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (90,'ET','ETH','Ethiopie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (90,'ET','ETH','Ethiopie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (91,'FK','FLK','Iles Falkland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (91,'FK','FLK','Iles Falkland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (92,'FO','FRO','Iles Féroé',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (92,'FO','FRO','Iles Féroé',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (93,'FJ','FJI','Iles Fidji',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (93,'FJ','FJI','Iles Fidji',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (94,'FI','FIN','Finlande',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (94,'FI','FIN','Finlande',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (95,'GF','GUF','Guyane française',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (95,'GF','GUF','Guyane française',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (96,'PF','PYF','Polynésie française',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (96,'PF','PYF','Polynésie française',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (97,'TF','ATF','Terres australes françaises',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (97,'TF','ATF','Terres australes françaises',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (98,'GM','GMB','Gambie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (98,'GM','GMB','Gambie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (99,'GE','GEO','Georgia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (99,'GE','GEO','Georgia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (100,'GH','GHA','Ghana',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (100,'GH','GHA','Ghana',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (101,'GI','GIB','Gibraltar',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (101,'GI','GIB','Gibraltar',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (102,'GR','GRC','Greece',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (102,'GR','GRC','Greece',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (103,'GL','GRL','Groenland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (103,'GL','GRL','Groenland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (104,'GD','GRD','Grenade',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (104,'GD','GRD','Grenade',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (106,'GU','GUM','Guam',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (106,'GU','GUM','Guam',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (107,'GT','GTM','Guatemala',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (107,'GT','GTM','Guatemala',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (108,'GN','GIN','Guinea',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (108,'GN','GIN','Guinea',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (109,'GW','GNB','Guinea-Bissao',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (109,'GW','GNB','Guinea-Bissao',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (111,'HT','HTI','Haiti',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (111,'HT','HTI','Haiti',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (112,'HM','HMD','Iles Heard et McDonald',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (112,'HM','HMD','Iles Heard et McDonald',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (113,'VA','VAT','Saint-Siège (Vatican)',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (114,'HN','HND','Honduras',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (114,'HN','HND','Honduras',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (115,'HK','HKG','Hong Kong',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (115,'HK','HKG','Hong Kong',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (116,'IS','ISL','Islande',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (116,'IS','ISL','Islande',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (117,'IN','IND','India',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (117,'IN','IND','India',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (118,'ID','IDN','Indonésie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (118,'ID','IDN','Indonésie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (119,'IR','IRN','Iran',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (119,'IR','IRN','Iran',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (120,'IQ','IRQ','Iraq',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (120,'IQ','IRQ','Iraq',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (121,'IL','ISR','Israel',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (121,'IL','ISR','Israel',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (122,'JM','JAM','Jamaïque',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (122,'JM','JAM','Jamaïque',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (123,'JP','JPN','Japon',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (123,'JP','JPN','Japon',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (124,'JO','JOR','Jordanie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (124,'JO','JOR','Jordanie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (125,'KZ','KAZ','Kazakhstan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (125,'KZ','KAZ','Kazakhstan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (126,'KE','KEN','Kenya',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (126,'KE','KEN','Kenya',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (127,'KI','KIR','Kiribati',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (127,'KI','KIR','Kiribati',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (128,'KP','PRK','North Corea',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (128,'KP','PRK','North Corea',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (129,'KR','KOR','South Corea',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (129,'KR','KOR','South Corea',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (130,'KW','KWT','Koweït',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (130,'KW','KWT','Koweït',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (131,'KG','KGZ','Kirghizistan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (131,'KG','KGZ','Kirghizistan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (132,'LA','LAO','Laos',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (132,'LA','LAO','Laos',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (133,'LV','LVA','Lettonie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (133,'LV','LVA','Lettonie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (134,'LB','LBN','Liban',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (134,'LB','LBN','Liban',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (135,'LS','LSO','Lesotho',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (135,'LS','LSO','Lesotho',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (136,'LR','LBR','Liberia',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (136,'LR','LBR','Liberia',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (137,'LY','LBY','Libye',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (137,'LY','LBY','Libye',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (138,'LI','LIE','Liechtenstein',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (138,'LI','LIE','Liechtenstein',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (139,'LT','LTU','Lituanie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (139,'LT','LTU','Lituanie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (140,'LU','LUX','Luxembourg',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (140,'LU','LUX','Luxembourg',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (141,'MO','MAC','Macao',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (141,'MO','MAC','Macao',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (142,'MK','MKD','ex-République yougoslave de Macédoine',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (143,'MG','MDG','Madagascar',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (143,'MG','MDG','Madagascar',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (144,'MW','MWI','Malawi',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (144,'MW','MWI','Malawi',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (145,'MY','MYS','Malaisie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (145,'MY','MYS','Malaisie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (146,'MV','MDV','Maldives',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (146,'MV','MDV','Maldives',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (147,'ML','MLI','Mali',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (147,'ML','MLI','Mali',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (148,'MT','MLT','Malte',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (148,'MT','MLT','Malte',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (149,'MH','MHL','Iles Marshall',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (149,'MH','MHL','Iles Marshall',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (151,'MR','MRT','Mauritanie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (151,'MR','MRT','Mauritanie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (152,'MU','MUS','Maurice',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (152,'MU','MUS','Maurice',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (153,'YT','MYT','Mayotte',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (153,'YT','MYT','Mayotte',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (154,'MX','MEX','Mexique',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (154,'MX','MEX','Mexique',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (155,'FM','FSM','Micronésie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (155,'FM','FSM','Micronésie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (156,'MD','MDA','Moldavie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (156,'MD','MDA','Moldavie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (157,'MN','MNG','Mongolie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (157,'MN','MNG','Mongolie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (158,'MS','MSR','Monserrat',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (158,'MS','MSR','Monserrat',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (159,'MZ','MOZ','Mozambique',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (159,'MZ','MOZ','Mozambique',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (160,'MM','MMR','Birmanie (Myanmar)',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (161,'NA','NAM','Namibie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (161,'NA','NAM','Namibie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (162,'NR','NRU','Nauru',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (162,'NR','NRU','Nauru',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (163,'NP','NPL','Népal',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (163,'NP','NPL','Népal',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (164,'AN',NULL,'Antilles néerlandaises',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (164,'AN',NULL,'Antilles néerlandaises',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (165,'NC','NCL','Nouvelle-Calédonie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (166,'NZ','NZL','Nouvelle-Zélande',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (167,'NI','NIC','Nicaragua',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (167,'NI','NIC','Nicaragua',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (168,'NE','NER','Niger',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (168,'NE','NER','Niger',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (169,'NG','NGA','Nigeria',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (169,'NG','NGA','Nigeria',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (170,'NU','NIU','Nioué',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (170,'NU','NIU','Nioué',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (171,'NF','NFK','Ile Norfolk',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (171,'NF','NFK','Ile Norfolk',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (172,'MP','MNP','Mariannes du Nord',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (172,'MP','MNP','Mariannes du Nord',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (173,'NO','NOR','Norvège',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (173,'NO','NOR','Norvège',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (174,'OM','OMN','Oman',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (174,'OM','OMN','Oman',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (175,'PK','PAK','Pakistan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (175,'PK','PAK','Pakistan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (176,'PW','PLW','Palaos',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (176,'PW','PLW','Palaos',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (177,'PS','PSE','Territoire Palestinien Occupé',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (178,'PA','PAN','Panama',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (178,'PA','PAN','Panama',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (179,'PG','PNG','Papouasie-Nouvelle-Guinée',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (180,'PY','PRY','Paraguay',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (180,'PY','PRY','Paraguay',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (181,'PE','PER','Peru',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (181,'PE','PER','Peru',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (182,'PH','PHL','Philippines',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (182,'PH','PHL','Philippines',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (183,'PN','PCN','Iles Pitcairn',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (183,'PN','PCN','Iles Pitcairn',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (184,'PL','POL','Pologne',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (184,'PL','POL','Pologne',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (185,'PR','PRI','Porto Rico',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (185,'PR','PRI','Porto Rico',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (186,'QA','QAT','Qatar',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (186,'QA','QAT','Qatar',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (188,'RO','ROU','Roumanie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (188,'RO','ROU','Roumanie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (189,'RW','RWA','Rwanda',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (189,'RW','RWA','Rwanda',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (190,'SH','SHN','Sainte-Hélène',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (190,'SH','SHN','Sainte-Hélène',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (191,'KN','KNA','Saint-Christophe-et-Niévès',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (192,'LC','LCA','Sainte-Lucie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (192,'LC','LCA','Sainte-Lucie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (193,'PM','SPM','Saint-Pierre-et-Miquelon',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (194,'VC','VCT','Saint-Vincent-et-les-Grenadines',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (195,'WS','WSM','Samoa',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (195,'WS','WSM','Samoa',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (196,'SM','SMR','Saint-Marin',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (196,'SM','SMR','Saint-Marin',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (197,'ST','STP','Sao Tomé-et-Principe',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (198,'RS','SRB','Serbie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (198,'RS','SRB','Serbie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (199,'SC','SYC','Seychelles',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (199,'SC','SYC','Seychelles',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (200,'SL','SLE','Sierra Leone',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (200,'SL','SLE','Sierra Leone',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (201,'SK','SVK','Slovaquie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (201,'SK','SVK','Slovaquie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (202,'SI','SVN','Slovénie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (202,'SI','SVN','Slovénie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (203,'SB','SLB','Iles Salomon',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (203,'SB','SLB','Iles Salomon',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (204,'SO','SOM','Somalie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (204,'SO','SOM','Somalie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (205,'ZA','ZAF','Afrique du Sud',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (205,'ZA','ZAF','Afrique du Sud',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (206,'GS','SGS','Iles Géorgie du Sud et Sandwich du Sud',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (207,'LK','LKA','Sri Lanka',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (207,'LK','LKA','Sri Lanka',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (208,'SD','SDN','Soudan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (208,'SD','SDN','Soudan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (209,'SR','SUR','Suriname',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (209,'SR','SUR','Suriname',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (210,'SJ','SJM','Iles Svalbard et Jan Mayen',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (211,'SZ','SWZ','Swaziland',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (211,'SZ','SWZ','Swaziland',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (212,'SY','SYR','Syrie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (212,'SY','SYR','Syrie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (213,'TW','TWN','Taïwan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (213,'TW','TWN','Taïwan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (214,'TJ','TJK','Tadjikistan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (214,'TJ','TJK','Tadjikistan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (215,'TZ','TZA','Tanzanie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (215,'TZ','TZA','Tanzanie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (216,'TH','THA','Thaïlande',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (216,'TH','THA','Thaïlande',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (217,'TL','TLS','Timor Oriental',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (217,'TL','TLS','Timor Oriental',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (218,'TK','TKL','Tokélaou',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (218,'TK','TKL','Tokélaou',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (219,'TO','TON','Tonga',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (219,'TO','TON','Tonga',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (220,'TT','TTO','Trinité-et-Tobago',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (220,'TT','TTO','Trinité-et-Tobago',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (221,'TR','TUR','Turquie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (221,'TR','TUR','Turquie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (222,'TM','TKM','Turkménistan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (222,'TM','TKM','Turkménistan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (223,'TC','TCA','Iles Turks-et-Caicos',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (224,'TV','TUV','Tuvalu',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (224,'TV','TUV','Tuvalu',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (225,'UG','UGA','Ouganda',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (225,'UG','UGA','Ouganda',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (226,'UA','UKR','Ukraine',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (226,'UA','UKR','Ukraine',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (227,'AE','ARE','Émirats arabes unis',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (227,'AE','ARE','Émirats arabes unis',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (228,'UM','UMI','Iles mineures éloignées des États-Unis',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (229,'UY','URY','Uruguay',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (229,'UY','URY','Uruguay',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (230,'UZ','UZB','Ouzbékistan',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (230,'UZ','UZB','Ouzbékistan',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (231,'VU','VUT','Vanuatu',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (231,'VU','VUT','Vanuatu',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (232,'VE','VEN','Vénézuela',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (232,'VE','VEN','Vénézuela',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (233,'VN','VNM','Viêt Nam',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (233,'VN','VNM','Viêt Nam',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (234,'VG','VGB','Iles Vierges britanniques',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (234,'VG','VGB','Iles Vierges britanniques',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (235,'VI','VIR','Iles Vierges américaines',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (235,'VI','VIR','Iles Vierges américaines',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (236,'WF','WLF','Wallis-et-Futuna',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (236,'WF','WLF','Wallis-et-Futuna',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (237,'EH','ESH','Sahara occidental',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (237,'EH','ESH','Sahara occidental',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (238,'YE','YEM','Yémen',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (238,'YE','YEM','Yémen',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (239,'ZM','ZMB','Zambie',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (239,'ZM','ZMB','Zambie',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (240,'ZW','ZWE','Zimbabwe',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (240,'ZW','ZWE','Zimbabwe',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (241,'GG','GGY','Guernesey',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (241,'GG','GGY','Guernesey',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (242,'IM','IMN','Ile de Man',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (242,'IM','IMN','Ile de Man',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (243,'JE','JEY','Jersey',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (243,'JE','JEY','Jersey',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (244,'ME','MNE','Monténégro',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (244,'ME','MNE','Monténégro',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (245,'BL','BLM','Saint-Barthélemy',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (245,'BL','BLM','Saint-Barthélemy',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (246,'MF','MAF','Saint-Martin',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (246,'MF','MAF','Saint-Martin',1);
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,active) VALUES (247,'BU', null, 'Burundi',1); INSERT INTO llx_c_country (rowid,code,code_iso,label,active) VALUES (247,'BU', null, 'Burundi',1);

View File

@@ -72,6 +72,13 @@ ALTER TABLE llx_localtax ADD COLUMN localtaxtype tinyint(4) after entity;
ALTER TABLE llx_societe ADD COLUMN localtax1_value double(6,3) after localtax1_assuj; ALTER TABLE llx_societe ADD COLUMN localtax1_value double(6,3) after localtax1_assuj;
ALTER TABLE llx_societe ADD COLUMN localtax2_value double(6,3) after localtax2_assuj; ALTER TABLE llx_societe ADD COLUMN localtax2_value double(6,3) after localtax2_assuj;
-- Change on table c_pays
ALTER TABLE llx_c_pays RENAME TO llx_c_country;
ALTER TABLE llx_c_country CHANGE libelle label VARCHAR(50);
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid);
ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid);
-- Added missing relations of llx_product -- Added missing relations of llx_product
@@ -81,7 +88,7 @@ ALTER TABLE llx_product MODIFY COLUMN fk_country INTEGER NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_country SET DEFAULT NULL; -- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_country SET DEFAULT NULL;
UPDATE llx_product SET fk_country = NULL WHERE fk_country = 0; UPDATE llx_product SET fk_country = NULL WHERE fk_country = 0;
ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country); ALTER TABLE llx_product ADD INDEX idx_product_fk_country (fk_country);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid);
-- fk_user_author -- fk_user_author
ALTER TABLE llx_product MODIFY COLUMN fk_user_author INTEGER NULL DEFAULT NULL; ALTER TABLE llx_product MODIFY COLUMN fk_user_author INTEGER NULL DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_user_author DROP NOT NULL; -- VPGSQL8.2 ALTER TABLE llx_product ALTER COLUMN fk_user_author DROP NOT NULL;

View File

@@ -17,6 +17,6 @@
-- ======================================================================== -- ========================================================================
ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code (code); ALTER TABLE llx_c_country 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_country ADD UNIQUE INDEX idx_c_country_code_iso (code_iso);
ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_pays_libelle (libelle); ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_label (label);

View File

@@ -17,11 +17,11 @@
-- --
-- ======================================================================== -- ========================================================================
create table llx_c_pays create table llx_c_country
( (
rowid integer PRIMARY KEY, rowid integer PRIMARY KEY,
code varchar(2) NOT NULL, code varchar(2) NOT NULL,
code_iso varchar(3) , code_iso varchar(3) ,
libelle varchar(50) NOT NULL, label varchar(50) NOT NULL,
active tinyint DEFAULT 1 NOT NULL active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb; )ENGINE=innodb;

View File

@@ -18,4 +18,4 @@
ALTER TABLE llx_c_regions ADD INDEX idx_c_regions_fk_pays (fk_pays); ALTER TABLE llx_c_regions ADD INDEX idx_c_regions_fk_pays (fk_pays);
ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays (rowid); ALTER TABLE llx_c_regions ADD CONSTRAINT fk_c_regions_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country (rowid);

View File

@@ -23,6 +23,6 @@ ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_pays (fk_pays);
ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_zip (zip); ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_zip (zip);
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid); ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid);
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_pays(rowid); ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_pays FOREIGN KEY (fk_pays) REFERENCES llx_c_country(rowid);
ALTER TABLE llx_c_ziptown ADD UNIQUE INDEX uk_ziptown_fk_pays (zip, town, fk_pays); ALTER TABLE llx_c_ziptown ADD UNIQUE INDEX uk_ziptown_fk_pays (zip, town, fk_pays);

View File

@@ -21,7 +21,7 @@ create table llx_c_ziptown
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY, rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
code varchar(5) DEFAULT NULL, -- ex: code insee pour la France code varchar(5) DEFAULT NULL, -- ex: code insee pour la France
fk_county integer, -- State id in llx_c_departements fk_county integer, -- State id in llx_c_departements
fk_pays integer NOT NULL DEFAULT 0, -- Country id in llx_c_pays fk_pays integer NOT NULL DEFAULT 0, -- Country id in llx_c_country
zip varchar(10) NOT NULL, -- Zip code zip varchar(10) NOT NULL, -- Zip code
town varchar(255) NOT NULL, -- Town name town varchar(255) NOT NULL, -- Town name
active tinyint NOT NULL DEFAULT 1 active tinyint NOT NULL DEFAULT 1

View File

@@ -32,5 +32,5 @@ ALTER TABLE llx_product ADD INDEX idx_product_fk_barcode_type (fk_barcode_type);
ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode_type, entity); ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_barcode (barcode, fk_barcode_type, entity);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_pays (rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_fk_country FOREIGN KEY (fk_country) REFERENCES llx_c_country (rowid);
ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid); ALTER TABLE llx_product ADD CONSTRAINT fk_product_barcode_type FOREIGN KEY (fk_barcode_type) REFERENCES llx_c_barcode_type (rowid);

View File

@@ -31,7 +31,7 @@ if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK','1');
require '../main.inc.php'; require '../main.inc.php';
$country=GETPOST('pays', 'alpha'); $country=GETPOST('country', 'alpha');
/* /*
@@ -49,16 +49,16 @@ print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY
dol_syslog(join(',',$_POST)); dol_syslog(join(',',$_POST));
// Generation liste des pays // Generate list of countries
if (! empty($country)) if (! empty($country))
{ {
global $langs; global $langs;
$langs->load("dict"); $langs->load("dict");
$sql = "SELECT rowid, code, libelle, active"; $sql = "SELECT rowid, code, label, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE active = 1 AND libelle LIKE '%" . $db->escape(utf8_decode($country)) . "%'"; $sql.= " WHERE active = 1 AND label LIKE '%" . $db->escape(utf8_decode($country)) . "%'";
$sql.= " ORDER BY libelle ASC"; $sql.= " ORDER BY label ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
@@ -68,7 +68,7 @@ if (! empty($country))
{ {
print '<li>'; print '<li>';
// Si traduction existe, on l'utilise, sinon on prend le libellé par défaut // Si traduction existe, on l'utilise, sinon on prend le libellé par défaut
print ($country->code && $langs->trans("Country".$country->code)!="Country".$country->code?$langs->trans("Country".$country->code):($country->libelle!='-'?$country->libelle:'&nbsp;')); print ($country->code && $langs->trans("Country".$country->code)!="Country".$country->code?$langs->trans("Country".$country->code):($country->label!='-'?$country->label:'&nbsp;'));
print '<span class="informal" style="display:none">'.$country->rowid.'-idcache</span>'; print '<span class="informal" style="display:none">'.$country->rowid.'-idcache</span>';
print '</li>'; print '</li>';
} }

View File

@@ -263,9 +263,9 @@ class Address
{ {
$sql = 'SELECT a.rowid as id, a.label, a.name, a.address, a.datec as date_creation, a.tms as date_modification, a.fk_soc'; $sql = 'SELECT a.rowid as id, a.label, a.name, a.address, a.datec as date_creation, a.tms as date_modification, a.fk_soc';
$sql .= ', a.zip, a.town, a.note, a.fk_pays as country_id, a.phone, a.fax'; $sql .= ', a.zip, a.town, a.note, a.fk_pays as country_id, a.phone, a.fax';
$sql .= ', p.code as country_code, p.libelle as country'; $sql .= ', c.code as country_code, c.label as country';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.fk_pays = p.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON a.fk_pays = c.rowid';
$sql .= ' WHERE a.fk_soc = '.$this->socid; $sql .= ' WHERE a.fk_soc = '.$this->socid;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
@@ -332,9 +332,9 @@ class Address
$sql = 'SELECT a.rowid, a.fk_soc, a.label, a.name, a.address, a.datec as date_creation, a.tms as date_modification'; $sql = 'SELECT a.rowid, a.fk_soc, a.label, a.name, a.address, a.datec as date_creation, a.tms as date_modification';
$sql .= ', a.zip, a.town, a.note, a.fk_pays as country_id, a.phone, a.fax'; $sql .= ', a.zip, a.town, a.note, a.fk_pays as country_id, a.phone, a.fax';
$sql .= ', p.code as country_code, p.libelle as country'; $sql .= ', c.code as country_code, c.label as country';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe_address as a';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON a.fk_pays = p.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON a.fk_pays = c.rowid';
$sql .= ' WHERE a.rowid = '.$id; $sql .= ' WHERE a.rowid = '.$id;
$resql=$this->db->query($sql); $resql=$this->db->query($sql);
if ($resql) if ($resql)

View File

@@ -957,13 +957,13 @@ class Societe extends CommonObject
$sql .= ', s.outstanding_limit, s.import_key, s.canvas'; $sql .= ', s.outstanding_limit, s.import_key, s.canvas';
$sql .= ', fj.libelle as forme_juridique'; $sql .= ', fj.libelle as forme_juridique';
$sql .= ', e.libelle as effectif'; $sql .= ', e.libelle as effectif';
$sql .= ', p.code as country_code, p.libelle as country'; $sql .= ', c.code as country_code, c.label as country';
$sql .= ', d.code_departement as state_code, d.nom as state'; $sql .= ', d.code_departement as state_code, d.nom as state';
$sql .= ', st.libelle as stcomm'; $sql .= ', st.libelle as stcomm';
$sql .= ', te.code as typent_code'; $sql .= ', te.code as typent_code';
$sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s'; $sql .= ' FROM '.MAIN_DB_PREFIX.'societe as s';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_effectif as e ON s.fk_effectif = e.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as c ON s.fk_pays = c.rowid';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_stcomm as st ON s.fk_stcomm = st.id';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as fj ON s.fk_forme_juridique = fj.code'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_forme_juridique as fj ON s.fk_forme_juridique = fj.code';
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_departements as d ON s.fk_departement = d.rowid';
@@ -2867,8 +2867,8 @@ class Societe extends CommonObject
function useLocalTax($localTaxNum=0) function useLocalTax($localTaxNum=0)
{ {
$sql = "SELECT t.localtax1, t.localtax2"; $sql = "SELECT t.localtax1, t.localtax2";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$this->country_code."'";
$sql .= " AND t.active = 1"; $sql .= " AND t.active = 1";
if (empty($localTaxNum)) $sql .= " AND (t.localtax1_type <> '0' OR t.localtax2_type <> '0')"; if (empty($localTaxNum)) $sql .= " AND (t.localtax1_type <> '0' OR t.localtax2_type <> '0')";
elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'"; elseif ($localTaxNum == 1) $sql .= " AND t.localtax1_type <> '0'";
@@ -2890,8 +2890,9 @@ class Societe extends CommonObject
*/ */
function useRevenueStamp() function useRevenueStamp()
{ {
$sql = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."c_revenuestamp as r, ".MAIN_DB_PREFIX."c_pays as p"; $sql = "SELECT COUNT(*) as nb";
$sql .= " WHERE r.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; $sql .= " FROM ".MAIN_DB_PREFIX."c_revenuestamp as r, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE r.fk_pays = c.rowid AND c.code = '".$this->country_code."'";
$sql .= " AND r.active = 1"; $sql .= " AND r.active = 1";
dol_syslog("useRevenueStamp", LOG_DEBUG); dol_syslog("useRevenueStamp", LOG_DEBUG);

View File

@@ -197,10 +197,10 @@ if ($socid)
$sql = "SELECT DISTINCT t.rowid, t.note, t.taux, t.localtax1, t.localtax2, t.recuperableonly"; $sql = "SELECT DISTINCT t.rowid, t.note, t.taux, t.localtax1, t.localtax2, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = p.rowid"; $sql.= " WHERE t.fk_pays = c.rowid";
$sql.= " AND t.active = 1"; $sql.= " AND t.active = 1";
$sql.= " AND p.code IN ('".$mysoc->country_code."')"; $sql.= " AND c.code IN ('".$mysoc->country_code."')";
$sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC"; $sql.= " ORDER BY t.taux ASC, t.recuperableonly ASC";
$resql=$db->query($sql); $resql=$db->query($sql);

View File

@@ -498,12 +498,12 @@ function getContactsForThirdParty($authentication,$idthirdparty)
$sql.= " c.birthday,"; $sql.= " c.birthday,";
$sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,"; $sql.= " c.poste, c.phone, c.phone_perso, c.phone_mobile, c.fax, c.email, c.jabberid,";
//$sql.= " c.priv, c.note, c.default_lang, c.no_email, c.canvas,"; //$sql.= " c.priv, c.note, c.default_lang, c.no_email, c.canvas,";
$sql.= " p.libelle as country, p.code as country_code,"; $sql.= " co.label as country, co.code as country_code,";
$sql.= " d.nom as state, d.code_departement as state_code,"; $sql.= " d.nom as state, d.code_departement as state_code,";
$sql.= " u.rowid as user_id, u.login as user_login,"; $sql.= " u.rowid as user_id, u.login as user_login,";
$sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang"; $sql.= " s.nom as socname, s.address as socaddress, s.zip as soccp, s.town as soccity, s.default_lang as socdefault_lang";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p ON c.fk_pays = p.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as co ON c.fk_pays = co.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_departements as d ON c.fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON c.rowid = u.fk_socpeople";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON c.fk_soc = s.rowid";

View File

@@ -653,10 +653,10 @@ function getListOfThirdParties($authentication,$filterthirdparty)
if (! $error) if (! $error)
{ {
$sql ="SELECT s.rowid as socRowid, s.nom as ref, s.ref_ext, s.address, s.zip, s.town, p.libelle as country, s.phone, s.fax, s.url, extra.*"; $sql = "SELECT s.rowid as socRowid, s.nom as ref, s.ref_ext, s.address, s.zip, s.town, c.label as country, s.phone, s.fax, s.url, extra.*";
$sql.=" FROM ".MAIN_DB_PREFIX."societe as s"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
$sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as p ON s.fk_pays = p.rowid'; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON s.fk_pays = c.rowid";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as extra ON s.rowid=fk_object"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields as extra ON s.rowid=fk_object";
$sql.=" WHERE entity=".$conf->entity; $sql.=" WHERE entity=".$conf->entity;
foreach($filterthirdparty as $key => $val) foreach($filterthirdparty as $key => $val)

View File

@@ -540,7 +540,7 @@ function createUserFromThirdparty($authentication,$thirdpartywithuser)
$langs->load("dict"); $langs->load("dict");
$sql = "SELECT rowid"; $sql = "SELECT rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
$sql.= " AND code='".$thirdparty->country_code."'"; $sql.= " AND code='".$thirdparty->country_code."'";

View File

@@ -143,11 +143,11 @@ print "Hit Enter to continue or CTRL+C to stop...\n";
$input = trim(fgets(STDIN)); $input = trim(fgets(STDIN));
// Charge tableau de correspondance des pays // Load table of correspondence of countries
$hashlib2rowid=array(); $hashlib2rowid=array();
$countries=array(); $countries=array();
$sql = "SELECT rowid, code, libelle, active"; $sql = "SELECT rowid, code, label, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
$sql.= " ORDER BY code ASC"; $sql.= " ORDER BY code ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
@@ -162,9 +162,9 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($obj) if ($obj)
{ {
//print 'Load cache for country '.strtolower($obj->libelle).' rowid='.$obj->rowid."\n"; //print 'Load cache for country '.strtolower($obj->label).' rowid='.$obj->rowid."\n";
$hashlib2rowid[strtolower($obj->libelle)]=$obj->rowid; $hashlib2rowid[strtolower($obj->label)]=$obj->rowid;
$countries[$obj->rowid]=array('rowid' => $obj->rowid, 'label' => $obj->libelle, 'code' => $obj->code); $countries[$obj->rowid]=array('rowid' => $obj->rowid, 'label' => $obj->label, 'code' => $obj->code);
} }
$i++; $i++;
} }

View File

@@ -129,11 +129,11 @@ if (empty($conf->global->LDAP_USER_DN))
} }
// Charge tableau de correspondance des pays // Load table of correspondence of countries
$hashlib2rowid=array(); $hashlib2rowid=array();
$countries=array(); $countries=array();
$sql = "SELECT rowid, code, libelle, active"; $sql = "SELECT rowid, code, label, active";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays"; $sql.= " FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE active = 1"; $sql.= " WHERE active = 1";
$sql.= " ORDER BY code ASC"; $sql.= " ORDER BY code ASC";
$resql=$db->query($sql); $resql=$db->query($sql);
@@ -148,9 +148,9 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($obj) if ($obj)
{ {
//print 'Load cache for country '.strtolower($obj->libelle).' rowid='.$obj->rowid."\n"; //print 'Load cache for country '.strtolower($obj->label).' rowid='.$obj->rowid."\n";
$hashlib2rowid[strtolower($obj->libelle)]=$obj->rowid; $hashlib2rowid[strtolower($obj->label)]=$obj->rowid;
$countries[$obj->rowid]=array('rowid' => $obj->rowid, 'label' => $obj->libelle, 'code' => $obj->code); $countries[$obj->rowid]=array('rowid' => $obj->rowid, 'label' => $obj->label, 'code' => $obj->code);
} }
$i++; $i++;
} }