Merge branch 'Upstream/develop'

This commit is contained in:
aspangaro 2014-08-18 11:56:49 +02:00
commit f774ff487b
294 changed files with 6761 additions and 6318 deletions

View File

@ -5,6 +5,7 @@ English Dolibarr ChangeLog
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Each user can include its own external ics calendar into dolibarr agenda view.
- New: Intervention documents are now available in ECM module.
- New: Can attach supplier order to a customer order.
- New: Supervisor is now visible into user list.
@ -38,6 +39,11 @@ For users:
- New: Intervention documents are now available in ECM module
- New: Add attachments on user card + in ECM module
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
- New: [ task #1204 ] add Numering contrat module free (like leopard in product module)
- New: [ task #712 ] Add warning when creating invoice from proposal or order, when there is already one invoice
- New: Enable supplier price log table
- New: [ task #1204 ] add a External reference to contract
- New: [ task #1218 ] Can drag and drop an event from calendar to change its day.
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
- Fix: [ bug #1470, #1472, #1473] User trigger problem
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
@ -55,7 +61,6 @@ For users:
- Fix: [ bug #1506, #1507 ] ECM trigger error problem
- Fix: [ bug #1469 ] Triggers CONTACT_MODIFY and CONTACT_DELETE duplicates error message
- Fix: [ bug #1537 ] Difference between societe.nom and adherent.societe.
- New: [ task #1204 ] add a External reference to contract
For translators:
- Update language files.
@ -71,8 +76,9 @@ For developers:
- LINEBILL_DELETE, LINK_DELETE, ORDER_SUPPLIER_DELETE, RESOURCE_DELETE trigger called before SQL delete
- New: [ Task #1481 ] Add trigger BILL_SUPPLIER_UPDATE.
- New: [ Task #1495 ] Add trigger LINECONTRACT_CREATE.
- 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: Added hook "formConfirm" and "doActions" for supplier invoice 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
- Qual: Renamed table llx_c_civilite into llx_c_civility
field civilite into label in the same table
and field civilite into civility in other table
@ -80,7 +86,9 @@ For developers:
WARNING: Following change may create regression for some external modules, but was necessary to make
Dolibarr better:
- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php
- Changed the way parameters are provided to scripts sync_xxx_ldap2dolibarr.php
- Some field into database wwere renamed from "libelle" to "label".
- Table llx_c_pays were renamed into llx_c_country.
***** ChangeLog for 3.6 compared to 3.5.* *****
@ -199,19 +207,23 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f
***** ChangeLog for 3.5.5 compared to 3.5.4 *****
Fix: Holiday module was broken. Initializaion of amount of holidays failed.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: Fusion PDF button on unpaid invoice is no more displayed
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click)
Fix: Fusion PDF button on unpaid invoice is no more displayed.
Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click).
Fix: Pb when showing log list of holiday module with some mysql versions.
Fix: Error with bad timezone pushed by some browsers.
Fix: shipping list SQL request was not filtering on shipping element
Fix: debian package provided by dolibarr team must use embedded libraries.
Fix: [ bug #1528 ] Leopard Services numeration module description is not translated.
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas
Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances
Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas.
Fix: [ bug #1534 ] Unknown error when deleting a product photo under special circumstances.
Fix: Update impayees.php
Fix: Link product, In list view and label product
Fix: Link product, In list view and label product.
Fix: visible task into area "time" for "My task" must limit task to tasks i am assigned to.
Fix: When disabled, all fields to add time into task line must be disabled.
Fix: Missing include files.lib.php in some pages that use dol_delete_recursive
Fix: Missing include files.lib.php in some pages ti use dol_delete_recursive.
Fix: [ bug #1558 ] Product/service edit page title shows new Ref instead of old ref.
Fix: [ bug #1553 ] Saving User displays setup removes menu.
***** ChangeLog for 3.5.4 compared to 3.5.3 *****
Fix: Hide title of event when agenda module disabled.

View File

@ -106,7 +106,7 @@ class Skeleton_Class extends CommonObject
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_CREATE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
@ -133,10 +133,11 @@ class Skeleton_Class extends CommonObject
/**
* Load object in memory from the database
*
* @param int $id Id object
* @param int $id Id object
* @param string $ref Ref
* @return int <0 if KO, >0 if OK
*/
function fetch($id)
function fetch($id,$ref='')
{
global $langs;
$sql = "SELECT";
@ -145,7 +146,8 @@ class Skeleton_Class extends CommonObject
$sql.= " t.field2";
//...
$sql.= " FROM ".MAIN_DB_PREFIX."mytable as t";
$sql.= " WHERE t.rowid = ".$id;
if ($ref) $sql.= " WHERE t.ref = '".$ref."'";
else $sql.= " WHERE t.rowid = ".$id;
dol_syslog(get_class($this)."::fetch");
$resql=$this->db->query($sql);
@ -214,7 +216,7 @@ class Skeleton_Class extends CommonObject
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_MODIFY',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}
@ -261,7 +263,7 @@ class Skeleton_Class extends CommonObject
//// Call triggers
//$result=$this->call_trigger('MYOBJECT_DELETE',$user);
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//if ($result < 0) { $error++; //Do also what you must do to rollback action if trigger fail}
//// End call triggers
}
}

View File

@ -43,6 +43,7 @@ if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@includ
if (! $res && file_exists("../../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../../dolibarr/htdocs/main.inc.php'; // Used on dev env only
if (! $res) die("Include of main fails");
// Change this following line to use the correct relative path from htdocs
include_once(DOL_DOCUMENT_ROOT.'/core/class/formcompany.class.php');
dol_include_once('/module/class/skeleton_class.class.php');
// Load traductions files requiredby by page
@ -52,6 +53,7 @@ $langs->load("other");
// Get parameters
$id = GETPOST('id','int');
$action = GETPOST('action','alpha');
$backtopage = GETPOST('backtopage');
$myparam = GETPOST('myparam','alpha');
// Protection if external user
@ -60,6 +62,16 @@ if ($user->societe_id > 0)
//accessforbidden();
}
if (empty($action) && empty($id) && empty($ref)) $action='create';
// Load object if id or ref is provided as parameter
$object=new Skeleton_Class($db);
if (($id > 0 || ! empty($ref)) && $action != 'add')
{
$result=$object->fetch($id,$ref);
if ($result < 0) dol_print_error($db);
}
/*******************************************************************
@ -68,19 +80,104 @@ if ($user->societe_id > 0)
* Put here all code to do according to value of "action" parameter
********************************************************************/
// Action to add record
if ($action == 'add')
{
$object=new Skeleton_Class($db);
$object->prop1=$_POST["field1"];
$object->prop2=$_POST["field2"];
$result=$object->create($user);
if (GETPOST('cancel'))
{
$urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1);
header("Location: ".$urltogo);
exit;
}
$error=0;
/* object_prop_getpost_prop */
$object->prop1=GETPOST("field1");
$object->prop2=GETPOST("field2");
if (empty($object->ref))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
}
if (! $error)
{
$result=$object->create($user);
if ($result > 0)
{
// Creation OK
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
header("Location: ".$urltogo);
exit;
}
{
// Creation KO
if (! empty($object->errors)) setEventMessage($object->errors, 'errors');
else setEventMessage($object->error, 'errors');
$action='create';
}
}
else
{
$action='create';
}
}
// Cancel
if ($action == 'update' && GETPOST('cancel')) $action='view';
// Action to update record
if ($action == 'update' && ! GETPOST('cancel'))
{
$error=0;
$object->prop1=GETPOST("field1");
$object->prop2=GETPOST("field2");
if (empty($object->ref))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
}
if (! $error)
{
$result=$object->update($user);
if ($result > 0)
{
$action='view';
}
else
{
// Creation KO
if (! empty($object->errors)) setEventMessage($object->errors, 'errors');
else setEventMessage($object->error, 'errors');
$action='edit';
}
}
else
{
$action='edit';
}
}
// Action to delete
if ($action == 'confirm_delete')
{
$result=$object->delete($user);
if ($result > 0)
{
// Creation OK
// Delete OK
setEventMessage($langs->trans("RecordDeleted"));
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
exit;
}
else
{
// Creation KO
$mesg=$object->error;
if (! empty($object->errors)) setEventMessage($object->errors,'errors');
else setEventMessage($object->error,'errors');
}
}
@ -101,7 +198,7 @@ $form=new Form($db);
// Put here content of your page
// Example 1 : Adding jquery code
// Example : Adding jquery code
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
function init_myfunc()
@ -117,13 +214,8 @@ jQuery(document).ready(function() {
</script>';
// Example 2 : Adding links to objects
// The class must extends CommonObject class to have this method available
//$somethingshown=$object->showLinkedObjectBlock();
// Example 3 : List of data
if ($action == 'list')
// Part to show a list
if ($action == 'list' || empty($id))
{
$sql = "SELECT";
$sql.= " t.rowid,";
@ -145,21 +237,18 @@ if ($action == 'list')
{
$num = $db->num_rows($resql);
$i = 0;
if ($num)
while ($i < $num)
{
while ($i < $num)
$obj = $db->fetch_object($resql);
if ($obj)
{
$obj = $db->fetch_object($resql);
if ($obj)
{
// You can use here results
print '<tr><td>';
print $obj->field1;
print $obj->field2;
print '</td></tr>';
}
$i++;
// You can use here results
print '<tr><td>';
print $obj->field1;
print $obj->field2;
print '</td></tr>';
}
$i++;
}
}
else
@ -173,6 +262,100 @@ if ($action == 'list')
// Part to create
if ($action == 'create')
{
print_fiche_titre($langs->trans("NewResidence"));
dol_fiche_head();
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<table class="border centpercent">'."\n";
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
print '<input class="flat" type="text" size="36" name="label" value="'.$label.'">';
print '</td></tr>';
print '</table>'."\n";
print '<br>';
print '<center><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
print '</form>';
dol_fiche_end();
}
// Part to edit record
if (($id || $ref) && $action == 'edit')
{
dol_fiche_head();
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<br>';
print '<center><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></center>';
print '</form>';
dol_fiche_end();
}
// Part to show record
if ($id && (empty($action) || $action == 'view'))
{
dol_fiche_head();
dol_fiche_end();
// Buttons
print '<div class="tabsAction">'."\n";
$parameters=array();
$reshook=$hookmanager->executeHooks('addMoreActionsButtons',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook))
{
if ($user->rights->mymodule->write)
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=edit">'.$langs->trans("Modify").'</a></div>'."\n";
}
if ($user->rights->mymodule->delete)
{
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can't use preloaded confirm form with jmobile
{
print '<div class="inline-block divButAction"><span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span></div>'."\n";
}
else
{
print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans('Delete').'</a></div>'."\n";
}
}
}
print '</div>'."\n";
// Example 2 : Adding links to objects
// The class must extends CommonObject class to have this method available
//$somethingshown=$object->showLinkedObjectBlock();
}
// End of page
llxFooter();
$db->close();

1
htdocs/.gitignore vendored
View File

@ -2,6 +2,7 @@
/custom*
/extensions*
/nltechno*
/anco*
/bootstrap*
/google*
/multicompany*

View File

@ -412,7 +412,7 @@ abstract class ActionsAdherentCardCommon
// We set country_id, and country_code label of the chosen country
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);
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.= " d.address, d.zip, d.town, d.country, d.birth, d.email, d.photo,";
$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.= " 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";
if (is_numeric($foruserid)) $sql.=" AND d.rowid=".$foruserid;
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.country,";
$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.= " t.libelle as type, t.cotisation as cotisation,";
$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.= " 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.= " 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.= " WHERE d.fk_adherent_type = t.rowid";

View File

@ -326,6 +326,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->adherent->creer)
{
if (GETPOST('deletephoto'))
{
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$fileimg=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/'.$object->photo;
$dirthumbs=$conf->adherent->dir_output.'/'.get_exdir($object->id,2,0,1).'/photos/thumbs';
dol_delete_file($fileimg);
@ -945,7 +946,7 @@ else
$country=GETPOST('country','int');
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);
if ($resql)
{

View File

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

View File

@ -62,10 +62,11 @@ if ($actionsave)
// Save agendas
while ($i <= $MAXAGENDA)
{
$name=trim(GETPOST('agenda_ext_name'.$i,'alpha'));
$src=trim(GETPOST('agenda_ext_src'.$i,'alpha'));
$color=trim(GETPOST('agenda_ext_color'.$i,'alpha'));
$name=trim(GETPOST('AGENDA_EXT_NAME'.$i,'alpha'));
$src=trim(GETPOST('AGENDA_EXT_SRC'.$i,'alpha'));
$color=trim(GETPOST('AGENDA_EXT_COLOR'.$i,'alpha'));
if ($color=='-1') $color='';
$enabled=trim(GETPOST('AGENDA_EXT_ENABLED'.$i,'alpha'));
if (! empty($src) && ! dol_is_url($src))
{
@ -82,6 +83,8 @@ if ($actionsave)
if (! $res > 0) $error++;
$res=dolibarr_set_const($db,'AGENDA_EXT_COLOR'.$i,$color,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
$res=dolibarr_set_const($db,'AGENDA_EXT_ENABLED'.$i,$enabled,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
$i++;
}
@ -195,19 +198,20 @@ while ($i <= $MAXAGENDA)
$name='AGENDA_EXT_NAME'.$key;
$src='AGENDA_EXT_SRC'.$key;
$color='AGENDA_EXT_COLOR'.$key;
$enabled='AGENDA_EXT_ENABLED'.$key;
$var=!$var;
print "<tr ".$bc[$var].">";
// Nb
print '<td width="180" class="nowrap">'.$langs->trans("AgendaExtNb",$key)."</td>";
// Name
print '<td><input type="text" class="flat hideifnotset" name="agenda_ext_name'.$key.'" value="'. (GETPOST('agenda_ext_name'.$key)?GETPOST('agenda_ext_name'.$key):$conf->global->$name) . '" size="28"></td>';
print '<td><input type="text" class="flat hideifnotset" name="AGENDA_EXT_NAME'.$key.'" value="'. (GETPOST('AGENDA_EXT_NAME'.$key)?GETPOST('AGENDA_EXT_NAME'.$key):$conf->global->$name) . '" size="28"></td>';
// URL
print '<td><input type="url" class="flat hideifnotset" name="agenda_ext_src'.$key.'" value="'. (GETPOST('agenda_ext_src'.$key)?GETPOST('agenda_ext_src'.$key):$conf->global->$src) . '" size="60"></td>';
print '<td><input type="url" class="flat hideifnotset" name="AGENDA_EXT_SRC'.$key.'" value="'. (GETPOST('AGENDA_EXT_SRC'.$key)?GETPOST('AGENDA_EXT_SRC'.$key):$conf->global->$src) . '" size="60"></td>';
// Color (Possible colors are limited by Google)
print '<td class="nowrap" align="right">';
//print $formadmin->selectColor($conf->global->$color, "google_agenda_color".$key, $colorlist);
print $formother->selectColor((GETPOST("agenda_ext_color".$key)?GETPOST("agenda_ext_color".$key):$conf->global->$color), "agenda_ext_color".$key, 'extsitesconfig', 1, '', 'hideifnotset');
print $formother->selectColor((GETPOST("AGENDA_EXT_COLOR".$key)?GETPOST("AGENDA_EXT_COLOR".$key):$conf->global->$color), "AGENDA_EXT_COLOR".$key, 'extsitesconfig', 1, '', 'hideifnotset');
print '</td>';
print "</tr>";
$i++;

View File

@ -318,7 +318,7 @@ if ($action == 'edit' || $action == 'updateedit')
// Country
$var=!$var;
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');
if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"),1);
print '</td></tr>'."\n";

View File

@ -77,7 +77,7 @@ $tabname=array();
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
$tabname[2] = MAIN_DB_PREFIX."c_departements";
$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_civility";
$tabname[6] = MAIN_DB_PREFIX."c_actioncomm";
$tabname[7] = MAIN_DB_PREFIX."c_chargesociales";
@ -132,31 +132,31 @@ $tablib[26]= "DictionaryResourceType";
// Requests to extract data
$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[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[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[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays";
$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, 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, 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, label, active FROM ".MAIN_DB_PREFIX."c_country";
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.label, c.active FROM ".MAIN_DB_PREFIX."c_civility AS c";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as 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[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[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, 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[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[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[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[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, label, accountancy_code, active FROM ".MAIN_DB_PREFIX."c_type_fees";
$tabsql[18]= "SELECT rowid as rowid, code, libelle, tracking, active FROM ".MAIN_DB_PREFIX."c_shipment_mode";
$tabsql[19]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_effectif";
$tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_input_method";
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as 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[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[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, 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";
// Criteria to sort dictionaries
@ -193,7 +193,7 @@ $tabfield=array();
$tabfield[1] = "code,libelle,country";
$tabfield[2] = "code,libelle,region_id,region,country"; // "code,libelle,region,country_code-country"
$tabfield[3] = "code,libelle,country_id,country";
$tabfield[4] = "code,libelle";
$tabfield[4] = "code,label";
$tabfield[5] = "code,label";
$tabfield[6] = "code,libelle,type,position";
$tabfield[7] = "code,libelle,country_id,country,accountancy_code,deductible";
@ -206,7 +206,7 @@ $tabfield[13]= "code,libelle,type,accountancy_code";
$tabfield[14]= "code,libelle,price,organization,country_id,country";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle,sortorder";
$tabfield[17]= "code,libelle";
$tabfield[17]= "code,label,accountancy_code";
$tabfield[18]= "code,libelle,tracking";
$tabfield[19]= "code,libelle";
$tabfield[20]= "code,libelle";
@ -222,7 +222,7 @@ $tabfieldvalue=array();
$tabfieldvalue[1] = "code,libelle,country";
$tabfieldvalue[2] = "code,libelle,region"; // "code,libelle,region"
$tabfieldvalue[3] = "code,libelle,country";
$tabfieldvalue[4] = "code,libelle";
$tabfieldvalue[4] = "code,label";
$tabfieldvalue[5] = "code,label";
$tabfieldvalue[6] = "code,libelle,type,position";
$tabfieldvalue[7] = "code,libelle,country,accountancy_code,deductible";
@ -235,7 +235,7 @@ $tabfieldvalue[13]= "code,libelle,type,accountancy_code";
$tabfieldvalue[14]= "code,libelle,price,organization,country";
$tabfieldvalue[15]= "code,libelle,width,height,unit";
$tabfieldvalue[16]= "code,libelle,sortorder";
$tabfieldvalue[17]= "code,libelle";
$tabfieldvalue[17]= "code,label,accountancy_code";
$tabfieldvalue[18]= "code,libelle,tracking";
$tabfieldvalue[19]= "code,libelle";
$tabfieldvalue[20]= "code,libelle";
@ -251,7 +251,7 @@ $tabfieldinsert=array();
$tabfieldinsert[1] = "code,libelle,fk_pays";
$tabfieldinsert[2] = "code_departement,nom,fk_region";
$tabfieldinsert[3] = "code_region,nom,fk_pays";
$tabfieldinsert[4] = "code,libelle";
$tabfieldinsert[4] = "code,label";
$tabfieldinsert[5] = "code,label";
$tabfieldinsert[6] = "code,libelle,type,position";
$tabfieldinsert[7] = "code,libelle,fk_pays,accountancy_code,deductible";
@ -264,7 +264,7 @@ $tabfieldinsert[13]= "code,libelle,type,accountancy_code";
$tabfieldinsert[14]= "code,libelle,price,organization,fk_pays";
$tabfieldinsert[15]= "code,label,width,height,unit";
$tabfieldinsert[16]= "code,label,sortorder";
$tabfieldinsert[17]= "code,libelle";
$tabfieldinsert[17]= "code,label,accountancy_code";
$tabfieldinsert[18]= "code,libelle,tracking";
$tabfieldinsert[19]= "code,libelle";
$tabfieldinsert[20]= "code,libelle";
@ -421,7 +421,7 @@ if ($id == 11)
'fichinter' => $langs->trans('InterventionCard'),
'agenda' => $langs->trans('Agenda')
);
if (! empty($conf->global->MAIN_SUPPORT_CONTACT_TYPE_FOR_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
$sourceList = array(
'internal' => $langs->trans('Internal'),
'external' => $langs->trans('External')
@ -570,7 +570,8 @@ if (GETPOST('actionadd') || GETPOST('actionmodify'))
$result = $db->query($sql);
if ($result) // Add is ok
{
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
setEventMessage($langs->transnoentities("RecordSaved"));
$_POST=array('id'=>$id); // Clean $_POST array, we keep only
}
else
{
@ -1019,7 +1020,7 @@ if ($id)
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
$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));
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code)?$key:$obj->$fieldlist[$field]);
}
@ -1082,7 +1083,7 @@ if ($id)
$key = $langs->trans('PaperFormat'.strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != 'PaperFormat'.strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]);
}
else if ($fieldlist[$field] == 'libelle' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
else if ($fieldlist[$field] == 'label' && $tabname[$id] == MAIN_DB_PREFIX.'c_type_fees')
{
$langs->load('trips');
$key = $langs->trans(strtoupper($obj->code));
@ -1276,7 +1277,7 @@ function fieldList($fieldlist,$obj='',$tabname='')
foreach ($fieldlist as $field => $value)
{
if ($fieldlist[$field] == 'country') {
if (in_array('region_id',$fieldlist)) { print '<td>&nbsp;</td>'; continue; } // For region page, we do not show the country input
if (in_array('region_id',$fieldlist)) { print '<td>'.join(',',$fieldlist).'&nbsp;</td>'; continue; } // For state page, we do not show the country input (we link to region, not country)
print '<td>';
print $form->select_country((! empty($obj->country_code)?$obj->country_code:(! empty($obj->country)?$obj->country:'')), 'country', '', 28);
print '</td>';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2012-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -261,6 +262,24 @@ if ($action == 'setforcedate')
}
}
if ($action == 'set_FAC_AUTO_FILLJS')
{
$freetext = GETPOST('FAC_AUTO_FILLJS'); // No alpha here, we want exact string
$res = dolibarr_set_const($db, "FAC_AUTO_FILLJS",$freetext,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
setEventMessage($langs->trans("SetupSaved"));
}
else
{
setEventMessage($langs->trans("Error"),'errors');
}
}
/*
* View
@ -500,7 +519,7 @@ print "</tr>\n";
clearstatcache();
$var=true;
foreach ($def as $reldir)
foreach ($dirmodels as $reldir)
{
foreach (array('','/doc') as $valdir)
{
@ -765,6 +784,20 @@ print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" /
print "</td></tr>\n";
print '</form>';
// Add js auto fill amount on paiement form
$var=! $var;
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'" />';
print '<input type="hidden" name="action" value="set_FAC_AUTO_FILLJS" />';
print '<tr '.$bc[$var].'><td>';
print $langs->trans("JSOnPaimentBill");
print '</td><td width="60" align="center">';
print $form->selectyesno("FAC_AUTO_FILLJS",$conf->global->FAC_AUTO_FILLJS,1);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'" />';
print "</td></tr>\n";
print '</form>';
print '</table>';

View File

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

View File

@ -332,7 +332,11 @@ foreach($configfileparameters as $key => $value)
{
if ($i > 0) print ', ';
print $value2;
if (! is_readable($value2)) print ' '.img_warning($langs->trans("ErrorCantReadDirr"));
if (! is_readable($value2))
{
$langs->load("errors");
print ' '.img_warning($langs->trans("ErrorCantReadDir",$value2));
}
++$i;
}
}

View File

@ -23,7 +23,7 @@
*/
require '../../main.inc.php';
include_once $dolibarr_main_document_root.'/core/lib/files.lib.php';
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$langs->load("admin");
$langs->load("other");

View File

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

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -384,7 +385,48 @@ if ($action == 'update')
}
}
/*
* Action move update, used when user move an event in calendar by drag'n drop
*/
if ($action == 'mupdate')
{
$object->fetch($id);
$shour = dol_print_date($object->datep,"%H");
$smin = dol_print_date($object->datep, "%M");
$newdate=GETPOST('newdate','alpha');
if (empty($newdate) || strpos($newdate,'dayevent_') != 0 )
{
header("Location: ".$backtopage);
exit;
}
$datep=dol_mktime($shour, $smin, 0, substr($newdate,13,2), substr($newdate,15,2), substr($newdate,9,4));
if ($datep!=$object->datep)
{
if (!empty($object->datef))
{
$object->datef+=$datep-$object->datep;
}
$object->datep=$datep;
$result=$object->update($user);
if ($result < 0)
{
setEventMessage($object->error,'errors');
setEventMessage($object->errors,'errors');
}
}
if (! empty($backtopage))
{
header("Location: ".$backtopage);
exit;
}
else
{
$action='';
}
}
/*
* View
*/

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -162,8 +163,9 @@ $nowyear=$nowarray['year'];
$nowmonth=$nowarray['mon'];
$nowday=$nowarray['mday'];
// Define list of all external calendars
$listofextcals=array();
// Define list of external calendars (global admin setup)
if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0)
{
$i=0;
@ -181,7 +183,22 @@ if (empty($conf->global->AGENDA_DISABLE_EXT) && $conf->global->AGENDA_EXT_NB > 0
}
}
}
// Define list of external calendars (user setup)
$i=0;
while($i < $conf->global->AGENDA_EXT_NB)
{
$i++;
$source='AGENDA_EXT_SRC_'.$user->id.'_'.$i;
$name='AGENDA_EXT_NAME_'.$user->id.'_'.$i;
$color='AGENDA_EXT_COLOR_'.$user->id.'_'.$i;
$enabled='AGENDA_EXT_ENABLED_'.$user->id.'_'.$i;
$buggedfile='AGENDA_EXT_BUGGEDFILE_'.$user->id.'_'.$i;
if (! empty($user->conf->$source) && ! empty($user->conf->$name))
{
// Note: $conf->global->buggedfile can be empty or 'uselocalandtznodaylight' or 'uselocalandtzdaylight'
$listofextcals[]=array('src'=>$user->conf->$source,'name'=>$user->conf->$name,'color'=>$user->conf->$color,'buggedfile'=>(isset($user->conf->buggedfile)?$user->conf->buggedfile:0));
}
}
if (empty($action) || $action=='show_month')
{
@ -330,7 +347,12 @@ if ($conf->use_javascript_ajax)
$s.='jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n";
$s.='jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n";
$s.='jQuery(".family_birthday").toggle();' . "\n";
$s.='});' . "\n";
if ($action=="show_week" || $action=="show_month" || empty($action))
{
$s.='jQuery( "td.sortable" ).sortable({connectWith: ".sortable",placeholder: "ui-state-highlight",items: "div:not(.unsortable)", receive: function( event, ui ) {';
$s.='var frm=jQuery("#move_event");frm.attr("action",ui.item.find("a.cal_event").attr("href")).children("#newdate").val(jQuery(event.target).closest("div").attr("id"));frm.submit();}});'."\n";
}
$s.='});' . "\n";
$s.='</script>' . "\n";
if (! empty($conf->use_javascript_ajax))
{
@ -932,6 +954,12 @@ if (empty($action) || $action == 'show_month') // View by month
echo " </tr>\n";
}
echo "</table>\n";
echo '<form id="move_event" action="" method="POST"><input type="hidden" name="action" value="mupdate">';
echo '<input type="hidden" name="backtopage" value="'.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'">';
echo '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
echo '<input type="hidden" name="newdate" id="newdate">' ;
echo '</form>';
}
elseif ($action == 'show_week') // View by week
{
@ -992,6 +1020,11 @@ elseif ($action == 'show_week') // View by week
echo " </tr>\n";
echo "</table>\n";
echo '<form id="move_event" action="" method="POST"><input type="hidden" name="action" value="mupdate">';
echo '<input type="hidden" name="backtopage" value="'.$_SERVER['PHP_SELF'].'?'.$_SERVER['QUERY_STRING'].'">';
echo '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
echo '<input type="hidden" name="newdate" id="newdate">' ;
echo '</form>';
}
else // View by day
{
@ -1089,7 +1122,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '</a>';
}
print '</td></tr>';
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="nowrap" style="padding-bottom: 2px;">';
print '<tr height="'.$minheight.'"><td valign="top" colspan="2" class="nowrap sortable" style="padding-bottom: 2px;">';
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
$i=0; $nummytasks=0; $numother=0; $numbirthday=0; $numical=0; $numicals=array();
@ -1134,9 +1167,9 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
$numicals[dol_string_nospecial($event->icalname)]++;
}
$color=$event->icalcolor;
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other');
$cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other unsortable');
}
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); }
else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday unsortable'; $color=sprintf("%02x%02x%02x",$theme_datacolor[$colorindex][0],$theme_datacolor[$colorindex][1],$theme_datacolor[$colorindex][2]); }
else { $numother++; $cssclass='family_other'; }
if ($color == -1) // Color was not forced. Set color according to color index.
{
@ -1158,6 +1191,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
}
$cssclass=$cssclass.' '.$cssclass.'_day_'.$ymd;
// Defined style to disable drag and drop feature
if (empty($event->fulldayevent))
{
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar)
{
$tmpyearend = date('Y',$event->date_end_in_calendar);
$tmpmonthend = date('m',$event->date_end_in_calendar);
$tmpdayend = date('d',$event->date_end_in_calendar);
if ($tmpyearend != $annee || $tmpmonthend != $mois || $tmpdayend != $jour)
{
$cssclass.= " unsortable";
}
}
if ($event->type_code =='AC_OTH_AUTO')
{
$cssclass.= " unsortable";
}
}
// Show rect of event
print '<div id="event_'.$ymd.'_'.$i.'" class="event '.$cssclass.'">';
print '<ul class="cal_event"><li class="cal_event">';
@ -1329,6 +1381,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
print '}'."\n";
print '});'."\n";
print '</script>'."\n";
}

View File

@ -340,7 +340,7 @@ if ($resql)
print '</td>';
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_valid),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay))
print img_picto($langs->trans("Late"),"warning");
if(!empty($objp->note_private))
{

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.account_number, ba.accountancy_journal, ba.currency_code,";
$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.= " 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.= " WHERE entity IN (".getEntity($this->element, 1).")";
if ($id) $sql.= " AND ba.rowid = ".$id;

View File

@ -377,7 +377,7 @@ class Deplacement extends CommonObject
$ret=array();
$sql = "SELECT id, code, libelle as label";
$sql = "SELECT id, code, label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees";
$sql.= " WHERE active = ".$active;

View File

@ -744,7 +744,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
}
// Standard invoice or Deposit invoice created from a Predefined invoice
if (($_POST['type'] == 0 || $_POST['type'] == 3) && $_POST['fac_rec'] > 0)
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT) && $_POST['fac_rec'] > 0)
{
$dateinvoice = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($dateinvoice))
@ -773,7 +773,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
}
// Standard or deposit or proforma invoice
if (($_POST['type'] == 0 || $_POST['type'] == 3 || $_POST['type'] == 4) && $_POST['fac_rec'] <= 0)
if (($_POST['type'] == Facture::TYPE_STANDARD || $_POST['type'] == Facture::TYPE_DEPOSIT || $_POST['type'] == Facture::TYPE_PROFORMA) && $_POST['fac_rec'] <= 0)
{
if (GETPOST('socid', 'int') < 1)
{
@ -852,7 +852,7 @@ else if ($action == 'add' && $user->rights->facture->creer)
if ($id > 0)
{
// If deposit invoice
if ($_POST['type'] == 3)
if ($_POST['type'] == Facture::TYPE_DEPOSIT)
{
$typeamount = GETPOST('typedeposit', 'alpha');
$valuedeposit = GETPOST('valuedeposit', 'int');
@ -938,6 +938,9 @@ else if ($action == 'add' && $user->rights->facture->creer)
$num=count($lines);
for ($i=0;$i<$num;$i++)
{
// Don't add lines with qty 0 when coming from a shipment including all order lines
if($srcobject->element == 'shipping' && $conf->global->SHIPMENT_GETS_ALL_ORDER_PRODUCTS && $lines[$i]->qty == 0) continue;
$label=(! empty($lines[$i]->label)?$lines[$i]->label:'');
$desc=(! empty($lines[$i]->desc)?$lines[$i]->desc:$lines[$i]->libelle);
@ -2304,7 +2307,16 @@ if ($action == 'create')
elseif ($newclassname == 'Fichinter')
$newclassname = 'Intervention';
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1) . '</td></tr>';
print '<tr><td>' . $langs->trans($newclassname) . '</td><td colspan="2">' . $objectsrc->getNomUrl(1);
//We check if Origin document has already an invoice attached to it
$objectsrc->fetchObjectLinked($originid,'','','facture');
$cntinvoice=count($objectsrc->linkedObjects['facture']);
if ($cntinvoice>=1)
{
setEventMessage('WarningBillExist','warnings');
echo ' ('.$langs->trans('LatestRelatedBill').end($objectsrc->linkedObjects['facture'])->getNomUrl(1).')';
}
echo '</td></tr>';
print '<tr><td>' . $langs->trans('TotalHT') . '</td><td colspan="2">' . price($objectsrc->total_ht) . '</td></tr>';
print '<tr><td>' . $langs->trans('TotalVAT') . '</td><td colspan="2">' . price($objectsrc->total_tva) . "</td></tr>";
if ($mysoc->localtax1_assuj == "1" || $objectsrc->total_localtax1 != 0) // Localtax1

View File

@ -593,6 +593,8 @@ class Facture extends CommonInvoice
// Load source object
$objFrom = dol_clone($this);
// Change socid if needed
if (! empty($socid) && $socid != $this->socid)
@ -635,10 +637,22 @@ class Facture extends CommonInvoice
unset($this->products[$i]); // Tant que products encore utilise
}
}
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
else {
// copy internal contacts
if ($this->copy_linked_contact($objFrom, 'internal') < 0)
$error++;
// copy external contacts if same company
elseif ($objFrom->socid == $this->socid)
{
if ($this->copy_linked_contact($objFrom, 'external') < 0)
$error++;
}
}
if (! $error)
{

View File

@ -367,6 +367,7 @@ $now=dol_now();
$search_ref = GETPOST("search_ref");
$search_refcustomer=GETPOST('search_refcustomer');
$search_societe = GETPOST("search_societe");
$search_paymentmode = GETPOST("search_paymentmode");
$search_montant_ht = GETPOST("search_montant_ht");
$search_montant_ttc = GETPOST("search_montant_ttc");
$late = GETPOST("late");
@ -386,7 +387,7 @@ $limit = $conf->liste_limit;
$sql = "SELECT s.nom, s.rowid as socid, s.email";
$sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
$sql.= ", f.datef as df, f.date_lim_reglement as datelimite";
$sql.= ", f.paye as paye, f.fk_statut, f.type";
$sql.= ", f.paye as paye, f.fk_statut, f.type, f.fk_mode_reglement";
$sql.= ", sum(pf.amount) as am";
if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@ -412,6 +413,7 @@ if (GETPOST('filtre'))
if ($search_ref) $sql .= " AND f.facnumber LIKE '%".$db->escape($search_ref)."%'";
if ($search_refcustomer) $sql .= " AND f.ref_client LIKE '%".$db->escape($search_refcustomer)."%'";
if ($search_societe) $sql .= " AND s.nom LIKE '%".$db->escape($search_societe)."%'";
if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_paymentmode."";
if ($search_montant_ht) $sql .= " AND f.total = '".$db->escape($search_montant_ht)."'";
if ($search_montant_ttc) $sql .= " AND f.total_ttc = '".$db->escape($search_montant_ttc)."'";
if (GETPOST('sf_ref')) $sql .= " AND f.facnumber LIKE '%".$db->escape(GETPOST('sf_ref'))."%'";
@ -441,6 +443,7 @@ if ($resql)
if ($search_ref) $param.='&amp;search_ref='.urlencode($search_ref);
if ($search_refcustomer) $param.='&amp;search_ref='.urlencode($search_refcustomer);
if ($search_societe) $param.='&amp;search_societe='.urlencode($search_societe);
if ($search_societe) $param.='&amp;search_paymentmode='.urlencode($search_paymentmode);
if ($search_montant_ht) $param.='&amp;search_montant_ht='.urlencode($search_montant_ht);
if ($search_montant_ttc) $param.='&amp;search_montant_ttc='.urlencode($search_montant_ttc);
if ($late) $param.='&amp;late='.urlencode($late);
@ -530,6 +533,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"f.datef","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateDue"),$_SERVER["PHP_SELF"],"f.date_lim_reglement","",$param,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PaymentMode"),$_SERVER["PHP_SELF"],"f.fk_reglement_mode","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountHT"),$_SERVER["PHP_SELF"],"f.total","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Taxes"),$_SERVER["PHP_SELF"],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("AmountTTC"),$_SERVER["PHP_SELF"],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
@ -557,6 +561,9 @@ if ($resql)
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="left"><input class="flat" type="text" size="10" name="search_societe" value="'.dol_escape_htmltag($search_societe).'"></td>';
print '<td class="liste_titre" align="left">';
$form->select_types_paiements($search_paymentmode, 'search_paymentmode');
print '</td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ht" value="'.dol_escape_htmltag($search_montant_ht).'"></td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right"><input class="flat" type="text" size="8" name="search_montant_ttc" value="'.dol_escape_htmltag($search_montant_ttc).'"></td>';
@ -636,7 +643,20 @@ if ($resql)
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->df),'day').'</td>'."\n";
print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->datelimite),'day').'</td>'."\n";
print '<td><a href="'.DOL_URL_ROOT.'/comm/fiche.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,28).'</a></td>';
print '<td>';
$thirdparty=new Societe($db);
$thirdparty->id=$objp->socid;
$thirdparty->nom=$objp->nom;
$thirdparty->client=$objp->client;
$thirdparty->code_client=$objp->code_client;
print $thirdparty->getNomUrl(1,'customer');
print '</td>';
// Payment mode
print '<td>';
$form->form_modes_reglement($_SERVER['PHP_SELF'], $objp->fk_mode_reglement, 'none');
print '</td>';
print '<td align="right">'.price($objp->total_ht).'</td>';
print '<td align="right">'.price($objp->total_tva);

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -374,19 +375,15 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
});
';
// Add user helper to input amount on invoices
if (! empty($conf->global->MAIN_JS_ON_PAYMENT) && $facture->type != 2)
{
print ' $("#payment_form").find("img").click(function() {
callForResult(jQuery(this).attr("id"));
});
$("#amountpayment").change(function() {
callForResult();
});';
}
print ' });'."\n";
if(!empty($conf->global->FAC_AUTO_FILLJS)){
//Add js for AutoFill
print ' $(document).ready(function () {';
print ' $(".AutoFillAmout").on(\'click touchstart\', function(){
$("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value")).trigger("change");
});';
print ' });'."\n";
}
print ' </script>'."\n";
}
@ -412,7 +409,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td>'.$langs->trans('Comments').'</td></tr>';
$rowspan=5;
if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT)) $rowspan++;
// Payment mode
print '<tr><td><span class="fieldrequired">'.$langs->trans('PaymentMode').'</span></td><td>';
@ -438,24 +434,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
}
print "</tr>\n";
// Payment amount
if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT))
{
print '<tr><td><span class="fieldrequired">'.$langs->trans('AmountPayment').'</span></td>';
print '<td>';
if ($action == 'add_paiement')
{
print '<input id="amountpayment" name="amountpaymenthidden" size="8" type="text" value="'.(empty($_POST['amountpayment'])?'':$_POST['amountpayment']).'" disabled="disabled">';
print '<input name="amountpayment" type="hidden" value="'.(empty($_POST['amountpayment'])?'':$_POST['amountpayment']).'">';
}
else
{
print '<input id="amountpayment" name="amountpayment" size="8" type="text" value="'.(empty($_POST['amountpayment'])?'':$_POST['amountpayment']).'">';
}
print '</td>';
print '</tr>';
}
// Cheque number
print '<tr><td>'.$langs->trans('Numero');
print ' <em>('.$langs->trans("ChequeOrTransferNumber").')</em>';
@ -578,10 +556,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
if ($action != 'add_paiement')
{
if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT))
{
print img_picto($langs->trans('AddRemind'),'rightarrow.png','id="'.$objp->facid.'"');
}
if(!empty($conf->global->FAC_AUTO_FILLJS))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($sign * $remaintopay)."'");
print '<input type=hidden name="'.$nameRemain.'" value="'.$remaintopay.'">';
print '<input type="text" size="8" name="'.$namef.'" value="'.$_POST[$namef].'">';
}

View File

@ -1260,7 +1260,7 @@ class BonPrelevement extends CommonObject
/*
* 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.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
$sql.= " FROM";
@ -1268,12 +1268,12 @@ class BonPrelevement extends CommonObject
$sql.= " ".MAIN_DB_PREFIX."facture as f,";
$sql.= " ".MAIN_DB_PREFIX."prelevement_facture as pf,";
$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.= " WHERE pl.fk_prelevement_bons = ".$this->id;
$sql.= " AND pl.rowid = pf.fk_prelevement_lignes";
$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 rib.fk_soc = f.fk_soc";
$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_zip soc.zip
* @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_cg pl.code_guichet AS cg,
* @param string $row_cc pl.number AS cc,
@ -1648,7 +1648,7 @@ class BonPrelevement extends CommonObject
$obj = $this->db->fetch_object($resql);
// 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);
$RefBon = $obj->ref;
$type = ($nombre == 1) ? 'FRST' : 'RCUR' ;
@ -1673,7 +1673,7 @@ class BonPrelevement extends CommonObject
$XML_SEPA_INFO .= ' <Cdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.'</Nm>'.$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_ZIP.' '.$configuration->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$CrLf;
$XML_SEPA_INFO .= ' </PstlAdr>'.$CrLf;
@ -1691,7 +1691,7 @@ class BonPrelevement extends CommonObject
/* $XML_SEPA_INFO .= ' <UltmtCdtr>'.$CrLf;
$XML_SEPA_INFO .= ' <Nm>'.$configuration->global->PRELEVEMENT_RAISON_SOCIALE.'</Nm>'.$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_ZIP.' '.$conf->global->MAIN_INFO_SOCIETE_TOWN.'</AdrLine>'.$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
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);
if ($resql)
{
@ -460,9 +460,9 @@ abstract class ActionsContactCardCommon
{
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 = $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.priv, c.note_private, c.note_public, c.default_lang, c.no_email, c.canvas,";
$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.= " 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.= " 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."user as u ON c.rowid = u.fk_socpeople";
$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.= " 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.= " cp.code as country_code";
$sql.= " co.code as country_code";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."c_pays as cp ON cp.rowid = p.fk_pays";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."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";
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";
@ -172,11 +172,11 @@ if (strlen($search_phone))
}
if (strlen($search_phoneper))
{
$sql .= " AND p.phone LIKE '%".$db->escape($search_phoneper)."%'";
$sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phoneper)."%'";
}
if (strlen($search_phonepro))
{
$sql .= " AND p.phone_perso LIKE '%".$db->escape($search_phonepro)."%'";
$sql .= " AND p.phone LIKE '%".$db->escape($search_phonepro)."%'";
}
if (strlen($search_phonemob))
{

View File

@ -45,6 +45,7 @@ class Contrat extends CommonObject
var $id;
var $ref;
var $ref_ext;
var $ref_customer;
var $socid;
var $societe; // Objet societe
var $statut=0; // 0=Draft,
@ -400,6 +401,7 @@ class Contrat extends CommonObject
$sql.= " fk_projet,";
$sql.= " fk_commercial_signature, fk_commercial_suivi,";
$sql.= " note_private, note_public, extraparams";
$sql.= " ,ref_customer";
$sql.= " ,ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."contrat";
if ($ref)
@ -419,6 +421,7 @@ class Contrat extends CommonObject
{
$this->id = $result["rowid"];
$this->ref = (!isset($result["ref"]) || !$result["ref"]) ? $result["rowid"] : $result["ref"];
$this->ref_customer = $result["ref_customer"];
$this->ref_ext = $result["ref_ext"];
$this->statut = $result["statut"];
$this->mise_en_service = $this->db->jdate($result["datemise"]);
@ -720,7 +723,7 @@ class Contrat extends CommonObject
// Insert contract
$sql = "INSERT INTO ".MAIN_DB_PREFIX."contrat (datec, fk_soc, fk_user_author, date_contrat,";
$sql.= " fk_commercial_signature, fk_commercial_suivi, fk_projet,";
$sql.= " ref, entity, note_private, note_public, ref_ext)";
$sql.= " ref, entity, note_private, note_public, ref_customer, ref_ext)";
$sql.= " VALUES ('".$this->db->idate($now)."',".$this->socid.",".$user->id;
$sql.= ", '".$this->db->idate($this->date_contrat)."'";
$sql.= ",".($this->commercial_signature_id>0?$this->commercial_signature_id:"NULL");
@ -730,6 +733,7 @@ class Contrat extends CommonObject
$sql.= ", ".$conf->entity;
$sql.= ", ".(!empty($this->note_private)?("'".$this->db->escape($this->note_private)."'"):"NULL");
$sql.= ", ".(!empty($this->note_public)?("'".$this->db->escape($this->note_public)."'"):"NULL");
$sql.= ", ".(!empty($this->ref_customer)?("'".$this->db->escape($this->ref_customer)."'"):"NULL");
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
$sql.= ")";
$resql=$this->db->query($sql);
@ -739,13 +743,28 @@ class Contrat extends CommonObject
$this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."contrat");
// Mise a jour ref
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql))
// Load object modContract
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive');
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php')
{
if ($this->id)
$module = substr($module, 0, dol_strlen($module)-4);
}
$result=dol_include_once('/core/modules/contract/'.$module.'.php');
if ($result > 0)
{
$modCodeContract = new $module();
}
if (!empty($modCodeContract->code_auto)) {
// Mise a jour ref
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql))
{
$this->ref="(PROV".$this->id.")";
if ($this->id)
{
$this->ref="(PROV".$this->id.")";
}
}
}
@ -824,6 +843,7 @@ class Contrat extends CommonObject
function delete($user)
{
global $conf, $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
$error=0;
@ -965,6 +985,7 @@ class Contrat extends CommonObject
// Clean parameters
if (isset($this->ref)) $this->ref=trim($this->ref);
if (isset($this->ref_customer)) $this->ref_customer=trim($this->ref_customer);
if (isset($this->ref_ext)) $this->ref_ext=trim($this->ref_ext);
if (isset($this->entity)) $this->entity=trim($this->entity);
if (isset($this->statut)) $this->statut=trim($this->statut);
@ -988,6 +1009,7 @@ class Contrat extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."contrat SET";
$sql.= " ref=".(isset($this->ref)?"'".$this->db->escape($this->ref)."'":"null").",";
$sql.= " ref_customer=".(isset($this->ref_customer)?"'".$this->db->escape($this->ref_customer)."'":"null").",";
$sql.= " ref_ext=".(isset($this->ref_ext)?"'".$this->db->escape($this->ref_ext)."'":"null").",";
$sql.= " entity=".$conf->entity.",";
$sql.= " date_contrat=".(dol_strlen($this->date_contrat)!=0 ? "'".$this->db->idate($this->date_contrat)."'" : 'null').",";

View File

@ -207,7 +207,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
$object->fk_project = GETPOST('projectid','int');
$object->remise_percent = GETPOST('remise_percent','alpha');
$object->ref = GETPOST('ref','alpha');
$object->ref_ext = GETPOST('ref_ext','alpha');
$object->ref_customer = GETPOST('ref_customer','alpha');
// If creation from another object of another module (Example: origin=propal, originid=1)
if ($_POST['origin'] && $_POST['originid'])
@ -342,7 +342,7 @@ if ($action == 'add' && $user->rights->contrat->creer)
// Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels, $object);
$result = $object->create($user);
if ($result > 0)
{
@ -729,17 +729,32 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra
$action = 'edit_extras';
setEventMessage($object->error,'errors');
}
} elseif ($action=='setref_ext') {
} elseif ($action=='setref_customer') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref_ext=GETPOST('ref_ext','alpha');
$object->ref_customer=GETPOST('ref_customer','alpha');
$result = $object->update($user);
if ($result < 0) {
setEventMessage($object->errors,'errors');
$action='editref_ext';
$action='editref_customer';
} else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
}
} elseif ($action=='setref') {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessage($object->errors,'errors');
}
$object->ref=GETPOST('ref','alpha');
$result = $object->update($user);
if ($result < 0) {
setEventMessage($object->errors,'errors');
$action='editref';
} else {
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
exit;
@ -818,6 +833,18 @@ $form = new Form($db);
$objectlignestatic=new ContratLigne($db);
// Load object modContract
$module=(! empty($conf->global->CONTRACT_ADDON)?$conf->global->CONTRACT_ADDON:'mod_contract_olive');
if (substr($module, 0, 13) == 'mod_contract_' && substr($module, -3) == 'php')
{
$module = substr($module, 0, dol_strlen($module)-4);
}
$result=dol_include_once('/core/modules/contract/'.$module.'.php');
if ($result > 0)
{
$modCodeContract = new $module();
}
/*********************************************************************
*
@ -878,8 +905,6 @@ if ($action == 'create')
$object->date_contrat = dol_now();
$numct = $object->getNextNumRef($soc);
print '<form name="form_contract" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@ -890,11 +915,16 @@ if ($action == 'create')
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$langs->trans("Draft").'</td></tr>';
if (! empty($modCodeContract->code_auto)) {
$tmpcode=$langs->trans("Draft");
} else {
$tmpcode='<input name="ref" size="20" maxlength="128" value="'.dol_escape_htmltag(GETPOST('ref')?GETPOST('ref'):$tmpcode).'">';
}
print '<tr><td class="fieldrequired">'.$langs->trans('Ref').'</td><td colspan="2">'.$tmpcode.'</td></tr>';
// Ref Int
print '<tr><td>'.$langs->trans('RefCustomer').'</td>';
print '<td colspan="2"><input type="text" siez="5" name="ref_ext" id="ref_ext" value="'.GETPOST('ref_ext','alpha').'"></td></tr>';
print '<td colspan="2"><input type="text" siez="5" name="ref_customer" id="ref_customer" value="'.GETPOST('ref_customer','alpha').'"></td></tr>';
// Customer
print '<tr>';
@ -1040,7 +1070,7 @@ else
if ($action == 'valid')
{
$ref = substr($object->ref, 1, 4);
if ($ref == 'PROV')
if ($ref == 'PROV' && !empty($modCodeContract->code_auto))
{
$numref = $object->getNextNumRef($soc);
}
@ -1079,15 +1109,25 @@ else
$linkback = '<a href="'.DOL_URL_ROOT.'/contrat/liste.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
// Ref du contrat
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print "</td></tr>";
if (!empty($modCodeContract->code_auto)) {
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td colspan="3">';
print $form->showrefnav($object, 'ref', $linkback, 1, 'ref', 'ref', '');
print "</td></tr>";
} else {
print '<tr>';
print '<td width="20%">';
print $form->editfieldkey("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer);
print '</td><td>';
print $form->editfieldval("Ref",'ref',$object->ref,$object,$user->rights->contrat->creer);
print '</td>';
print '</tr>';
}
print '<tr>';
print '<td width="20%">';
print $form->editfieldkey("RefCustomer",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer);
print $form->editfieldkey("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
print '</td><td>';
print $form->editfieldval("RefCustomer",'ref_ext',$object->ref_ext,$object,$user->rights->contrat->creer);
print $form->editfieldval("RefCustomer",'ref_customer',$object->ref_customer,$object,$user->rights->contrat->creer);
print '</td>';
print '</tr>';

View File

@ -42,7 +42,7 @@ $offset = $limit * $page ;
$search_nom=GETPOST('search_nom');
$search_contract=GETPOST('search_contract');
$search_ref_ext=GETPOST('search_ref_ext','alpha');
$search_ref_customer=GETPOST('search_ref_customer','alpha');
$sall=GETPOST('sall');
$statut=GETPOST('statut')?GETPOST('statut'):1;
$socid=GETPOST('socid');
@ -75,7 +75,7 @@ $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND
$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut,";
$sql.= " s.nom, s.rowid as socid";
$sql.= " ,c.ref_ext";
$sql.= " ,c.ref_customer";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
@ -90,8 +90,8 @@ if ($search_nom) {
if ($search_contract) {
$sql .= natural_search(array('c.rowid', 'c.ref'), $search_contract);
}
if (!empty($search_ref_ext)) {
$sql .= natural_search(array('c.ref_ext'), $search_ref_ext);
if (!empty($search_ref_customer)) {
$sql .= natural_search(array('c.ref_customer'), $search_ref_customer);
}
if ($sall) {
$sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
@ -114,9 +114,9 @@ if ($resql)
print '<tr class="liste_titre">';
$param='&amp;search_contract='.$search_contract;
$param.='&amp;search_nom='.$search_nom;
$param.='&amp;search_ref_ext='.$search_ref_ext;
$param.='&amp;search_ref_customer='.$search_ref_customer;
print_liste_field_titre($langs->trans("Ref"), $_SERVER["PHP_SELF"], "c.rowid","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_ext","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("RefCustomer"), $_SERVER["PHP_SELF"], "c.ref_customer","","$param",'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"), $_SERVER["PHP_SELF"], "s.nom","","$param",'',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("DateCreation"), $_SERVER["PHP_SELF"], "c.datec","","$param",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateContract"), $_SERVER["PHP_SELF"], "c.date_contrat","","$param",'align="center"',$sortfield,$sortorder);
@ -134,7 +134,7 @@ if ($resql)
print '<input type="text" class="flat" size="3" name="search_contract" value="'.$search_contract.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="7" name="search_ref_ext" value="'.$search_ref_ext.'">';
print '<input type="text" class="flat" size="7" name="search_ref_customer value="'.$search_ref_customer.'">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" size="24" name="search_nom" value="'.$search_nom.'">';
@ -156,7 +156,7 @@ if ($resql)
print img_object($langs->trans("ShowContract"),"contract").' '.(isset($obj->ref) ? $obj->ref : $obj->cid) .'</a>';
if ($obj->nb_late) print img_warning($langs->trans("Late"));
print '</td>';
print '<td>'.$obj->ref_ext.'</td>';
print '<td>'.$obj->ref_customer.'</td>';
print '<td><a href="../comm/fiche.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
//print '<td align="center">'.dol_print_date($obj->datec).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>';

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
{
$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.= " 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_regions as r ON d.fk_region = r.code_region";
$sql.= " WHERE z.fk_pays = p.rowid";
$sql.= " AND z.active = 1 AND p.active = 1";
$sql.= " WHERE z.fk_pays = c.rowid";
$sql.= " AND z.active = 1 AND c.active = 1";
if ($zipcode) $sql.=" AND z.zip LIKE '" . $db->escape($zipcode) . "%'";
if ($town) $sql.=" AND z.town LIKE '%" . $db->escape($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
{
$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.= " 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_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";
if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";

View File

@ -77,10 +77,8 @@ class box_project extends ModeleBoxes
{
$sql = "SELECT p.rowid, p.ref, p.title, p.fk_statut ";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."projet as p";
$sql.= ")";
$sql.= " WHERE p.fk_soc = s.rowid";
$sql.= " AND s.entity = ".$conf->entity;
$sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " AND p.fk_statut = 1"; // Seulement les projets ouverts
$sql.= " ORDER BY p.datec DESC";
$sql.= $db->plimit($max, 0);
@ -107,16 +105,16 @@ class box_project extends ModeleBoxes
);
$sql ="SELECT count(*) as nb, sum(progress) as totprogress";
$sql.=" FROM ".MAIN_DB_PREFIX."projet_task as pt, ".MAIN_DB_PREFIX."projet as p";
$sql.=" WHERE pt.fk_projet = p.rowid";
$sql.=" AND p.entity = ".$conf->entity;
$sql.=" FROM ".MAIN_DB_PREFIX."projet as p LEFT JOIN ".MAIN_DB_PREFIX."projet_task as pt on pt.fk_projet = p.rowid";
$sql.=" WHERE p.entity = ".$conf->entity;
$resultTask = $db->query($sql);
if ($resultTask)
{
$objTask = $db->fetch_object($resultTask);
$this->info_box_contents[$i][3] = array('td' => 'align="right"', 'text' => number_format($objTask->nb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
if ($objTask->nb > 0 )
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')." %&nbsp;".$langs->trans("Progress"));
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => number_format(($objTask->totprogress/$objTask->nb), 0, ',', ' ')."%");
else
$this->info_box_contents[$i][4] = array('td' => 'align="right"', 'text' => "N/A&nbsp;");
$totalnbTask += $objTask->nb;
@ -134,10 +132,11 @@ class box_project extends ModeleBoxes
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')."&nbsp;".$langs->trans("Projects"));
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => "");
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($num, 0, ',', ' ')."&nbsp;".$langs->trans("Projects"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => number_format($totalnbTask, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][4] = array('td' => '', 'text' => "");
}

View File

@ -120,12 +120,13 @@ class box_task extends ModeleBoxes
// Add the sum à the bottom of the boxes
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'colspan=2 align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
$this->info_box_contents[$i][4] = array('td' => 'colspan=2', 'text' => "");
$this->info_box_contents[$i][0] = array('tr' => 'class="liste_total"', 'td' => 'align="left" ', 'text' => $langs->trans("Total")."&nbsp;".$textHead);
$this->info_box_contents[$i][1] = array('td' => '', 'text' => "");
$this->info_box_contents[$i][2] = array('td' => 'align="right" ', 'text' => number_format($totalnb, 0, ',', ' ')."&nbsp;".$langs->trans("Tasks"));
$this->info_box_contents[$i][3] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totalplannedtot,'all',25200,5));
$this->info_box_contents[$i][4] = array('td' => 'align="right" ', 'text' => ConvertSecondToTime($totaldurationtot,'all',25200,5));
$this->info_box_contents[$i][5] = array('td' => '', 'text' => "");
}
/**

View File

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

View File

@ -47,6 +47,8 @@ abstract class CommonObject
public $array_options=array();
public $thirdparty;
public $linkedObjectsIds; // Loaded by ->fetchObjectLinked
public $linkedObjects; // Loaded by ->fetchObjectLinked
@ -596,10 +598,10 @@ abstract class CommonObject
{
global $conf;
if (empty($this->socid) && empty($this->fk_soc)) return 0;
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
$thirdparty = new Societe($this->db);
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:$this->fk_soc);
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
$this->client = $thirdparty; // deprecated
$this->thirdparty = $thirdparty;

View File

@ -680,6 +680,7 @@ class ExtraFields
}
$out.='<select class="flat" name="options_'.$key.$keyprefix.'" id="options_'.$key.$keyprefix.'" '.($moreparam?$moreparam:'').'>';
$out.='<option value="0">&nbsp;</option>';
foreach ($param['options'] as $key=>$val )
{
list($val, $parent) = explode('|', $val);
@ -978,7 +979,7 @@ class ExtraFields
{
foreach ($fields_label as $field_toshow)
{
$translabel=$langs->trans($obj->field_toshow);
$translabel=$langs->trans($obj->$field_toshow);
if ($translabel!=$field_toshow) {
$value.=dol_trunc($translabel,18).' ';
}else {

View File

@ -449,19 +449,6 @@ class Form
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
*
@ -481,8 +468,8 @@ class Form
$countryArray=array();
$label=array();
$sql = "SELECT rowid, code as code_iso, libelle as label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_pays";
$sql = "SELECT rowid, code as code_iso, code_iso as code_iso3, label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_country";
$sql.= " WHERE active = 1";
//$sql.= " ORDER BY code ASC";
@ -490,7 +477,7 @@ class Form
$resql=$this->db->query($sql);
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);
$i = 0;
if ($num)
@ -502,6 +489,7 @@ class Form
$obj = $this->db->fetch_object($resql);
$countryArray[$i]['rowid'] = $obj->rowid;
$countryArray[$i]['code_iso'] = $obj->code_iso;
$countryArray[$i]['code_iso3'] = $obj->code_iso3;
$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
$label[$i] = dol_string_unaccent($countryArray[$i]['label']);
$i++;
@ -512,7 +500,7 @@ class Form
foreach ($countryArray as $row)
{
//print 'rr'.$selected.'-'.$row['label'].'-'.$row['code_iso'].'<br>';
if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['label']) )
if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['code_iso3'] || $selected == $row['label']) )
{
$foundselected=true;
$out.= '<option value="'.$row['rowid'].'" selected="selected">';
@ -605,7 +593,7 @@ class Form
if (count($this->cache_types_fees)) return 0; // Cache already load
$sql = "SELECT c.code, c.libelle as label";
$sql = "SELECT c.code, c.label";
$sql.= " FROM ".MAIN_DB_PREFIX."c_type_fees as c";
$sql.= " ORDER BY lower(c.libelle) ASC";
@ -683,7 +671,7 @@ class Form
* @param int $forcecombo Force to use combo box
* @return string Return select box for thirdparty.
*/
function select_thirdparty($selected='', $htmlname='productid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
function select_thirdparty($selected='', $htmlname='socid', $filter='', $limit=20, $ajaxoptions=array(), $forcecombo=0)
{
global $langs,$conf;
@ -1135,7 +1123,7 @@ class Form
if (is_array($exclude)) $excludeUsers = implode("','",$exclude);
// Permettre l'inclusion d'utilisateurs
if (is_array($include)) $includeUsers = implode("','",$include);
else if ($include == 'hierarchy')
else if ($include == 'hierarchy')
{
// Build list includeUsers to have only hierarchy
$userid=$user->id;
@ -1149,7 +1137,7 @@ class Form
//var_dump($includeUsers);exit;
//var_dump($user->users);exit;
}
$out='';
// On recherche les utilisateurs
@ -2458,7 +2446,7 @@ class Form
$sql.= " WHERE active = 1";
if ($filtre) $sql.=" AND ".$filtre;
$sql.= " ORDER BY libelle ASC";
dol_syslog(get_class($this)."::selectShippingMode", LOG_DEBUG);
$result = $this->db->query($sql);
if ($result) {
@ -2489,7 +2477,7 @@ class Form
dol_print_error($this->db);
}
}
/**
* Display form to select shipping mode
*
@ -3452,10 +3440,10 @@ class Form
if ($num > 0) return $num; // Cache deja charge
$sql = "SELECT DISTINCT t.taux, t.recuperableonly";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql.= " WHERE t.fk_pays = p.rowid";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql.= " WHERE t.fk_pays = c.rowid";
$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";
$resql=$this->db->query($sql);
@ -3539,14 +3527,14 @@ class Form
//exit;
// 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))
{
$code_pays="'".$societe_vendeuse->country_code."'";
$code_country="'".$societe_vendeuse->country_code."'";
}
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
{
@ -3557,12 +3545,12 @@ class Form
{
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
{
$code_pays.=",'".$societe_acheteuse->country_code."'";
$code_country.=",'".$societe_acheteuse->country_code."'";
}
else
{
@ -3570,14 +3558,14 @@ class Form
$prodstatic->fetch($idprod);
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
$num = $this->load_cache_vatrates($code_pays);
$num = $this->load_cache_vatrates($code_country);
if ($num > 0)
{
// Definition du taux a pre-selectionner (si defaulttx non force et donc vaut -1 ou '')

View File

@ -222,13 +222,13 @@ class FormCompany
$out='';
// 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 .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid";
$sql .= " AND d.active = 1 AND r.active = 1 AND p.active = 1";
if ($country_codeid && is_numeric($country_codeid)) $sql .= " AND p.rowid = '".$country_codeid."'";
if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND p.code = '".$country_codeid."'";
$sql .= " ORDER BY p.code, d.code_departement";
$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_country as c";
$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
if ($country_codeid && is_numeric($country_codeid)) $sql .= " AND c.rowid = '".$country_codeid."'";
if ($country_codeid && ! is_numeric($country_codeid)) $sql .= " AND c.code = '".$country_codeid."'";
$sql .= " ORDER BY c.code, d.code_departement";
dol_syslog(get_class($this)."::select_departement", LOG_DEBUG);
$result=$this->db->query($sql);
@ -303,9 +303,10 @@ class FormCompany
global $conf,$langs;
$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.= " WHERE r.fk_pays=p.rowid AND r.active = 1 and p.active = 1";
$sql.= " ORDER BY p.code, p.libelle ASC";
$sql = "SELECT r.rowid, r.code_region as code, r.nom as label, r.active, c.code as country_code, c.label as country";
$sql.= " FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_country as c";
$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);
$resql=$this->db->query($sql);
@ -335,11 +336,11 @@ class FormCompany
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
{
print '<option value="'.$obj->code.'">'.$obj->libelle.'</option>';
print '<option value="'.$obj->code.'">'.$obj->label.'</option>';
}
}
$i++;
@ -440,13 +441,13 @@ class FormCompany
$out='';
// 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 .= " FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p";
$sql .= " WHERE f.fk_pays=p.rowid";
$sql .= " AND f.active = 1 AND p.active = 1";
if ($country_codeid) $sql .= " AND p.code = '".$country_codeid."'";
$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_country as c";
$sql .= " WHERE f.fk_pays=c.rowid";
$sql .= " AND f.active = 1 AND c.active = 1";
if ($country_codeid) $sql .= " AND c.code = '".$country_codeid."'";
if ($filter) $sql .= " ".$filter;
$sql .= " ORDER BY p.code";
$sql .= " ORDER BY c.code";
dol_syslog(get_class($this)."::select_juridicalstatus", LOG_DEBUG);
$resql=$this->db->query($sql);

View File

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

View File

@ -109,7 +109,7 @@ class FormProjets
//else $labeltoshow.=' ('.$langs->trans("Private").')';
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0)
{
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.' - '.dol_trunc($obj->title,$maxlength).'</option>';
$out.= '<option value="'.$obj->rowid.'" selected="selected">'.$labeltoshow.' '.dol_trunc($obj->title,$maxlength).'</option>';
}
else
{

View File

@ -73,9 +73,9 @@ class FormSocialContrib
else
{
$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.= " WHERE c.active = 1 AND c.fk_pays = p.rowid";
$sql.= " AND p.code = '".$mysoc->country_code."'";
$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 = co.rowid";
$sql.= " AND co.code = '".$mysoc->country_code."'";
$sql.= " ORDER BY c.libelle ASC";
}

View File

@ -349,7 +349,7 @@ class DoliDBMssql extends DoliDB
//print "<!--".$query."-->";
dol_syslog('sql='.$query, LOG_DEBUG);
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
if (! $this->database_name)
{

View File

@ -252,7 +252,7 @@ class DoliDBMysql extends DoliDB
{
$query = trim($query);
dol_syslog('sql='.$query, LOG_DEBUG);
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
if (! $this->database_name)
{
@ -274,8 +274,7 @@ class DoliDBMysql extends DoliDB
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
}
$this->lastquery=$query;
$this->_results = $ret;
@ -833,6 +832,11 @@ class DoliDBMysql extends DoliDB
{
return -1;
}
else
{
// If user already exists, we continue to set permissions
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
}
}
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log

View File

@ -256,7 +256,7 @@ class DoliDBMysqli extends DoliDB
{
$query = trim($query);
dol_syslog('sql='.$query, LOG_DEBUG);
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
if (! $this->database_name)
{
@ -277,8 +277,7 @@ class DoliDBMysqli extends DoliDB
$this->lasterror = $this->error();
$this->lasterrno = $this->errno();
dol_syslog(get_class($this)."::query SQL Error query: ".$query, LOG_ERR);
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterror." (".$this->lasterrno.")", LOG_ERR);
dol_syslog(get_class($this)."::query SQL Error message: ".$this->lasterrno." ".$this->lasterror, LOG_ERR);
}
$this->lastquery=$query;
$this->_results = $ret;
@ -838,6 +837,11 @@ class DoliDBMysqli extends DoliDB
{
return -1;
}
else
{
// If user already exists, we continue to set permissions
dol_syslog(get_class($this)."::DDLCreateUser sql=".$sql, LOG_WARNING);
}
}
$sql = "GRANT ALL PRIVILEGES ON ".$this->escape($dolibarr_main_db_name).".* TO '".$this->escape($dolibarr_main_db_user)."'@'".$this->escape($dolibarr_main_db_host)."' IDENTIFIED BY '".$this->escape($dolibarr_main_db_pass)."'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001 Fabien Seisen <seisen@linuxfr.org>
* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
@ -491,7 +491,7 @@ class DoliDBPgsql extends DoliDB
@pg_query($this->db, 'SAVEPOINT mysavepoint');
}
dol_syslog('sql='.$query, LOG_DEBUG);
if (! in_array($query,array('BEGIN','COMMIT','ROLLBACK'))) dol_syslog('sql='.$query, LOG_DEBUG);
$ret = @pg_query($this->db, $query);
@ -985,7 +985,8 @@ class DoliDBPgsql extends DoliDB
*/
function DDLCreateUser($dolibarr_main_db_host,$dolibarr_main_db_user,$dolibarr_main_db_pass,$dolibarr_main_db_name)
{
$sql = "CREATE USER '".$this->escape($dolibarr_main_db_user)."' with password '".$this->escape($dolibarr_main_db_pass)."'";
// Note: using ' on user does not works with pgsql
$sql = "CREATE USER ".$this->escape($dolibarr_main_db_user)." with password '".$this->escape($dolibarr_main_db_pass)."'";
dol_syslog(get_class($this)."::DDLCreateUser", LOG_DEBUG); // No sql to avoid password in log
$resql=$this->query($sql);

View File

@ -1,5 +1,5 @@
// Copyright (C) 2005-2014 Laurent Destailleur <eldy@users.sourceforge.net>
// Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
// Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@ -633,7 +633,7 @@ function hideMessage(fieldId,message) {
/*
* TODO Used by admin page only ?
*/
function setConstant(url, code, input, entity) {
function setConstant(url, code, input, entity, strict) {
$.get( url, {
action: "set",
name: code,
@ -644,7 +644,7 @@ function setConstant(url, code, input, entity) {
$("#del_" + code).show();
$.each(input, function(type, data) {
// Enable another element
if (type == "disabled") {
if (type == "disabled" && strict != 1) {
$.each(data, function(key, value) {
var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value;
$(newvalue).removeAttr("disabled");
@ -656,7 +656,10 @@ function setConstant(url, code, input, entity) {
} else if (type == "enabled") {
$.each(data, function(key, value) {
var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value;
$(newvalue).attr("disabled", true);
if (strict == 1)
$(newvalue).removeAttr("disabled");
else
$(newvalue).attr("disabled", true);
if ($(newvalue).hasClass("butAction") == true) {
$(newvalue).removeClass("butAction");
$(newvalue).addClass("butActionRefused");
@ -688,7 +691,7 @@ function setConstant(url, code, input, entity) {
/*
* TODO Used by admin page only ?
*/
function delConstant(url, code, input, entity) {
function delConstant(url, code, input, entity, strict) {
$.get( url, {
action: "del",
name: code,
@ -708,7 +711,7 @@ function delConstant(url, code, input, entity) {
$(newvalue).addClass("butActionRefused");
}
});
} else if (type == "enabled") {
} else if (type == "enabled" && strict != 1) {
$.each(data, function(key, value) {
var newvalue=((value.search("^#") < 0 && value.search("^\.") < 0) ? "#" : "") + value;
$(newvalue).removeAttr("disabled");
@ -742,7 +745,7 @@ function delConstant(url, code, input, entity) {
/*
* TODO Used by admin page only ?
*/
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton) {
function confirmConstantAction(action, url, code, input, box, entity, yesButton, noButton, strict) {
var boxConfirm = box;
$("#confirm_" + code)
.attr("title", boxConfirm.title)
@ -758,9 +761,9 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
text : yesButton,
click : function() {
if (action == "set") {
setConstant(url, code, input, entity);
setConstant(url, code, input, entity, strict);
} else if (action == "del") {
delConstant(url, code, input, entity);
delConstant(url, code, input, entity, strict);
}
// Close dialog
$(this).dialog("close");

View File

@ -73,17 +73,18 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh
//print ' &nbsp;</td><td class="nowrap maxwidthonsmartphone">';
//print $form->select_dolusers($filtera, 'userasked', 1, '', ! $canedit);
//print ' &nbsp; '.$langs->trans("or") . ' ';
print $langs->trans("ActionsForUser").' &nbsp; ';
print $langs->trans("ActionAffectedTo").' &nbsp; ';
print '</td><td class="nowrap maxwidthonsmartphone">';
//print ' &nbsp;';
//print $langs->trans("User");
print $form->select_dolusers($filtert, 'usertodo', 1, '', ! $canedit);
if (! empty($conf->use_javascript_ajax))
{
include_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
print ajax_combobox('usertodo');
}
print ' &nbsp; '.$langs->trans("or") . ' ';
print $langs->trans("ActionsForUsersGroup").' &nbsp; ';
if (empty($conf->dol_optimize_smallscreen)) print ' &nbsp; '.$langs->trans("or") . ' ';
else print '<br>';
print $langs->trans("Group").' &nbsp; ';
print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', ! $canedit);
if (! empty($conf->use_javascript_ajax))
{

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
*
* This program is free software; you can redistribute it and/or modify
@ -391,9 +391,10 @@ function ajax_combobox($htmlname, $events=array(), $minLengthToAutocomplete=0)
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
* @param int $entity Entity to set
* @param int $revertonoff Revert on/off
* @param bool $strict Use only "disabled" with delConstant and "enabled" with setConstant
* @return void
*/
function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0, $strict=0)
{
global $conf, $langs;
@ -413,6 +414,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
var url = \''.DOL_URL_ROOT.'/core/ajax/constantonoff.php\';
var code = \''.$code.'\';
var entity = \''.$entity.'\';
var strict = \''.$strict.'\';
var yesButton = "'.dol_escape_js($langs->transnoentities("Yes")).'";
var noButton = "'.dol_escape_js($langs->transnoentities("No")).'";
@ -421,7 +423,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
if (input.alert && input.alert.set) {
if (input.alert.set.yesButton) yesButton = input.alert.set.yesButton;
if (input.alert.set.noButton) noButton = input.alert.set.noButton;
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton);
confirmConstantAction("set", url, code, input, input.alert.set, entity, yesButton, noButton, strict);
} else {
setConstant(url, code, input, entity);
}
@ -432,7 +434,7 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0)
if (input.alert && input.alert.del) {
if (input.alert.del.yesButton) yesButton = input.alert.del.yesButton;
if (input.alert.del.noButton) noButton = input.alert.del.noButton;
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton);
confirmConstantAction("del", url, code, input, input.alert.del, entity, yesButton, noButton, strict);
} else {
delConstant(url, code, input, entity);
}

View File

@ -64,13 +64,21 @@ function societe_prepare_head($object)
$h++;
}
if (($object->localtax1_assuj || $object->localtax2_assuj) && (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0) )
{
$head[$h][0] = DOL_URL_ROOT.'/societe/localtaxes.php?socid='.$object->id;
$head[$h][1] = $langs->trans("LocalTaxes");
$head[$h][2] = 'localtaxes';
$h++;
}
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES))
{
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Contact");
$head[$h][2] = 'contact';
$h++;
}
if (($object->localtax1_assuj || $object->localtax2_assuj) && (isset($conf->global->MAIN_FEATURES_LEVEL) && $conf->global->MAIN_FEATURES_LEVEL > 0) )
{
$head[$h][0] = DOL_URL_ROOT.'/societe/localtaxes.php?socid='.$object->id;
$head[$h][1] = $langs->trans("LocalTaxes");
$head[$h][2] = 'localtaxes';
$h++;
}
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
{
@ -262,10 +270,10 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv=
if (! is_object($dbtouse)) $dbtouse=$db;
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;
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);
$resql=$dbtouse->query($sql);
@ -274,7 +282,7 @@ function getCountry($searchkey,$withcode='',$dbtouse=0,$outputlangs='',$entconv=
$obj = $dbtouse->fetch_object($resql);
if ($obj)
{
$label=((! empty($obj->libelle) && $obj->libelle!='-')?$obj->libelle:'');
$label=((! empty($obj->label) && $obj->label!='-')?$obj->label:'');
if (is_object($outputlangs))
{
$outputlangs->load("dict");

View File

@ -11,7 +11,8 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* Copyright (C) 2014 Cédric GROSS <c.gross@kreiz-it.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@ -169,11 +170,13 @@ function dol_shutdown()
* Return value of a param into GET or POST supervariable
*
* @param string $paramname Name of parameter to found
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array)
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
* @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to custom
* @return string||string[] Value found, or '' if check fails
*/
function GETPOST($paramname,$check='',$method=0)
function GETPOST($paramname,$check='',$method=0,$filter=NULL,$options=NULL)
{
if (empty($method)) $out = isset($_GET[$paramname])?$_GET[$paramname]:(isset($_POST[$paramname])?$_POST[$paramname]:'');
elseif ($method==1) $out = isset($_GET[$paramname])?$_GET[$paramname]:'';
@ -184,28 +187,33 @@ function GETPOST($paramname,$check='',$method=0)
if (! empty($check))
{
// Check if numeric
if ($check == 'int' && ! is_numeric($out)) $out='';
// Check if alpha
elseif ($check == 'alpha')
{
$out=trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
if (preg_match('/"/',$out)) $out='';
else if (preg_match('/\.\.\//',$out)) $out='';
}
elseif ($check == 'aZ')
{
$out=trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
if (preg_match('/[^a-z]+/i',$out)) $out='';
}
elseif ($check == 'array')
{
if (! is_array($out) || empty($out)) $out=array();
}
switch ($check)
{
case 'int':
if (! is_numeric($out)) { $out=''; }
break;
case 'alpha':
$out=trim($out);
// '"' is dangerous because param in url can close the href= or src= and add javascript functions.
// '../' is dangerous because it allows dir transversals
if (preg_match('/"/',$out)) $out='';
else if (preg_match('/\.\.\//',$out)) $out='';
break;
case 'san_alpha':
$out=filter_var($out,FILTER_SANITIZE_STRING);
break;
case 'aZ':
$out=trim($out);
if (preg_match('/[^a-z]+/i',$out)) $out='';
break;
case 'array':
if (! is_array($out) || empty($out)) $out=array();
break;
case 'custom':
if (empty($filter)) return 'BadFourthParameterForGETPOST';
$out=filter_var($out, $filter, $options);
break;
}
}
return $out;
@ -2989,8 +2997,8 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="")
$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 .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
$sql .= " AND t.taux = ".$tva." AND t.active = 1";
dol_syslog("get_localtax", LOG_DEBUG);
@ -3037,11 +3045,11 @@ function isOnlyOneLocalTax($local)
function get_localtax_by_third($local)
{
global $db, $mysoc;
$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.=" WHERE p.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.= " WHERE p.code = '".$mysoc->country_code."')";
$sql ="SELECT t.localtax1, t.localtax2 ";
$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 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_country as c ON c.rowid=tt.fk_pays";
$sql.=" WHERE c.code = '".$mysoc->country_code."')";
$resql=$db->query($sql);
if ($resql)
@ -3077,8 +3085,8 @@ function getLocalTaxesFromRate($vatrate, $local, $buyer, $seller)
// Search local taxes
$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 .= " WHERE t.fk_pays = p.rowid AND p.code = '".$buyer->country_code."'";
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'";
$sql .= " AND t.taux = ".$vatrate." AND t.active = 1";
$resql=$db->query($sql);
@ -3212,8 +3220,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.
$sql = "SELECT taux as vat_rate";
$sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p";
$sql.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'";
$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 = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
$sql.= $db->plimit(1);
@ -3282,8 +3290,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.
$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.= " WHERE t.active=1 AND t.fk_pays = p.rowid AND p.code='".$thirdparty_seller->country_code."'";
$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 = c.rowid AND c.code='".$thirdparty_seller->country_code."'";
$sql.= " ORDER BY t.taux DESC, t.recuperableonly ASC";
$sql.= $db->plimit(1);
@ -4432,6 +4440,7 @@ function dol_eval($s,$returnvalue=0)
global $langs, $user, $conf;
global $leftmenu;
global $rights;
global $object;
//print $s."<br>\n";
if ($returnvalue) return @eval('return '.$s.';');

View File

@ -430,7 +430,7 @@ function pdf_pagehead(&$pdf,$outputlangs,$page_height)
global $conf;
// Add a background image on document
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF))
if (! empty($conf->global->MAIN_USE_BACKGROUND_ON_PDF)) // Warning, this option make TCPDF generation beeing crazy and some content disappeared behin the image
{
$pdf->SetAutoPageBreak(0,0); // Disable auto pagebreak before adding image
$pdf->Image($conf->mycompany->dir_output.'/logos/'.$conf->global->MAIN_USE_BACKGROUND_ON_PDF, (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_X)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_X:0), (isset($conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y)?$conf->global->MAIN_USE_BACKGROUND_ON_PDF_Y:0), 0, $page_height);
@ -798,7 +798,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
if ($line) // Free text
{
$pdf->SetXY($dims['lm'],-$posy);
$pdf->MultiCell($width, 3, $line, 0, $align, 0);
$pdf->MultiCell(0, 3, $line, 0, $align, 0);
$posy-=$freetextheight;
}

View File

@ -71,6 +71,14 @@ function user_prepare_head($object)
$head[$h][2] = 'guisetup';
$h++;
if (! empty($conf->agenda->enabled))
{
$head[$h][0] = DOL_URL_ROOT.'/user/agenda_extsites.php?id='.$object->id;
$head[$h][1] = $langs->trans("ExtSites");
$head[$h][2] = 'extsites';
$h++;
}
if (! empty($conf->clicktodial->enabled))
{
$head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$object->id;

View File

@ -32,6 +32,7 @@ class mod_contract_magre extends ModelNumRefContracts
var $version='dolibarr';
var $error = '';
var $nom = 'Magre';
var $code_auto=1;
/**
* Return default description of numbering model

View File

@ -0,0 +1,106 @@
<?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2006-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2014 Floran Henry <florian.henry@open-concept.pro>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* or see http://www.gnu.org/
*/
/**
* \file htdocs/core/modules/contract/mod_contract_olive.php
* \ingroup contract
* \brief File of class to manage contract numbering rules Olive
*/
require_once DOL_DOCUMENT_ROOT .'/core/modules/contract/modules_contract.php';
/**
* Class to manage contract numbering rules Olive
*/
class mod_contract_olive extends ModelNumRefContracts
{
var $nom='Olive'; // Nom du modele
var $code_modifiable = 1; // Code modifiable
var $code_modifiable_invalide = 1; // Code modifiable si il est invalide
var $code_modifiable_null = 1; // Code modifiables si il est null
var $code_null = 1; // Code facultatif
var $version='dolibarr'; // 'development', 'experimental', 'dolibarr'
var $code_auto = 0; // Numerotation automatique
/**
* Return description of module
*
* @return string Description of module
*/
function info()
{
global $langs;
$langs->load("companies");
return $langs->trans("LeopardNumRefModelDesc");
}
/**
* Return an example of result returned by getNextValue
*
* @param Societe $objsoc Object thirdparty
* @param Contrat $contract Object contract
* @return string Return next value
*/
function getNextValue($objsoc,$contract)
{
global $langs;
return '';
}
/**
* Check validity of code according to its rules
*
* @param DoliDB $db Database handler
* @param string &$code Code to check/correct
* @param Product $product Object product
* @param int $type 0 = product , 1 = service
* @return int 0 if OK
* -1 ErrorBadProductCodeSyntax
* -2 ErrorProductCodeRequired
* -3 ErrorProductCodeAlreadyUsed
* -4 ErrorPrefixRequired
*/
function verif($db, &$code, $product, $type)
{
global $conf;
$result=0;
$code = strtoupper(trim($code));
if (empty($code) && $this->code_null && empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED))
{
$result=0;
}
else if (empty($code) && (! $this->code_null || ! empty($conf->global->MAIN_CONTARCT_CODE_ALWAYS_REQUIRED)) )
{
$result=-2;
}
dol_syslog("mod_contract_olive::verif type=".$type." result=".$result);
return $result;
}
}

View File

@ -32,6 +32,7 @@ class mod_contract_serpis extends ModelNumRefContracts
var $prefix='CT';
var $error='';
var $nom='Serpis';
var $code_auto=1;
/**

View File

@ -173,9 +173,10 @@ class modAdherent extends DolibarrModules
$this->export_code[$r]=$this->rights_class.'_'.$r;
$this->export_label[$r]='MembersAndSubscriptions';
$this->export_permission[$r]=array(array("adherent","export"));
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'p.code'=>"CountryCode",'p.libelle'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
$this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'p.code'=>'Text','p.libelle'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'p.code'=>"member",'p.libelle'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
$this->export_fields_array[$r]=array('a.rowid'=>'Id','a.civility'=>"UserTitle",'a.lastname'=>"Lastname",'a.firstname'=>"Firstname",'a.login'=>"Login",'a.morphy'=>'Nature','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'d.nom'=>"State",'co.code'=>"CountryCode",'co.label'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datevalid'=>'DateValidation','a.tms'=>'DateLastModification','a.datefin'=>'DateEndSubscription','ta.rowid'=>'MemberTypeId','ta.libelle'=>'MemberTypeLabel','c.rowid'=>'SubscriptionId','c.dateadh'=>'DateSubscription','c.cotisation'=>'Amount');
$this->export_TypeFields_array[$r]=array('a.civility'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'d.nom'=>"Text",'co.code'=>'Text','co.label'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number');
$this->export_entities_array[$r]=array('a.rowid'=>'member','a.civility'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'d.nom'=>"member",'co.code'=>"member",'co.label'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription');
// Add extra fields
$sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'adherent' AND entity = ".$conf->entity;
$resql=$this->db->query($sql);
@ -192,7 +193,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.'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_pays as p ON a.country = p.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_country as co ON a.country = co.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

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",
'cac.libelle'=>"ActionType",
'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');
$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.durationp'=>"Duree",
'cac.libelle'=>"List:c_actioncomm:libelle:rowid",
'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');
$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",
'cac.libelle'=>"action",
'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',);
$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.'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.'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] .=' ORDER BY datep';

View File

@ -116,11 +116,11 @@ class modCategorie extends DolibarrModules
$this->export_icon[$r]='category';
$this->export_enabled[$r]='$conf->fournisseur->enabled';
$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_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_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_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",'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",'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_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] .=' AND u.entity = '.$conf->entity;
$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_enabled[$r]='$conf->societe->enabled';
$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_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_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_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",'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",'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",'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_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] .=' AND u.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' AND u.type = 2'; // Customer/Prospect categories
@ -188,7 +188,7 @@ class modCategorie extends DolibarrModules
'p.zip' => 'Zip',
'p.town' => 'Town',
'country.code' => 'CountryCode',
'country.libelle' => 'Country',
'country.label' => 'Country',
'p.birthday' => 'DateToBirth',
'p.poste' => 'PostOrFunction',
'p.phone' => 'Phone',
@ -218,7 +218,7 @@ class modCategorie extends DolibarrModules
'p.zip' => 'contact',
'p.town' => 'contact',
'country.code' => 'contact',
'country.libelle' => 'contact',
'country.label' => 'contact',
'p.birthday' => 'contact',
'p.poste' => 'contact',
'p.phone' => 'contact',
@ -231,7 +231,7 @@ class modCategorie extends DolibarrModules
); // We define here only fields that use another picto
$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] .= ' 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] .= ' 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_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_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_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.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_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_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.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.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.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_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] .=' 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] .=' 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';

View File

@ -216,15 +216,15 @@ class modExpedition extends DolibarrModules
$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_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_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.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_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.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.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_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_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] .=' 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';

View File

@ -219,7 +219,7 @@ class modFacture extends DolibarrModules
// End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT ';
$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] .=' 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';
@ -275,7 +275,7 @@ class modFacture extends DolibarrModules
// End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT ';
$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] .=' 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';

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_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_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.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_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_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
$this->export_sql_start[$r]='SELECT DISTINCT ';
$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] .=' 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';
@ -345,7 +345,7 @@ class modFournisseur extends DolibarrModules
// End add axtra fields
$this->export_sql_start[$r]='SELECT DISTINCT ';
$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] .=' 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';
@ -365,7 +365,7 @@ class modFournisseur extends DolibarrModules
$this->export_sql_start[$r]='SELECT DISTINCT ';
$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] .=' 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';

View File

@ -190,7 +190,7 @@ class modProjet extends DolibarrModules
$this->export_permission[$r]=array(array("projet","export"));
$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',
'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",

View File

@ -169,15 +169,15 @@ class modPropale extends DolibarrModules
$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_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_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.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_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_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','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','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','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_sql_start[$r]='SELECT DISTINCT ';
$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] .=' 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';

View File

@ -264,10 +264,10 @@ class modSociete extends DolibarrModules
$this->export_label[$r]='ExportDataset_company_1';
$this->export_icon[$r]='company';
$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",'c.label'=>"Country",'c.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';
//$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.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.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",'c.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",'c.label'=>"List:c_country:label:label",'c.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
// Add extra fields
$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] .=' 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_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_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';
@ -321,7 +321,7 @@ class modSociete extends DolibarrModules
$this->export_icon[$r]='contact';
$this->export_permission[$r]=array(array("societe","contact","export"));
$this->export_fields_array[$r]=array('c.rowid'=>"IdContact",'c.civility'=>"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_TypeFields_array[$r]=array('c.civility'=>"List:c_civility:label: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.civility'=>"List:c_civility:label: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
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] .=' 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_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] .=' 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_convertvalue_array[$r]=array(
'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.code_client'=>array('rule'=>'getcustomercodeifauto'),
'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_convertvalue_array[$r]=array(
'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_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(
'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_examplevalues_array[$r]=array('e.label'=>"ALM001",

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2010 Regis Houssin <regis.houssin@capnetworks.com>
/* Copyright (C) 2010-2014 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -226,10 +226,10 @@ function project_pdf_create($db, $object, $modele, $outputlangs, $hidedetails=0,
dol_meta_create($object);
// Appel des triggers
/*include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php';
$interface=new Interfaces($db);
$result=$interface->run_triggers('PROJECT_BUILDDOC',$object,$user,$langs,$conf);
if ($result < 0) { $error++; $this->errors=$interface->errors; }*/
if ($result < 0) { $error++; $this->errors=$interface->errors; }
// Fin appel triggers
return 1;

View File

@ -25,6 +25,9 @@ if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1;
if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
// If we force to use jmobile, then we reenable javascript
if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
$arrayofjs=array('/core/js/dst.js'.(empty($conf->dol_use_jmobile)?'':'?version='.urlencode(DOL_VERSION))); // Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
$titleofloginpage=$langs->trans('Login').' '.$title; // title is defined by dol_loginfunction in security2.lib.php
print top_htmlhead('',$titleofloginpage,0,0,$arrayofjs);
@ -212,7 +215,7 @@ if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file
<!-- authentication mode = <?php echo $main_authentication ?> -->
<!-- cookie name used for this session = <?php echo $session_name ?> -->
<!-- urlfrom in this session = <?php echo $_SESSION["urlfrom"] ?> -->
<!-- urlfrom in this session = <?php echo isset($_SESSION["urlfrom"])?$_SESSION["urlfrom"]:''; ?> -->
<!-- Common footer is not used for login page, this is same than footer but inside login tpl -->

View File

@ -22,6 +22,7 @@ $note_public = 'note_public';
$note_private = 'note_private';
$colwidth=(isset($colwidth)?$colwidth:25);
$permission=(isset($permission)?$permission:(isset($user->rights->$module->creer)?$user->rights->$module->creer:0)); // If already defined by caller page
$moreparam=(isset($moreparam)?$moreparam:'');
$value_public=$object->note_public;
@ -59,8 +60,9 @@ elseif ($module == 'contact') { $permission=$user->rights->societe->creer;}
elseif ($module == 'shipping') { $permission=$user->rights->expedition->creer;}
//else dol_print_error('','Bad value '.$module.' for param module');
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100';
if (! empty($conf->global->FCKEDITOR_ENABLE_SOCIETE)) $typeofdata='ckeditor:dolibarr_notes:100%:200::1:12:100'; // Rem: This var is for all notes, not only thirdparties note.
else $typeofdata='textarea:12:100';
?>
<!-- BEGIN PHP TEMPLATE NOTES -->

View File

@ -25,6 +25,9 @@ if (GETPOST('dol_optimize_smallscreen')) $conf->dol_optimize_smallscreen=1;
if (GETPOST('dol_no_mouse_hover')) $conf->dol_no_mouse_hover=1;
if (GETPOST('dol_use_jmobile')) $conf->dol_use_jmobile=1;
// If we force to use jmobile, then we reenable javascript
if (! empty($conf->dol_use_jmobile)) $conf->use_javascript_ajax=1;
print top_htmlhead('',$langs->trans('Login').' '.$title);
?>
<!-- BEGIN PHP TEMPLATE PASSWORDFORGOTTEN.TPL.PHP -->

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
/* Copyright (C) 2005-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2014 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -227,6 +227,7 @@ class InterfaceDemo extends DolibarrTriggers
case 'PROJECT_CREATE':
case 'PROJECT_MODIFY':
case 'PROJECT_DELETE':
case 'PROJECT_BUILDDOC':
// Project tasks
case 'TASK_CREATE':
@ -253,4 +254,4 @@ class InterfaceDemo extends DolibarrTriggers
return 0;
}
}
}

View File

@ -732,7 +732,7 @@ if ($step == 3 && $datatoexport)
// Filter value
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]);
if ($szInfoFiltre) // Is there an info help for this filter ?

View File

@ -463,31 +463,6 @@ class Fichinter extends CommonObject
}
}
/**
* Set intervetnion as billed
*
* @return int <0 si ko, >0 si ok
*/
function setBilled()
{
global $conf;
$sql = 'UPDATE '.MAIN_DB_PREFIX.'fichinter SET fk_statut = 2';
$sql.= ' WHERE rowid = '.$this->id;
$sql.= " AND entity = ".$conf->entity;
$sql.= " AND fk_statut = 1";
if ($this->db->query($sql) )
{
return 1;
}
else
{
dol_print_error($this->db);
return -1;
}
}
/**
* Returns the label status

View File

@ -471,7 +471,22 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
// Classify Billed
else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
{
$result=$object->setBilled();
$result=$object->setStatut(2);
if ($result > 0)
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
}
else
{
$mesg='<div class="error">'.$object->error.'</div>';
}
}
// Classify Billed
else if ($action == 'classifyunbilled' && $user->rights->ficheinter->creer)
{
$result=$object->setStatut(1);
if ($result > 0)
{
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
@ -485,7 +500,7 @@ else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
/*
* Mise a jour d'une ligne d'intervention
*/
*/
else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST('save','alpha') == $langs->trans("Save"))
{
$objectline = new FichinterLigne($db);
@ -1289,19 +1304,19 @@ else if ($id > 0 || ! empty($ref))
print $extrafields->showInputField($key,$value);
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print ' &nbsp; <input type="submit" class="button" value="'.$langs->trans('Modify').'">';
}
else
{
print $extrafields->showOutputField($key,$value);
if ($object->statut == 0 && $user->rights->ficheinter->creer) print '<a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
if ($object->statut == 0 && $user->rights->ficheinter->creer) print ' &nbsp; <a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras&attribute='.$key.'">'.img_picto('','edit').' '.$langs->trans('Modify').'</a>';
}
print '</td></tr>'."\n";
}
}
}
print "</table><br>";
print "</table>";
print '</form>';
@ -1319,196 +1334,199 @@ else if ($id > 0 || ! empty($ref))
include DOL_DOCUMENT_ROOT.'/core/tpl/bloc_showhide.tpl.php';
}
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($action == 'editline')
{
print '<input type="hidden" name="action" value="updateline">';
print '<input type="hidden" name="line_id" value="'.GETPOST('line_id','int').'">';
}
else
{
print '<input type="hidden" name="action" value="addline">';
}
// Intervention lines
$sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
$sql.= ' ft.date as date_intervention';
$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
$sql.= ' WHERE ft.fk_fichinter = '.$object->id;
$sql.= ' ORDER BY ft.rang ASC, ft.rowid';
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
if ($num)
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
print '<form action="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'" name="addinter" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
if ($action == 'editline')
{
print '<br>';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Description').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('Duration').'</td>';
print '<td width="48" colspan="3">&nbsp;</td>';
print "</tr>\n";
print '<input type="hidden" name="action" value="updateline">';
print '<input type="hidden" name="line_id" value="'.GETPOST('line_id','int').'">';
}
$var=true;
while ($i < $num)
else
{
$objp = $db->fetch_object($resql);
$var=!$var;
print '<input type="hidden" name="action" value="addline">';
}
// Ligne en mode visu
if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid)
// Intervention lines
$sql = 'SELECT ft.rowid, ft.description, ft.fk_fichinter, ft.duree, ft.rang,';
$sql.= ' ft.date as date_intervention';
$sql.= ' FROM '.MAIN_DB_PREFIX.'fichinterdet as ft';
$sql.= ' WHERE ft.fk_fichinter = '.$object->id;
$sql.= ' ORDER BY ft.rang ASC, ft.rowid';
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
if ($num)
{
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
print dol_htmlentitiesbr($objp->description);
print '<br>';
print '<table class="noborder" width="100%">';
// Date
print '<td align="center" width="150">'.dol_print_date($db->jdate($objp->date_intervention),'dayhour').'</td>';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Description').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('Duration').'</td>';
print '<td width="48" colspan="3">&nbsp;</td>';
print "</tr>\n";
}
$var=true;
while ($i < $num)
{
$objp = $db->fetch_object($resql);
$var=!$var;
// Duration
print '<td align="right" width="150">'.convertSecondToTime($objp->duree).'</td>';
print "</td>\n";
// Icone d'edition et suppression
if ($object->statut == 0 && $user->rights->ficheinter->creer)
// Ligne en mode visu
if ($action != 'editline' || GETPOST('line_id','int') != $objp->rowid)
{
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;line_id='.$objp->rowid.'#'.$objp->rowid.'">';
print img_edit();
print '</a>';
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=ask_deleteline&amp;line_id='.$objp->rowid.'">';
print img_delete();
print '</a></td>';
if ($num > 1)
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
print dol_htmlentitiesbr($objp->description);
// Date
print '<td align="center" width="150">'.dol_print_date($db->jdate($objp->date_intervention),'dayhour').'</td>';
// Duration
print '<td align="right" width="150">'.convertSecondToTime($objp->duree).'</td>';
print "</td>\n";
// Icone d'edition et suppression
if ($object->statut == 0 && $user->rights->ficheinter->creer)
{
print '<td align="center">';
if ($i > 0)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=up&amp;line_id='.$objp->rowid.'">';
print img_up();
print '</a>';
}
if ($i < $num-1)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=down&amp;line_id='.$objp->rowid.'">';
print img_down();
print '</a>';
}
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=editline&amp;line_id='.$objp->rowid.'#'.$objp->rowid.'">';
print img_edit();
print '</a>';
print '</td>';
print '<td align="center">';
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=ask_deleteline&amp;line_id='.$objp->rowid.'">';
print img_delete();
print '</a></td>';
if ($num > 1)
{
print '<td align="center">';
if ($i > 0)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=up&amp;line_id='.$objp->rowid.'">';
print img_up();
print '</a>';
}
if ($i < $num-1)
{
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=down&amp;line_id='.$objp->rowid.'">';
print img_down();
print '</a>';
}
print '</td>';
}
}
}
else
{
print '<td colspan="3">&nbsp;</td>';
else
{
print '<td colspan="3">&nbsp;</td>';
}
print '</tr>';
}
print '</tr>';
// Line in update mode
if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && GETPOST('line_id','int') == $objp->rowid)
{
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
// Editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('np_desc',$objp->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70);
$doleditor->Create();
print '</td>';
// Date d'intervention
print '<td align="center" class="nowrap">';
$form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
print '</td>';
// Duration
print '<td align="right">';
$form->select_duration('duration',$objp->duree);
print '</td>';
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
print '</tr>' . "\n";
}
$i++;
}
// Line in update mode
if ($object->statut == 0 && $action == 'editline' && $user->rights->ficheinter->creer && GETPOST('line_id','int') == $objp->rowid)
{
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a name="'.$objp->rowid.'"></a>'; // ancre pour retourner sur la ligne
$db->free($resql);
// Editeur wysiwyg
// Add new line
if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
if (! $num) print '<br><table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>';
print '<a name="add"></a>'; // ancre
print $langs->trans('Description').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('Duration').'</td>';
print '<td colspan="4">&nbsp;</td>';
print "</tr>\n";
$var=false;
print '<tr '.$bc[$var].">\n";
print '<td>';
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('np_desc',$objp->description,'',164,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70);
$doleditor=new DolEditor('np_desc',GETPOST('np_desc','alpha'),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70);
$doleditor->Create();
print '</td>';
// Date d'intervention
// Date intervention
print '<td align="center" class="nowrap">';
$form->select_date($db->jdate($objp->date_intervention),'di',1,1,0,"date_intervention");
$now=dol_now();
$timearray=dol_getdate($now);
if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
$form->select_date($timewithnohour,'di',1,1,0,"addinter");
print '</td>';
// Duration
print '<td align="right">';
$form->select_duration('duration',$objp->duree);
$selectmode='select';
if (! empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) $selectmode='text';
$form->select_duration('duration', (!GETPOST('durationhour','int') && !GETPOST('durationmin','int'))?3600:(60*60*GETPOST('durationhour','int')+60*GETPOST('durationmin','int')), 0, $selectmode, 1);
print '</td>';
print '<td align="center" colspan="5" valign="center"><input type="submit" class="button" name="save" value="'.$langs->trans("Save").'">';
print '<br><input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td>';
print '</tr>' . "\n";
print '<td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
print '</tr>';
if (! $num) print '</table>';
}
$i++;
if ($num) print '</table>';
}
$db->free($resql);
// Add new line
if ($object->statut == 0 && $user->rights->ficheinter->creer && $action <> 'editline' && empty($conf->global->FICHINTER_DISABLE_DETAILS))
else
{
if (! $num) print '<br><table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>';
print '<a name="add"></a>'; // ancre
print $langs->trans('Description').'</td>';
print '<td align="center">'.$langs->trans('Date').'</td>';
print '<td align="right">'.$langs->trans('Duration').'</td>';
print '<td colspan="4">&nbsp;</td>';
print "</tr>\n";
$var=false;
print '<tr '.$bc[$var].">\n";
print '<td>';
// editeur wysiwyg
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
$doleditor=new DolEditor('np_desc',GETPOST('np_desc','alpha'),'',100,'dolibarr_details','',false,true,$conf->global->FCKEDITOR_ENABLE_DETAILS,ROWS_2,70);
$doleditor->Create();
print '</td>';
// Date intervention
print '<td align="center" class="nowrap">';
$now=dol_now();
$timearray=dol_getdate($now);
if (! GETPOST('diday','int')) $timewithnohour=dol_mktime(0,0,0,$timearray['mon'],$timearray['mday'],$timearray['year']);
else $timewithnohour=dol_mktime(GETPOST('dihour','int'),GETPOST('dimin','int'), 0,GETPOST('dimonth','int'),GETPOST('diday','int'),GETPOST('diyear','int'));
$form->select_date($timewithnohour,'di',1,1,0,"addinter");
print '</td>';
// Duration
print '<td align="right">';
$selectmode='select';
if (! empty($conf->global->INTERVENTION_ADDLINE_FREEDUREATION)) $selectmode='text';
$form->select_duration('duration', (!GETPOST('durationhour','int') && !GETPOST('durationmin','int'))?3600:(60*60*GETPOST('durationhour','int')+60*GETPOST('durationmin','int')), 0, $selectmode, 1);
print '</td>';
print '<td align="center" valign="middle" colspan="4"><input type="submit" class="button" value="'.$langs->trans('Add').'" name="addline"></td>';
print '</tr>';
if (! $num) print '</table>';
dol_print_error($db);
}
if ($num) print '</table>';
}
else
{
dol_print_error($db);
}
print '</form>'."\n";
}
print '</form>'."\n";
dol_fiche_end();
print '</div>';
print "\n";
@ -1529,7 +1547,7 @@ else if ($id > 0 || ! empty($ref))
}
// Modify
if ($object->statut == 1 && $user->rights->ficheinter->creer)
if ($object->statut == 1 && $user->rights->ficheinter->creer && empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
print '<div class="inline-block divButAction"><a class="butAction" href="fiche.php?id='.$object->id.'&action=modify"';
print '>'.$langs->trans("Modify").'</a></div>';
@ -1572,6 +1590,10 @@ else if ($id > 0 || ! empty($ref))
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifybilled">'.$langs->trans("ClassifyBilled").'</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=classifyunbilled">'.$langs->trans("ClassifyUnBilled").'</a></div>';
}
}
}

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2002-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
@ -108,8 +108,11 @@ if ($result)
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$urlparam,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Description"),$_SERVER["PHP_SELF"],"f.description","",$urlparam,'',$sortfield,$sortorder);
print_liste_field_titre('',$_SERVER["PHP_SELF"],'');
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fd.date","",$urlparam,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"fd.date","",$urlparam,'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Duration"),$_SERVER["PHP_SELF"],"fd.duree","",$urlparam,'align="right"',$sortfield,$sortorder);
}
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"f.fk_statut","",$urlparam,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
@ -122,8 +125,11 @@ if ($result)
print '<input type="text" class="flat" name="search_desc" value="'.$search_desc.'" size="12">';
print '</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
}
print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'"></td>';
print "</tr>\n";
@ -150,8 +156,11 @@ if ($result)
print '</td>';
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->description,20)).'</td>';
print '<td>'.dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail,20)).'</td>';
print '<td align="center">'.dol_print_date($db->jdate($objp->dp),'dayhour')."</td>\n";
print '<td align="right">'.convertSecondToTime($objp->duree).'</td>';
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
print '<td align="center">'.dol_print_date($db->jdate($objp->dp),'dayhour')."</td>\n";
print '<td align="right">'.convertSecondToTime($objp->duree).'</td>';
}
print '<td align="right">'.$interventionstatic->LibStatut($objp->fk_statut,5).'</td>';
print "</tr>\n";
@ -159,9 +168,13 @@ if ($result)
$total += $objp->duree;
$i++;
}
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td>&nbsp;</td>';
print '</tr>';
$rowspan=3;
if (empty($conf->global->FICHINTER_DISABLE_DETAILS))
{
print '<tr class="liste_total"><td colspan="5" class="liste_total">'.$langs->trans("Total").'</td>';
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total).'</td><td>&nbsp;</td>';
print '</tr>';
}
print '</table>';
print "</form>\n";

View File

@ -263,9 +263,9 @@ class ProductFournisseur extends Product
$error++;
}
/*if (! $error)
if (! $error && !empty($cong->global->PRODUCT_PRICE_SUPPLIER_NO_LOG))
{
// Ajoute modif dans table log
// Add record into log table
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price_log(";
$sql.= "datec, fk_product_fournisseur,fk_user,price,quantity)";
$sql.= "values('".$this->db->idate($now)."',";
@ -281,7 +281,7 @@ class ProductFournisseur extends Product
$error++;
}
}
*/
if (! $error)
{

View File

@ -203,7 +203,7 @@ class PaiementFourn extends Paiement
{
// Call trigger
$result=$this->call_trigger('PAYMENT_SUPPLIER_CREATE',$user);
if ($result < 0) $error++;
if ($result < 0) $error++;
// End call triggers
}
}
@ -255,7 +255,7 @@ class PaiementFourn extends Paiement
{
if (count($billsarray))
{
$this->error='Can\'t delete a payment shared by at least one invoice with status payed';
$this->error="ErrorCantDeletePaymentSharedWithPayedInvoice";
$this->db->rollback();
return -1;
}
@ -274,7 +274,7 @@ class PaiementFourn extends Paiement
$accline->fetch($bank_line_id);
if ($accline->rappro)
{
$this->error='Impossible de supprimer un paiement qui a genere une ecriture qui a ete rapprochee';
$this->error="ErrorCantDeletePaymentReconciliated";
$this->db->rollback();
return -3;
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -328,9 +329,19 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
{
$i = 0;
print '<br>';
print $langs->trans('Invoices').'<br>';
print '<table class="noborder" width="100%">';
if(!empty($conf->global->FAC_AUTO_FILLJS)){
//Add js for AutoFill
print "\n".'<script type="text/javascript" language="javascript">';
print ' $(document).ready(function () {';
print ' $(".AutoFillAmout").on(\'click touchstart\', function(){
$("input[name="+$(this).data(\'rowname\')+"]").val($(this).data("value"));
});';
print ' });'."\n";
print ' </script>'."\n";
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans('Ref').'</td>';
print '<td>'.$langs->trans('RefSupplier').'</td>';
@ -370,8 +381,10 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td align="right">'.price($objp->total_ttc - $objp->am).'</td>';
print '<td align="center">';
$namef = 'amount_'.$objp->facid;
if(!empty($conf->global->FAC_AUTO_FILLJS))
print img_picto("Auto fill",'rightarrow', "class='AutoFillAmout' data-rowname='".$namef."' data-value='".($objp->total_ttc - $objp->am)."'");
print '<input type="text" size="8" name="'.$namef.'" value="'.GETPOST($namef).'">';
print "</td></tr>\n";
print "</td></tr>\n";
$total+=$objp->total_ht;
$total_ttc+=$objp->total_ttc;
$totalrecu+=$objp->am;
@ -468,7 +481,7 @@ if (empty($action))
{
$sql .= ' AND p.rowid='.$db->escape($search_ref);
}
if (! empty($search_account))
if (! empty($search_account) && $search_account > 0)
{
$sql .= ' AND b.fk_account='.$db->escape($search_account);
}

View File

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

View File

@ -1,272 +0,0 @@
-- Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
-- Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
-- Copyright (C) 2004 Guillaume Delecourt <guillaume.delecourt@opensides.be>
-- Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
--
-- Do not add comment at end of line. This file is parsed by install and -- are removed
--
-- Countries
--
-- delete from llx_c_pays;
INSERT INTO llx_c_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,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_pays (rowid,code,code_iso,libelle,active) VALUES (247,'BU', null, 'Burundi',1);

View File

@ -32,242 +32,243 @@
-- Regions
--
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (0,0,0,'0',0,'-');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 0, 0, '0',0,'-');
-- Regions France (id country=1)
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 101, 1, 1,'97105',3,'Guadeloupe');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 102, 1, 2,'97209',3,'Martinique');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 103, 1, 3,'97302',3,'Guyane');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 104, 1, 4,'97411',3,'Réunion');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 105, 1, 11,'75056',1,'Île-de-France');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 106, 1, 21,'51108',0,'Champagne-Ardenne');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 107, 1, 22,'80021',0,'Picardie');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 108, 1, 23,'76540',0,'Haute-Normandie');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 109, 1, 24,'45234',2,'Centre');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 110, 1, 25,'14118',0,'Basse-Normandie');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 111, 1, 26,'21231',0,'Bourgogne');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 112, 1, 31,'59350',2,'Nord-Pas-de-Calais');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 113, 1, 41,'57463',0,'Lorraine');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 114, 1, 42,'67482',1,'Alsace');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 115, 1, 43,'25056',0,'Franche-Comté');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 116, 1, 52,'44109',4,'Pays de la Loire');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 117, 1, 53,'35238',0,'Bretagne');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 118, 1, 54,'86194',2,'Poitou-Charentes');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 119, 1, 72,'33063',1,'Aquitaine');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 120, 1, 73,'31555',0,'Midi-Pyrénées');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 121, 1, 74,'87085',2,'Limousin');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 122, 1, 82,'69123',2,'Rhône-Alpes');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 123, 1, 83,'63113',1,'Auvergne');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 124, 1, 91,'34172',2,'Languedoc-Roussillon');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 125, 1, 93,'13055',0,'Provence-Alpes-Côte d''Azur');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 126, 1, 94,'2A004',0,'Corse');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 1,'97105',3,'Guadeloupe');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 2,'97209',3,'Martinique');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 3,'97302',3,'Guyane');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 4,'97411',3,'Réunion');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 6,'',3,'Mayotte');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 11,'75056',1,'Île-de-France');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 21,'51108',0,'Champagne-Ardenne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 22,'80021',0,'Picardie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 23,'76540',0,'Haute-Normandie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 24,'45234',2,'Centre');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 25,'14118',0,'Basse-Normandie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 26,'21231',0,'Bourgogne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 31,'59350',2,'Nord-Pas-de-Calais');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 41,'57463',0,'Lorraine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 42,'67482',1,'Alsace');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 43,'25056',0,'Franche-Comté');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 52,'44109',4,'Pays de la Loire');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 53,'35238',0,'Bretagne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 54,'86194',2,'Poitou-Charentes');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 72,'33063',1,'Aquitaine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 73,'31555',0,'Midi-Pyrénées');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 74,'87085',2,'Limousin');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 82,'69123',2,'Rhône-Alpes');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 83,'63113',1,'Auvergne');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 91,'34172',2,'Languedoc-Roussillon');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 93,'13055',0,'Provence-Alpes-Côte d''Azur');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 1, 94,'2A004',0,'Corse');
-- Regions Belgium (id country=2)
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 201, 2, 201, '',1,'Flandre');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 202, 2, 202, '',2,'Wallonie');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values ( 203, 2, 203, '',3,'Bruxelles-Capitale');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 2, 201, '',1,'Flandre');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 2, 202, '',2,'Wallonie');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 2, 203, '',3,'Bruxelles-Capitale');
-- Regions Italy (id country=3)
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (301, 3, 301, NULL, 1, 'Abruzzo');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (302, 3, 302, NULL, 1, 'Basilicata');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (303, 3, 303, NULL, 1, 'Calabria');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (304, 3, 304, NULL, 1, 'Campania');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (305, 3, 305, NULL, 1, 'Emilia-Romagna');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (306, 3, 306, NULL, 1, 'Friuli-Venezia Giulia');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (307, 3, 307, NULL, 1, 'Lazio');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (308, 3, 308, NULL, 1, 'Liguria');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (309, 3, 309, NULL, 1, 'Lombardia');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (310, 3, 310, NULL, 1, 'Marche');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (311, 3, 311, NULL, 1, 'Molise');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (312, 3, 312, NULL, 1, 'Piemonte');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (313, 3, 313, NULL, 1, 'Puglia');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (314, 3, 314, NULL, 1, 'Sardegna');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (315, 3, 315, NULL, 1, 'Sicilia');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (316, 3, 316, NULL, 1, 'Toscana');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (317, 3, 317, NULL, 1, 'Trentino-Alto Adige');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (318, 3, 318, NULL, 1, 'Umbria');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (319, 3, 319, NULL, 1, 'Valle d Aosta');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (320, 3, 320, NULL, 1, 'Veneto');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 301, NULL, 1, 'Abruzzo');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 302, NULL, 1, 'Basilicata');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 303, NULL, 1, 'Calabria');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 304, NULL, 1, 'Campania');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 305, NULL, 1, 'Emilia-Romagna');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 306, NULL, 1, 'Friuli-Venezia Giulia');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 307, NULL, 1, 'Lazio');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 308, NULL, 1, 'Liguria');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 309, NULL, 1, 'Lombardia');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 310, NULL, 1, 'Marche');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 311, NULL, 1, 'Molise');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 312, NULL, 1, 'Piemonte');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 313, NULL, 1, 'Puglia');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 314, NULL, 1, 'Sardegna');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 315, NULL, 1, 'Sicilia');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 316, NULL, 1, 'Toscana');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 317, NULL, 1, 'Trentino-Alto Adige');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 318, NULL, 1, 'Umbria');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 319, NULL, 1, 'Valle d Aosta');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values ( 3, 320, NULL, 1, 'Veneto');
-- Regions Spain (id country=4)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (401, 4, 401, '', 0, 'Andalucia', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (402, 4, 402, '', 0, 'Aragón', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (403, 4, 403, '', 0, 'Castilla y León', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (404, 4, 404, '', 0, 'Castilla la Mancha', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (405, 4, 405, '', 0, 'Canarias', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (406, 4, 406, '', 0, 'Cataluña', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (407, 4, 407, '', 0, 'Comunidad de Ceuta', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (408, 4, 408, '', 0, 'Comunidad Foral de Navarra', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (409, 4, 409, '', 0, 'Comunidad de Melilla', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (410, 4, 410, '', 0, 'Cantabria', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (411, 4, 411, '', 0, 'Comunidad Valenciana', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (412, 4, 412, '', 0, 'Extemadura', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (413, 4, 413, '', 0, 'Galicia', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (414, 4, 414, '', 0, 'Islas Baleares', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (415, 4, 415, '', 0, 'La Rioja', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (416, 4, 416, '', 0, 'Comunidad de Madrid', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (417, 4, 417, '', 0, 'Región de Murcia', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (418, 4, 418, '', 0, 'Principado de Asturias', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (419, 4, 419, '', 0, 'Pais Vasco', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (420, 4, 420, '', 0, 'Otros', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 401, '', 0, 'Andalucia', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 402, '', 0, 'Aragón', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 403, '', 0, 'Castilla y León', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 404, '', 0, 'Castilla la Mancha', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 405, '', 0, 'Canarias', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 406, '', 0, 'Cataluña', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 407, '', 0, 'Comunidad de Ceuta', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 408, '', 0, 'Comunidad Foral de Navarra', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 409, '', 0, 'Comunidad de Melilla', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 410, '', 0, 'Cantabria', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 411, '', 0, 'Comunidad Valenciana', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 412, '', 0, 'Extemadura', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 413, '', 0, 'Galicia', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 414, '', 0, 'Islas Baleares', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 415, '', 0, 'La Rioja', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 416, '', 0, 'Comunidad de Madrid', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 417, '', 0, 'Región de Murcia', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 418, '', 0, 'Principado de Asturias', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 419, '', 0, 'Pais Vasco', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 4, 420, '', 0, 'Otros', 1);
-- Regions Germany (id country=5)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (501, 5, 501, '', 0, 'Deutschland', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 5, 501, '', 0, 'Deutschland', 1);
-- Regions Greece (id_country=102)
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10201, 10201, 102, NULL, NULL, 'Αττική', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10202, 10202, 102, NULL, NULL, 'Στερεά Ελλάδα', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10203, 10203, 102, NULL, NULL, 'Κεντρική Μακεδονία', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10204, 10204, 102, NULL, NULL, 'Κρήτη', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10205, 10205, 102, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10206, 10206, 102, NULL, NULL, 'Ήπειρος', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10207, 10207, 102, NULL, NULL, 'Ιόνια νησιά', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10208, 10208, 102, NULL, NULL, 'Βόρειο Αιγαίο', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10209, 10209, 102, NULL, NULL, 'Πελοπόννησος', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10210, 10210, 102, NULL, NULL, 'Νότιο Αιγαίο', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10211, 10211, 102, NULL, NULL, 'Δυτική Ελλάδα', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10212, 10212, 102, NULL, NULL, 'Θεσσαλία', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (10213, 10213, 102, NULL, NULL, 'Δυτική Μακεδονία', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10201, 102, NULL, NULL, 'Αττική', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10202, 102, NULL, NULL, 'Στερεά Ελλάδα', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10203, 102, NULL, NULL, 'Κεντρική Μακεδονία', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10204, 102, NULL, NULL, 'Κρήτη', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10205, 102, NULL, NULL, 'Ανατολική Μακεδονία και Θράκη', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10206, 102, NULL, NULL, 'Ήπειρος', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10207, 102, NULL, NULL, 'Ιόνια νησιά', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10208, 102, NULL, NULL, 'Βόρειο Αιγαίο', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10209, 102, NULL, NULL, 'Πελοπόννησος', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10210, 102, NULL, NULL, 'Νότιο Αιγαίο', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10211, 102, NULL, NULL, 'Δυτική Ελλάδα', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10212, 102, NULL, NULL, 'Θεσσαλία', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 10213, 102, NULL, NULL, 'Δυτική Μακεδονία', 1);
-- Regions Switzerland (id country=6)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (601, 6, 601, '', 1, 'Cantons', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 6, 601, '', 1, 'Cantons', 1);
-- Regions England (id_country=7)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (701, 7, 701, '', 0, 'England', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (702, 7, 702, '', 0, 'Wales', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (703, 7, 703, '', 0, 'Scotland', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (704, 7, 704, '', 0, 'Northern Ireland', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 701, '', 0, 'England', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 702, '', 0, 'Wales', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 703, '', 0, 'Scotland', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 7, 704, '', 0, 'Northern Ireland', 1);
-- Regions Tunisia (id country=10)
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1001,10,1001, '',0,'Ariana');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1002,10,1002, '',0,'Béja');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1003,10,1003, '',0,'Ben Arous');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1004,10,1004, '',0,'Bizerte');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1005,10,1005, '',0,'Gabès');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1006,10,1006, '',0,'Gafsa');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1007,10,1007, '',0,'Jendouba');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1008,10,1008, '',0,'Kairouan');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1009,10,1009, '',0,'Kasserine');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1010,10,1010, '',0,'Kébili');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1011,10,1011, '',0,'La Manouba');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1012,10,1012, '',0,'Le Kef');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1013,10,1013, '',0,'Mahdia');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1014,10,1014, '',0,'Médenine');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1015,10,1015, '',0,'Monastir');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1016,10,1016, '',0,'Nabeul');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1017,10,1017, '',0,'Sfax');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1018,10,1018, '',0,'Sidi Bouzid');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1019,10,1019, '',0,'Siliana');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1020,10,1020, '',0,'Sousse');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1021,10,1021, '',0,'Tataouine');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1022,10,1022, '',0,'Tozeur');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1023,10,1023, '',0,'Tunis');
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (1024,10,1024, '',0,'Zaghouan');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1001, '',0,'Ariana');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1002, '',0,'Béja');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1003, '',0,'Ben Arous');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1004, '',0,'Bizerte');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1005, '',0,'Gabès');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1006, '',0,'Gafsa');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1007, '',0,'Jendouba');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1008, '',0,'Kairouan');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1009, '',0,'Kasserine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1010, '',0,'Kébili');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1011, '',0,'La Manouba');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1012, '',0,'Le Kef');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1013, '',0,'Mahdia');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1014, '',0,'Médenine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1015, '',0,'Monastir');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1016, '',0,'Nabeul');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1017, '',0,'Sfax');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1018, '',0,'Sidi Bouzid');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1019, '',0,'Siliana');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1020, '',0,'Sousse');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1021, '',0,'Tataouine');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1022, '',0,'Tozeur');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1023, '',0,'Tunis');
insert into llx_c_regions (fk_pays,code_region,cheflieu,tncc,nom) values (10,1024, '',0,'Zaghouan');
-- Region US (id country=11)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1101, 11, 1101, '', 0, 'United-States', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 11, 1101, '', 0, 'United-States', 1);
-- Region Canada (id country=14)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1401, 14, 1401, '', 0, 'Canada', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 14, 1401, '', 0, 'Canada', 1);
-- Regions The Netherlands (id country=17)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1701, 17, 1701, '', 0,'Provincies van Nederland ', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 17, 1701, '', 0,'Provincies van Nederland ', 1);
-- Regions Argentina (id country=23)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2301, 23, 2301, '', 0, 'Norte', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2302, 23, 2302, '', 0, 'Litoral', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2303, 23, 2303, '', 0, 'Cuyana', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2304, 23, 2304, '', 0, 'Central', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2305, 23, 2305, '', 0, 'Patagonia', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2301, '', 0, 'Norte', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2302, '', 0, 'Litoral', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2303, '', 0, 'Cuyana', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2304, '', 0, 'Central', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 23, 2305, '', 0, 'Patagonia', 1);
-- Regions Australia (id country=28)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2801, 28, 2801, '', 0, 'Australia', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 28, 2801, '', 0, 'Australia', 1);
-- Regions Brazil (id country=56)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (5601, 56, 5601, '', 0, 'Brasil', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 56, 5601, '', 0, 'Brasil', 1);
-- Regions Colombie (id country=70)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (7001, 70, 7001, '', 0, 'Colombie', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 70, 7001, '', 0, 'Colombie', 1);
-- Regions Chile (id country=67)
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6701, 6701, 67, NULL, NULL, 'Tarapacá', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6702, 6702, 67, NULL, NULL, 'Antofagasta', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6703, 6703, 67, NULL, NULL, 'Atacama', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6704, 6704, 67, NULL, NULL, 'Coquimbo', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6705, 6705, 67, NULL, NULL, 'Valparaíso', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6706, 6706, 67, NULL, NULL, 'General Bernardo O Higgins', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6707, 6707, 67, NULL, NULL, 'Maule', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6708, 6708, 67, NULL, NULL, 'Biobío', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6709, 6709, 67, NULL, NULL, 'Raucanía', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6710, 6710, 67, NULL, NULL, 'Los Lagos', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6711, 6711, 67, NULL, NULL, 'Aysén General Carlos Ibáñez del Campo', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6712, 6712, 67, NULL, NULL, 'Magallanes y Antártica Chilena', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6713, 6713, 67, NULL, NULL, 'Metropolitana de Santiago', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6714, 6714, 67, NULL, NULL, 'Los Ríos', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (6715, 6715, 67, NULL, NULL, 'Arica y Parinacota', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6701, 67, NULL, NULL, 'Tarapacá', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6702, 67, NULL, NULL, 'Antofagasta', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6703, 67, NULL, NULL, 'Atacama', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6704, 67, NULL, NULL, 'Coquimbo', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6705, 67, NULL, NULL, 'Valparaíso', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6706, 67, NULL, NULL, 'General Bernardo O Higgins', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6707, 67, NULL, NULL, 'Maule', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6708, 67, NULL, NULL, 'Biobío', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6709, 67, NULL, NULL, 'Raucanía', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6710, 67, NULL, NULL, 'Los Lagos', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6711, 67, NULL, NULL, 'Aysén General Carlos Ibáñez del Campo', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6712, 67, NULL, NULL, 'Magallanes y Antártica Chilena', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6713, 67, NULL, NULL, 'Metropolitana de Santiago', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6714, 67, NULL, NULL, 'Los Ríos', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 6715, 67, NULL, NULL, 'Arica y Parinacota', 1);
-- Regions San Salvador (id country=86)
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (8601, 8601, 86, NULL, NULL, 'Central', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (8602, 8602, 86, NULL, NULL, 'Oriental', 1);
INSERT INTO llx_c_regions (rowid, code_region, fk_pays, cheflieu, tncc, nom, active) VALUES (8603, 8603, 86, NULL, NULL, 'Occidental', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8601, 86, NULL, NULL, 'Central', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8602, 86, NULL, NULL, 'Oriental', 1);
INSERT INTO llx_c_regions ( code_region, fk_pays, cheflieu, tncc, nom, active) values ( 8603, 86, NULL, NULL, 'Occidental', 1);
-- Regions Honduras (id country=114)
insert into llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) values (11401, 114, 11401, '', 0, 'Honduras', 1);
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 114, 11401, '', 0, 'Honduras', 1);
-- Regions India (id country=117)
insert into llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) values (11701, 117, 11701, '', 0, 'India', 1);
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 117, 11701, '', 0, 'India', 1);
-- Regions Mauritius (id country=152)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15201, 152, 15201, '', 0, 'Rivière Noire', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15202, 152, 15202, '', 0, 'Flacq', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15203, 152, 15203, '', 0, 'Grand Port', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15204, 152, 15204, '', 0, 'Moka', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15205, 152, 15205, '', 0, 'Pamplemousses', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15206, 152, 15206, '', 0, 'Plaines Wilhems', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15207, 152, 15207, '', 0, 'Port-Louis', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15208, 152, 15208, '', 0, 'Rivière du Rempart', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15209, 152, 15209, '', 0, 'Savanne', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15210, 152, 15210, '', 0, 'Rodrigues', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15211, 152, 15211, '', 0, 'Les îles Agaléga', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15212, 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15201, '', 0, 'Rivière Noire', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15202, '', 0, 'Flacq', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15203, '', 0, 'Grand Port', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15204, '', 0, 'Moka', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15205, '', 0, 'Pamplemousses', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15206, '', 0, 'Plaines Wilhems', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15207, '', 0, 'Port-Louis', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15208, '', 0, 'Rivière du Rempart', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15209, '', 0, 'Savanne', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15210, '', 0, 'Rodrigues', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15211, '', 0, 'Les îles Agaléga', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1);
-- Regions Mexique (id country=154)
insert into llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) values (15401, 154, 15401, '', 0, 'Mexique', 1);
insert into llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 154, 15401, '', 0, 'Mexique', 1);
-- Regions Barbados (id country=46)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (4601, 46, 4601, '', 0, 'Barbados', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 46, 4601, '', 0, 'Barbados', 1);
-- Regions Venezuela (id country=232)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23201, 232, 23201, '', 0, 'Los Andes', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23202, 232, 23202, '', 0, 'Capital', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23203, 232, 23203, '', 0, 'Central', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23204, 232, 23204, '', 0, 'Cento Occidental', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23205, 232, 23205, '', 0, 'Guayana', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23206, 232, 23206, '', 0, 'Insular', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23207, 232, 23207, '', 0, 'Los Llanos', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23208, 232, 23208, '', 0, 'Nor-Oriental', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (23209, 232, 23209, '', 0, 'Zuliana', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23201, '', 0, 'Los Andes', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23202, '', 0, 'Capital', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23203, '', 0, 'Central', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23204, '', 0, 'Cento Occidental', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23205, '', 0, 'Guayana', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23206, '', 0, 'Insular', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23207, '', 0, 'Los Llanos', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23208, '', 0, 'Nor-Oriental', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 232, 23209, '', 0, 'Zuliana', 1);
-- Regions Algeria (id country=13)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1301, 13, 1301, '', 0, 'Algerie', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 13, 1301, '', 0, 'Algerie', 1);
-- Regions Maroc (id country=12)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1201, 12, 1201, '', 0, 'Tanger-Tétouan', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1202, 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1203, 12, 1203, '', 0, 'Taza-Al Hoceima-Taounate', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1204, 12, 1204, '', 0, 'L''Oriental', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1205, 12, 1205, '', 0, 'Fès-Boulemane', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1206, 12, 1206, '', 0, 'Meknès-Tafialet', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1207, 12, 1207, '', 0, 'Rabat-Salé-Zemour-Zaër', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1208, 12, 1208, '', 0, 'Grand Cassablanca', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1209, 12, 1209, '', 0, 'Chaouia-Ouardigha', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1210, 12, 1210, '', 0, 'Doukahla-Adba', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1211, 12, 1211, '', 0, 'Marrakech-Tensift-Al Haouz', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1212, 12, 1212, '', 0, 'Tadla-Azilal', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1213, 12, 1213, '', 0, 'Sous-Massa-Drâa', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1214, 12, 1214, '', 0, 'Guelmim-Es Smara', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1215, 12, 1215, '', 0, 'Laâyoune-Boujdour-Sakia el Hamra', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1216, 12, 1216, '', 0, 'Oued Ed-Dahab Lagouira', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1201, '', 0, 'Tanger-Tétouan', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1202, '', 0, 'Gharb-Chrarda-Beni Hssen', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1203, '', 0, 'Taza-Al Hoceima-Taounate', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1204, '', 0, 'L''Oriental', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1205, '', 0, 'Fès-Boulemane', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1206, '', 0, 'Meknès-Tafialet', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1207, '', 0, 'Rabat-Salé-Zemour-Zaër', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1208, '', 0, 'Grand Cassablanca', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1209, '', 0, 'Chaouia-Ouardigha', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1210, '', 0, 'Doukahla-Adba', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1211, '', 0, 'Marrakech-Tensift-Al Haouz', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1212, '', 0, 'Tadla-Azilal', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1213, '', 0, 'Sous-Massa-Drâa', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1214, '', 0, 'Guelmim-Es Smara', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1215, '', 0, 'Laâyoune-Boujdour-Sakia el Hamra', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 12, 1216, '', 0, 'Oued Ed-Dahab Lagouira', 1);
-- Regions Tunisia (id country=10)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES(1001, 10, 1001, '', 0, 'Algerie', 1);
INSERT INTO llx_c_regions (fk_pays, code_region, cheflieu, tncc, nom, active) values ( 10, 1001, '', 0, 'Algerie', 1);

View File

@ -32,7 +32,7 @@
-- Departements/Cantons/Provinces
--
insert into llx_c_departements (rowid, fk_region, code_departement,cheflieu,tncc,ncc,nom) values (0,0,'0','0',0,'-','-');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 0, '0', '0',0,'-','-');
-- Departements France (id country=1)
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (82,'01','01053',5,'AIN','Ain');

View File

@ -124,10 +124,17 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 3
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 34, 3, '0','0','VAT Rate 0',1);
-- INDIA (id country=117)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1171, 117, '12.5','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1172, 117, '4','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1173, 117, '1','0','VAT super-reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1174, 117, '0','0','VAT Rate 0',1);
-- IRELAND (id country=8)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (81, 8, '0','0','VAT Rate 0',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (82, 8, '23','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (83, 8, '13.5','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (84, 8, '9','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (85, 8, '4.8','0','VAT reduced rate',1);
-- JAPAN (id country=123)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1231, 123, '0','0','VAT Rate 0',1);

View File

@ -30,6 +30,6 @@
-- Type fees
--
insert into llx_c_type_fees (code,libelle,active) values ('TF_OTHER', 'Other', 1);
insert into llx_c_type_fees (code,libelle,active) values ('TF_TRIP', 'Trip', 1);
insert into llx_c_type_fees (code,libelle,active) values ('TF_LUNCH', 'Lunch', 1);
insert into llx_c_type_fees (code,label,active) values ('TF_OTHER', 'Other', 1);
insert into llx_c_type_fees (code,label,active) values ('TF_TRIP', 'Trip', 1);
insert into llx_c_type_fees (code,label,active) values ('TF_LUNCH', 'Lunch', 1);

View File

@ -1,958 +0,0 @@
--
-- Attention a l ordre des requetes.
-- Ce fichier doit etre charge sur une version 2.0.0
-- sans AUCUNE erreur ni warning
--
create table llx_paiementfourn_facturefourn
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_paiementfourn INT(11) DEFAULT NULL,
fk_facturefourn INT(11) DEFAULT NULL,
amount DOUBLE DEFAULT '0'
) TYPE=innodb;
ALTER TABLE llx_paiementfourn_facturefourn ADD INDEX idx_paiementfourn_facturefourn_fk_facture(fk_facturefourn);
ALTER TABLE llx_paiementfourn_facturefourn ADD INDEX idx_paiementfourn_facturefourn_fk_paiement(fk_paiementfourn);
drop table if exists llx_commande_model_pdf;
drop table if exists llx_commande_fournisseur_model_pdf;
alter table llx_commande add column note_public text after note;
alter table llx_contrat add column note text;
alter table llx_contrat add column note_public text after note;
alter table llx_facture add column note_public text after note;
alter table llx_facture add column remise_absolue real DEFAULT 0 after remise_percent;
alter table llx_facture add column close_code varchar(16) after remise;
alter table llx_facture add column close_note varchar(128) after close_code;
alter table llx_facture modify close_code varchar(16);
alter table llx_propal add column note_public text after note;
alter table llx_propal add column remise_absolue real DEFAULT 0 after remise_percent;
alter table llx_commande add column remise_absolue real DEFAULT 0 after remise_percent;
ALTER TABLE llx_societe add mode_reglement tinyint;
ALTER TABLE llx_societe add cond_reglement tinyint;
ALTER TABLE llx_societe add tva_assuj tinyint DEFAULT '1';
ALTER TABLE llx_societe add email varchar(128) after url;
ALTER TABLE llx_societe change active statut tinyint DEFAULT 0;
ALTER TABLE llx_societe modify mode_reglement tinyint NULL;
ALTER TABLE llx_societe modify cond_reglement tinyint NULL;
ALTER TABLE llx_societe modify cond_reglement tinyint NULL;
ALTER TABLE llx_societe modify fk_stcomm tinyint DEFAULT 0;
ALTER TABLE llx_societe modify services tinyint DEFAULT 0;
ALTER TABLE llx_societe modify client tinyint DEFAULT 0;
ALTER TABLE llx_societe modify fournisseur tinyint DEFAULT 0;
ALTER TABLE llx_societe add customer_bad tinyint DEFAULT 0 after fournisseur;
ALTER TABLE llx_societe add customer_rate real DEFAULT 0 after customer_bad;
ALTER TABLE llx_societe add supplier_rate real DEFAULT 0 after customer_rate;
ALTER TABLE llx_societe modify siren varchar(16);
ALTER TABLE llx_societe modify siret varchar(16);
ALTER TABLE llx_societe modify ape varchar(16);
ALTER TABLE llx_societe add idprof4 varchar(16) after ape;
ALTER TABLE llx_societe drop column id;
ALTER TABLE llx_societe modify parent integer;
UPDATE llx_societe set parent = null where parent = 0;
ALTER TABLE llx_product ADD COLUMN stock_loc VARCHAR(10) DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN gencode VARCHAR(255) DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN weight float DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN weight_units tinyint DEFAULT NULL;
ALTER TABLE llx_product ADD COLUMN canvas varchar(15) DEFAULT '';
ALTER TABLE llx_stock_mouvement ADD COLUMN price FLOAT(13,4) DEFAULT 0;
insert into llx_cond_reglement(rowid, code, sortorder, active, libelle, libelle_facture, fdm, nbjour) values (6,'PROFORMA', 6,1, 'Proforma','R<EFBFBD>glement avant livraison',0,0);
alter table llx_cond_reglement add (decalage smallint(6) default 0);
alter table llx_commande add fk_cond_reglement integer DEFAULT NULL;
alter table llx_commande add fk_mode_reglement integer DEFAULT NULL;
alter table llx_categorie drop column fk_statut;
alter table llx_categorie add visible tinyint DEFAULT 1 NOT NULL;
ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label);
alter table llx_c_actioncomm add module varchar(16) DEFAULT NULL after libelle;
delete from llx_c_actioncomm where id in (1,2,3,4,5,8,9,50);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 1, 'AC_TEL', 'system', 'Appel Téléphonique' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 2, 'AC_FAX', 'system', 'Envoi Fax' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 3, 'AC_PROP', 'system', 'Envoi Proposition' ,'propal');
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 4, 'AC_EMAIL','system', 'Envoi Email' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 5, 'AC_RDV', 'system', 'Rendez-vous' ,NULL);
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 8, 'AC_COM', 'system', 'Envoi Commande' ,'order');
insert into llx_c_actioncomm (id, code, type, libelle, module) values ( 9, 'AC_FAC', 'system', 'Envoi Facture' ,'invoice');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (50, 'AC_OTH', 'system', 'Autre' ,NULL);
alter table llx_actioncomm modify datea datetime;
alter table llx_actioncomm add column datec datetime after id;
alter table llx_actioncomm add column datep datetime after datec;
alter table llx_actioncomm add column datep2 datetime after datep;
alter table llx_actioncomm add column datea2 datetime after datea;
alter table llx_actioncomm add column tms timestamp after datea2;
alter table llx_actioncomm add column fk_commande integer after propalrowid;
alter table llx_actioncomm add column fk_parent integer NOT NULL default 0 after fk_contact;
alter table llx_actioncomm add column durationp real after percent;
alter table llx_actioncomm add column durationa real after durationp;
alter table llx_actioncomm add column fk_projet integer after label;
alter table llx_actioncomm add column punctual smallint NOT NULL default 1 after priority;
update llx_actioncomm set datec = datea where datec is null;
update llx_actioncomm set datep = datea where datep is null AND percent < 100;
update llx_actioncomm set datep = datec where datea is null AND datep is null AND percent < 100;
update llx_actioncomm set datea = datec where datea is null AND datep is null AND percent = 100;
update llx_actioncomm set fk_action = '8' where fk_action = '3' and label = 'Envoi commande par mail';
drop table if exists llx_expedition_model_pdf;
create table llx_product_det
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_product integer DEFAULT 0 NOT NULL,
lang varchar(5) DEFAULT 0 NOT NULL,
label varchar(255) NOT NULL,
description text,
note text
)ENGINE=innodb;
ALTER TABLE `llx_propal` ADD `date_livraison` DATE;
ALTER TABLE `llx_commande` ADD `date_livraison` DATE;
update llx_commande set date_livraison = null where date_livraison = '0000-00-00';
update llx_commande set date_livraison = null where date_livraison = '1970-01-01';
ALTER TABLE llx_facture_fourn DROP INDEX facnumber;
ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref (facnumber, fk_soc);
ALTER TABLE llx_facture_fourn ADD note_public text after note;
alter table llx_facture_fourn add column `type` smallint DEFAULT 0 NOT NULL after facnumber;
ALTER TABLE llx_facture_fourn_det ADD INDEX idx_facture_fourn_det_fk_facture (fk_facture_fourn);
ALTER TABLE llx_facture_fourn_det ADD CONSTRAINT fk_facture_fourn_det_fk_facture FOREIGN KEY (fk_facture_fourn) REFERENCES llx_facture_fourn (rowid);
ALTER TABLE llx_facturedet ADD COLUMN fk_remise_except integer NULL AFTER remise;
ALTER TABLE llx_facturedet ADD COLUMN total_ht real AFTER price;
ALTER TABLE llx_facturedet ADD COLUMN total_tva real AFTER total_ht;
ALTER TABLE llx_facturedet ADD COLUMN total_ttc real AFTER total_tva;
ALTER TABLE llx_facturedet ADD COLUMN info_bits integer DEFAULT 0 AFTER date_end;
ALTER TABLE llx_facturedet modify fk_product integer NULL;
UPDATE llx_facturedet SET info_bits=0 where (fk_remise_except IS NULL OR fk_remise_except = 0);
UPDATE llx_facturedet SET fk_product=NULL where fk_product=0;
ALTER TABLE llx_propaldet ADD COLUMN total_ht real AFTER price;
ALTER TABLE llx_propaldet ADD COLUMN total_tva real AFTER total_ht;
ALTER TABLE llx_propaldet ADD COLUMN total_ttc real AFTER total_tva;
ALTER TABLE llx_propaldet ADD COLUMN info_bits integer DEFAULT 0 AFTER total_ttc;
ALTER TABLE llx_commandedet ADD COLUMN total_ht real AFTER price;
ALTER TABLE llx_commandedet ADD COLUMN total_tva real AFTER total_ht;
ALTER TABLE llx_commandedet ADD COLUMN total_ttc real AFTER total_tva;
ALTER TABLE llx_commandedet ADD COLUMN info_bits integer DEFAULT 0 AFTER total_ttc;
ALTER TABLE llx_contratdet ADD COLUMN total_ht real AFTER price_ht;
ALTER TABLE llx_contratdet ADD COLUMN total_tva real AFTER total_ht;
ALTER TABLE llx_contratdet ADD COLUMN total_ttc real AFTER total_tva;
ALTER TABLE llx_contratdet ADD COLUMN info_bits integer DEFAULT 0 AFTER total_ttc;
ALTER TABLE llx_commande ADD INDEX idx_commande_fk_soc (fk_soc);
ALTER TABLE llx_commande ADD CONSTRAINT fk_commande_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
ALTER TABLE llx_commande_fournisseur ADD INDEX idx_commande_fournisseur_fk_soc (fk_soc);
ALTER TABLE llx_commande_fournisseur ADD CONSTRAINT fk_commande_fournisseur_societe FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
alter table llx_commande_fournisseur add note_public text after note;
drop table if exists llx_avoir_model_pdf;
drop table if exists llx_soc_recontact;
update llx_const set name='PRODUIT_DESC_IN_FORM' where name='FORM_ADD_PROD_DESC';
update llx_const set name='PRODUIT_CHANGE_PROD_DESC' where name='CHANGE_PROD_DESC';
update llx_const set name='COMMANDE_ADD_PROD_DESC' where name='COM_ADD_PROD_DESC';
update llx_const set name='PROPALE_ADD_PROD_DESC' where name='PROP_ADD_PROD_DESC';
update llx_const set name='DON_FORM' where name='DONS_FORM';
update llx_const set name='MAIN_SIZE_LISTE_LIMIT' where name='SIZE_LISTE_LIMIT';
update llx_const set name='SOCIETE_FISCAL_MONTH_START' where name='FISCAL_MONTH_START';
update llx_const set visible=0 where name='FACTURE_DISABLE_RECUR';
update llx_const set visible=0 where name='MAILING_EMAIL_FROM';
update llx_const set visible=1 where name='PRODUIT_CONFIRM_DELETE_LINE';
update llx_const set name='NOTIFICATION_EMAIL_FROM', visible=0 where name='MAIN_MAIL_FROM';
update llx_const set name='NOTIFICATION_EMAIL_FROM', visible=0 where name='MAIN_EMAIL_FROM';
update llx_const set value=2048, visible=0 where name='MAIN_UPLOAD_DOC' and value=1;
delete from llx_const where name = 'SIZE_LISTE_LIMIT';
insert into llx_const(name,value,type,visible,note) values('MAIN_SHOW_DEVELOPMENT_MODULES','0','yesno',1,'Make development modules visible');
delete from llx_const where name in ('OSC_CATALOG_URL','OSC_LANGUAGE_ID');
update llx_const set visible=0 where name like 'OSC_DB_%';
alter table llx_paiementfourn add statut smallint(6) NOT NULL DEFAULT 0;
alter table llx_bank_url add column type enum("company","payment","member","subscription","donation","sc","payment_sc");
update llx_bank_url set type=null where type='';
alter table llx_bank_url modify type enum("company","payment","member","subscription","donation","sc","payment_sc") NOT NULL;
update llx_bank_url set type = 'payment_supplier' where label = '(paiement)' and type='payment' and url like '%/fourn/%';
alter table llx_bank_url drop index fk_bank;
alter table llx_bank_url drop index fk_bank_2;
alter table llx_bank_url drop index fk_bank_3;
alter table llx_bank_url drop index fk_bank_4;
alter table llx_bank_url drop index fk_bank_5;
alter table llx_bank_url drop index fk_bank_6;
alter table llx_bank_url drop index fk_bank_7;
alter table llx_bank_url drop index fk_bank_8;
alter table llx_bank_url drop index fk_bank_9;
ALTER TABLE llx_bank_url DROP INDEX uk_bank_url;
ALTER TABLE llx_bank_url ADD UNIQUE INDEX uk_bank_url (fk_bank,type);
create table llx_societe_adresse_livraison
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
tms timestamp,
fk_societe integer DEFAULT 0,
nom varchar(60),
address varchar(255),
cp varchar(10),
ville varchar(50),
fk_departement integer DEFAULT 0,
fk_pays integer DEFAULT 0,
note text,
fk_user_creat integer,
fk_user_modif integer
)ENGINE=innodb;
alter table llx_societe_adresse_livraison add column label varchar(30) after tms;
alter table llx_propal add column fk_adresse_livraison integer after date_livraison;
alter table llx_commande add column fk_adresse_livraison integer after date_livraison;
alter table llx_c_pays modify libelle varchar(50) NOT NULL;
SET FOREIGN_KEY_CHECKS = 0;
delete from llx_c_pays;
SET FOREIGN_KEY_CHECKS = 1;
insert into llx_c_pays (rowid,code,libelle) values (0, '' , '-' );
insert into llx_c_pays (rowid,code,libelle) values (1, 'FR', 'France' );
insert into llx_c_pays (rowid,code,libelle) values (2, 'BE', 'Belgique' );
insert into llx_c_pays (rowid,code,libelle) values (3, 'IT', 'Italie' );
insert into llx_c_pays (rowid,code,libelle) values (4, 'ES', 'Espagne' );
insert into llx_c_pays (rowid,code,libelle) values (5, 'DE', 'Allemagne' );
insert into llx_c_pays (rowid,code,libelle) values (6, 'CH', 'Suisse' );
insert into llx_c_pays (rowid,code,libelle) values (7, 'GB', 'Royaume uni' );
insert into llx_c_pays (rowid,code,libelle) values (8, 'IE', 'Irlande' );
insert into llx_c_pays (rowid,code,libelle) values (9, 'CN', 'Chine' );
insert into llx_c_pays (rowid,code,libelle) values (10, 'TN', 'Tunisie' );
insert into llx_c_pays (rowid,code,libelle) values (11, 'US', 'Etats Unis' );
insert into llx_c_pays (rowid,code,libelle) values (12, 'MA', 'Maroc' );
insert into llx_c_pays (rowid,code,libelle) values (13, 'DZ', 'Algérie' );
insert into llx_c_pays (rowid,code,libelle) values (14, 'CA', 'Canada' );
insert into llx_c_pays (rowid,code,libelle) values (15, 'TG', 'Togo' );
insert into llx_c_pays (rowid,code,libelle) values (16, 'GA', 'Gabon' );
insert into llx_c_pays (rowid,code,libelle) values (17, 'NL', 'Pays Bas' );
insert into llx_c_pays (rowid,code,libelle) values (18, 'HU', 'Hongrie' );
insert into llx_c_pays (rowid,code,libelle) values (19, 'RU', 'Russie' );
insert into llx_c_pays (rowid,code,libelle) values (20, 'SE', 'Suède' );
insert into llx_c_pays (rowid,code,libelle) values (21, 'CI', 'Côte d\'Ivoire' );
insert into llx_c_pays (rowid,code,libelle) values (22, 'SN', 'Sénégal' );
insert into llx_c_pays (rowid,code,libelle) values (23, 'AR', 'Argentine' );
insert into llx_c_pays (rowid,code,libelle) values (24, 'CM', 'Cameroun' );
insert into llx_c_pays (rowid,code,libelle) values (25, 'PT', 'Portugal' );
insert into llx_c_pays (rowid,code,libelle) values (26, 'SA', 'Arabie Saoudite');
insert into llx_c_pays (rowid,code,libelle) values (27, 'MC', 'Monaco' );
insert into llx_c_pays (rowid,code,libelle) values (28, 'AU', 'Australie' );
insert into llx_c_pays (rowid,code,libelle) values (29, 'SG', 'Singapoure' );
insert into llx_c_pays (rowid,code,libelle) values (30, 'AF', 'Afghanistan' );
insert into llx_c_pays (rowid,code,libelle) values (31, 'AX', 'Iles Aland' );
insert into llx_c_pays (rowid,code,libelle) values (32, 'AL', 'Albanie' );
insert into llx_c_pays (rowid,code,libelle) values (33, 'AS', 'Samoa américaines');
insert into llx_c_pays (rowid,code,libelle) values (34, 'AD', 'Andorre' );
insert into llx_c_pays (rowid,code,libelle) values (35, 'AO', 'Angola' );
insert into llx_c_pays (rowid,code,libelle) values (36, 'AI', 'Anguilla' );
insert into llx_c_pays (rowid,code,libelle) values (37, 'AQ', 'Antarctique' );
insert into llx_c_pays (rowid,code,libelle) values (38, 'AG', 'Antigua-et-Barbuda');
insert into llx_c_pays (rowid,code,libelle) values (39, 'AM', 'Arménie' );
insert into llx_c_pays (rowid,code,libelle) values (40, 'AW', 'Aruba' );
insert into llx_c_pays (rowid,code,libelle) values (41, 'AT', 'Autriche' );
insert into llx_c_pays (rowid,code,libelle) values (42, 'AZ', 'Azerbaïdjan' );
insert into llx_c_pays (rowid,code,libelle) values (43, 'BS', 'Bahamas' );
insert into llx_c_pays (rowid,code,libelle) values (44, 'BH', 'Bahreïn' );
insert into llx_c_pays (rowid,code,libelle) values (45, 'BD', 'Bangladesh' );
insert into llx_c_pays (rowid,code,libelle) values (46, 'BB', 'Barbade' );
insert into llx_c_pays (rowid,code,libelle) values (47, 'BY', 'Biélorussie' );
insert into llx_c_pays (rowid,code,libelle) values (48, 'BZ', 'Belize' );
insert into llx_c_pays (rowid,code,libelle) values (49, 'BJ', 'Bénin' );
insert into llx_c_pays (rowid,code,libelle) values (50, 'BM', 'Bermudes' );
insert into llx_c_pays (rowid,code,libelle) values (51, 'BT', 'Bhoutan' );
insert into llx_c_pays (rowid,code,libelle) values (52, 'BO', 'Bolivie' );
insert into llx_c_pays (rowid,code,libelle) values (53, 'BA', 'Bosnie-Herzégovine');
insert into llx_c_pays (rowid,code,libelle) values (54, 'BW', 'Botswana' );
insert into llx_c_pays (rowid,code,libelle) values (55, 'BV', 'Ile Bouvet' );
insert into llx_c_pays (rowid,code,libelle) values (56, 'BR', 'Brésil' );
insert into llx_c_pays (rowid,code,libelle) values (57, 'IO', 'Territoire britannique de l\'Océan Indien');
insert into llx_c_pays (rowid,code,libelle) values (58, 'BN', 'Brunei' );
insert into llx_c_pays (rowid,code,libelle) values (59, 'BG', 'Bulgarie' );
insert into llx_c_pays (rowid,code,libelle) values (60, 'BF', 'Burkina Faso' );
insert into llx_c_pays (rowid,code,libelle) values (61, 'BI', 'Burundi' );
insert into llx_c_pays (rowid,code,libelle) values (62, 'KH', 'Cambodge' );
insert into llx_c_pays (rowid,code,libelle) values (63, 'CV', 'Cap-Vert' );
insert into llx_c_pays (rowid,code,libelle) values (64, 'KY', 'Iles Cayman' );
insert into llx_c_pays (rowid,code,libelle) values (65, 'CF', 'République centrafricaine');
insert into llx_c_pays (rowid,code,libelle) values (66, 'TD', 'Tchad' );
insert into llx_c_pays (rowid,code,libelle) values (67, 'CL', 'Chili' );
insert into llx_c_pays (rowid,code,libelle) values (68, 'CX', 'Ile Christmas' );
insert into llx_c_pays (rowid,code,libelle) values (69, 'CC', 'Iles des Cocos (Keeling)');
insert into llx_c_pays (rowid,code,libelle) values (70, 'CO', 'Colombie' );
insert into llx_c_pays (rowid,code,libelle) values (71, 'KM', 'Comores' );
insert into llx_c_pays (rowid,code,libelle) values (72, 'CG', 'Congo' );
insert into llx_c_pays (rowid,code,libelle) values (73, 'CD', 'République démocratique du Congo');
insert into llx_c_pays (rowid,code,libelle) values (74, 'CK', 'Iles Cook' );
insert into llx_c_pays (rowid,code,libelle) values (75, 'CR', 'Costa Rica' );
insert into llx_c_pays (rowid,code,libelle) values (76, 'HR', 'Croatie' );
insert into llx_c_pays (rowid,code,libelle) values (77, 'CU', 'Cuba' );
insert into llx_c_pays (rowid,code,libelle) values (78, 'CY', 'Chypre' );
insert into llx_c_pays (rowid,code,libelle) values (79, 'CZ', 'République Tchèque');
insert into llx_c_pays (rowid,code,libelle) values (80, 'DK', 'Danemark' );
insert into llx_c_pays (rowid,code,libelle) values (81, 'DJ', 'Djibouti' );
insert into llx_c_pays (rowid,code,libelle) values (82, 'DM', 'Dominique' );
insert into llx_c_pays (rowid,code,libelle) values (83, 'DO', 'République Dominicaine');
insert into llx_c_pays (rowid,code,libelle) values (84, 'EC', 'Equateur' );
insert into llx_c_pays (rowid,code,libelle) values (85, 'EG', 'Egypte' );
insert into llx_c_pays (rowid,code,libelle) values (86, 'SV', 'Salvador' );
insert into llx_c_pays (rowid,code,libelle) values (87, 'GQ', 'Guinée Equatoriale');
insert into llx_c_pays (rowid,code,libelle) values (88, 'ER', 'Erythrée' );
insert into llx_c_pays (rowid,code,libelle) values (89, 'EE', 'Estonie' );
insert into llx_c_pays (rowid,code,libelle) values (90, 'ET', 'Ethiopie' );
insert into llx_c_pays (rowid,code,libelle) values (91, 'FK', 'Iles Falkland' );
insert into llx_c_pays (rowid,code,libelle) values (92, 'FO', 'Iles Féroé' );
insert into llx_c_pays (rowid,code,libelle) values (93, 'FJ', 'Iles Fidji' );
insert into llx_c_pays (rowid,code,libelle) values (94, 'FI', 'Finlande' );
insert into llx_c_pays (rowid,code,libelle) values (95, 'GF', 'Guyane française');
insert into llx_c_pays (rowid,code,libelle) values (96, 'PF', 'Polynésie française');
insert into llx_c_pays (rowid,code,libelle) values (97, 'TF', 'Terres australes françaises');
insert into llx_c_pays (rowid,code,libelle) values (98, 'GM', 'Gambie' );
insert into llx_c_pays (rowid,code,libelle) values (99, 'GE', 'Géorgie' );
insert into llx_c_pays (rowid,code,libelle) values (100, 'GH', 'Ghana' );
insert into llx_c_pays (rowid,code,libelle) values (101, 'GI', 'Gibraltar' );
insert into llx_c_pays (rowid,code,libelle) values (102, 'GR', 'Grèce' );
insert into llx_c_pays (rowid,code,libelle) values (103, 'GL', 'Groenland' );
insert into llx_c_pays (rowid,code,libelle) values (104, 'GD', 'Grenade' );
insert into llx_c_pays (rowid,code,libelle) values (105, 'GP', 'Guadeloupe' );
insert into llx_c_pays (rowid,code,libelle) values (106, 'GU', 'Guam' );
insert into llx_c_pays (rowid,code,libelle) values (107, 'GT', 'Guatemala' );
insert into llx_c_pays (rowid,code,libelle) values (108, 'GN', 'Guinée' );
insert into llx_c_pays (rowid,code,libelle) values (109, 'GW', 'Guinée-Bissao' );
insert into llx_c_pays (rowid,code,libelle) values (110, 'GY', 'Guyana' );
insert into llx_c_pays (rowid,code,libelle) values (111, 'HT', 'Haïti' );
insert into llx_c_pays (rowid,code,libelle) values (112, 'HM', 'Iles Heard et McDonald');
insert into llx_c_pays (rowid,code,libelle) values (113, 'VA', 'Saint-Siège (Vatican)');
insert into llx_c_pays (rowid,code,libelle) values (114, 'HN', 'Honduras' );
insert into llx_c_pays (rowid,code,libelle) values (115, 'HK', 'Hong Kong' );
insert into llx_c_pays (rowid,code,libelle) values (116, 'IS', 'Islande' );
insert into llx_c_pays (rowid,code,libelle) values (117, 'IN', 'Inde' );
insert into llx_c_pays (rowid,code,libelle) values (118, 'ID', 'Indonésie' );
insert into llx_c_pays (rowid,code,libelle) values (119, 'IR', 'Iran' );
insert into llx_c_pays (rowid,code,libelle) values (120, 'IQ', 'Iraq' );
insert into llx_c_pays (rowid,code,libelle) values (121, 'IL', 'Israël' );
insert into llx_c_pays (rowid,code,libelle) values (122, 'JM', 'Jamaïque' );
insert into llx_c_pays (rowid,code,libelle) values (123, 'JP', 'Japon' );
insert into llx_c_pays (rowid,code,libelle) values (124, 'JO', 'Jordanie' );
insert into llx_c_pays (rowid,code,libelle) values (125, 'KZ', 'Kazakhstan' );
insert into llx_c_pays (rowid,code,libelle) values (126, 'KE', 'Kenya' );
insert into llx_c_pays (rowid,code,libelle) values (127, 'KI', 'Kiribati' );
insert into llx_c_pays (rowid,code,libelle) values (128, 'KP', 'Corée du Nord' );
insert into llx_c_pays (rowid,code,libelle) values (129, 'KR', 'Corée du Sud' );
insert into llx_c_pays (rowid,code,libelle) values (130, 'KW', 'Koweït' );
insert into llx_c_pays (rowid,code,libelle) values (131, 'KG', 'Kirghizistan' );
insert into llx_c_pays (rowid,code,libelle) values (132, 'LA', 'Laos' );
insert into llx_c_pays (rowid,code,libelle) values (133, 'LV', 'Lettonie' );
insert into llx_c_pays (rowid,code,libelle) values (134, 'LB', 'Liban' );
insert into llx_c_pays (rowid,code,libelle) values (135, 'LS', 'Lesotho' );
insert into llx_c_pays (rowid,code,libelle) values (136, 'LR', 'Liberia' );
insert into llx_c_pays (rowid,code,libelle) values (137, 'LY', 'Libye' );
insert into llx_c_pays (rowid,code,libelle) values (138, 'LI', 'Liechtenstein' );
insert into llx_c_pays (rowid,code,libelle) values (139, 'LT', 'Lituanie' );
insert into llx_c_pays (rowid,code,libelle) values (140, 'LU', 'Luxembourg' );
insert into llx_c_pays (rowid,code,libelle) values (141, 'MO', 'Macao' );
insert into llx_c_pays (rowid,code,libelle) values (142, 'MK', 'ex-République yougoslave de Macédoine');
insert into llx_c_pays (rowid,code,libelle) values (143, 'MG', 'Madagascar' );
insert into llx_c_pays (rowid,code,libelle) values (144, 'MW', 'Malawi' );
insert into llx_c_pays (rowid,code,libelle) values (145, 'MY', 'Malaisie' );
insert into llx_c_pays (rowid,code,libelle) values (146, 'MV', 'Maldives' );
insert into llx_c_pays (rowid,code,libelle) values (147, 'ML', 'Mali' );
insert into llx_c_pays (rowid,code,libelle) values (148, 'MT', 'Malte' );
insert into llx_c_pays (rowid,code,libelle) values (149, 'MH', 'Iles Marshall' );
insert into llx_c_pays (rowid,code,libelle) values (150, 'MQ', 'Martinique' );
insert into llx_c_pays (rowid,code,libelle) values (151, 'MR', 'Mauritanie' );
insert into llx_c_pays (rowid,code,libelle) values (152, 'MU', 'Maurice' );
insert into llx_c_pays (rowid,code,libelle) values (153, 'YT', 'Mayotte' );
insert into llx_c_pays (rowid,code,libelle) values (154, 'MX', 'Mexique' );
insert into llx_c_pays (rowid,code,libelle) values (155, 'FM', 'Micronésie' );
insert into llx_c_pays (rowid,code,libelle) values (156, 'MD', 'Moldavie' );
insert into llx_c_pays (rowid,code,libelle) values (157, 'MN', 'Mongolie' );
insert into llx_c_pays (rowid,code,libelle) values (158, 'MS', 'Monserrat' );
insert into llx_c_pays (rowid,code,libelle) values (159, 'MZ', 'Mozambique' );
insert into llx_c_pays (rowid,code,libelle) values (160, 'MM', 'Birmanie' );
insert into llx_c_pays (rowid,code,libelle) values (161, 'NA', 'Namibie' );
insert into llx_c_pays (rowid,code,libelle) values (162, 'NR', 'Nauru' );
insert into llx_c_pays (rowid,code,libelle) values (163, 'NP', 'Népal' );
insert into llx_c_pays (rowid,code,libelle) values (164, 'AN', 'Antilles néerlandaises');
insert into llx_c_pays (rowid,code,libelle) values (165, 'NC', 'Nouvelle-Calédonie');
insert into llx_c_pays (rowid,code,libelle) values (166, 'NZ', 'Nouvelle-Zélande');
insert into llx_c_pays (rowid,code,libelle) values (167, 'NI', 'Nicaragua' );
insert into llx_c_pays (rowid,code,libelle) values (168, 'NE', 'Niger' );
insert into llx_c_pays (rowid,code,libelle) values (169, 'NG', 'Nigeria' );
insert into llx_c_pays (rowid,code,libelle) values (170, 'NU', 'Nioué' );
insert into llx_c_pays (rowid,code,libelle) values (171, 'NF', 'Ile Norfolk' );
insert into llx_c_pays (rowid,code,libelle) values (172, 'MP', 'Mariannes du Nord');
insert into llx_c_pays (rowid,code,libelle) values (173, 'NO', 'Norvège' );
insert into llx_c_pays (rowid,code,libelle) values (174, 'OM', 'Oman' );
insert into llx_c_pays (rowid,code,libelle) values (175, 'PK', 'Pakistan' );
insert into llx_c_pays (rowid,code,libelle) values (176, 'PW', 'Palaos' );
insert into llx_c_pays (rowid,code,libelle) values (177, 'PS', 'territoire Palestinien Occupé');
insert into llx_c_pays (rowid,code,libelle) values (178, 'PA', 'Panama' );
insert into llx_c_pays (rowid,code,libelle) values (179, 'PG', 'Papouasie-Nouvelle-Guinée');
insert into llx_c_pays (rowid,code,libelle) values (180, 'PY', 'Paraguay' );
insert into llx_c_pays (rowid,code,libelle) values (181, 'PE', 'Pérou' );
insert into llx_c_pays (rowid,code,libelle) values (182, 'PH', 'Philippines' );
insert into llx_c_pays (rowid,code,libelle) values (183, 'PN', 'Iles Pitcairn' );
insert into llx_c_pays (rowid,code,libelle) values (184, 'PL', 'Pologne' );
insert into llx_c_pays (rowid,code,libelle) values (185, 'PR', 'Porto Rico' );
insert into llx_c_pays (rowid,code,libelle) values (186, 'QA', 'Qatar' );
insert into llx_c_pays (rowid,code,libelle) values (187, 'RE', 'Réunion' );
insert into llx_c_pays (rowid,code,libelle) values (188, 'RO', 'Roumanie' );
insert into llx_c_pays (rowid,code,libelle) values (189, 'RW', 'Rwanda' );
insert into llx_c_pays (rowid,code,libelle) values (190, 'SH', 'Sainte-Hélène' );
insert into llx_c_pays (rowid,code,libelle) values (191, 'KN', 'Saint-Christophe-et-Niévès');
insert into llx_c_pays (rowid,code,libelle) values (192, 'LC', 'Sainte-Lucie' );
insert into llx_c_pays (rowid,code,libelle) values (193, 'PM', 'Saint-Pierre-et-Miquelon');
insert into llx_c_pays (rowid,code,libelle) values (194, 'VC', 'Saint-Vincent-et-les-Grenadines');
insert into llx_c_pays (rowid,code,libelle) values (195, 'WS', 'Samoa' );
insert into llx_c_pays (rowid,code,libelle) values (196, 'SM', 'Saint-Marin' );
insert into llx_c_pays (rowid,code,libelle) values (197, 'ST', 'Sao Tomé-et-Principe');
insert into llx_c_pays (rowid,code,libelle) values (198, 'RS', 'Serbie' );
insert into llx_c_pays (rowid,code,libelle) values (199, 'SC', 'Seychelles' );
insert into llx_c_pays (rowid,code,libelle) values (200, 'SL', 'Sierra Leone' );
insert into llx_c_pays (rowid,code,libelle) values (201, 'SK', 'Slovaquie' );
insert into llx_c_pays (rowid,code,libelle) values (202, 'SI', 'Slovénie' );
insert into llx_c_pays (rowid,code,libelle) values (203, 'SB', 'Iles Salomon' );
insert into llx_c_pays (rowid,code,libelle) values (204, 'SO', 'Somalie' );
insert into llx_c_pays (rowid,code,libelle) values (205, 'ZA', 'Afrique du Sud');
insert into llx_c_pays (rowid,code,libelle) values (206, 'GS', 'Iles Géorgie du Sud et Sandwich du Sud');
insert into llx_c_pays (rowid,code,libelle) values (207, 'LK', 'Sri Lanka' );
insert into llx_c_pays (rowid,code,libelle) values (208, 'SD', 'Soudan' );
insert into llx_c_pays (rowid,code,libelle) values (209, 'SR', 'Suriname' );
insert into llx_c_pays (rowid,code,libelle) values (210, 'SJ', 'Iles Svalbard et Jan Mayen');
insert into llx_c_pays (rowid,code,libelle) values (211, 'SZ', 'Swaziland' );
insert into llx_c_pays (rowid,code,libelle) values (212, 'SY', 'Syrie' );
insert into llx_c_pays (rowid,code,libelle) values (213, 'TW', 'Taïwan' );
insert into llx_c_pays (rowid,code,libelle) values (214, 'TJ', 'Tadjikistan' );
insert into llx_c_pays (rowid,code,libelle) values (215, 'TZ', 'Tanzanie' );
insert into llx_c_pays (rowid,code,libelle) values (216, 'TH', 'Thaïlande' );
insert into llx_c_pays (rowid,code,libelle) values (217, 'TL', 'Timor Oriental');
insert into llx_c_pays (rowid,code,libelle) values (218, 'TK', 'Tokélaou' );
insert into llx_c_pays (rowid,code,libelle) values (219, 'TO', 'Tonga' );
insert into llx_c_pays (rowid,code,libelle) values (220, 'TT', 'Trinité-et-Tobago');
insert into llx_c_pays (rowid,code,libelle) values (221, 'TR', 'Turquie' );
insert into llx_c_pays (rowid,code,libelle) values (222, 'TM', 'Turkménistan' );
insert into llx_c_pays (rowid,code,libelle) values (223, 'TC', 'Iles Turks-et-Caicos');
insert into llx_c_pays (rowid,code,libelle) values (224, 'TV', 'Tuvalu' );
insert into llx_c_pays (rowid,code,libelle) values (225, 'UG', 'Ouganda' );
insert into llx_c_pays (rowid,code,libelle) values (226, 'UA', 'Ukraine' );
insert into llx_c_pays (rowid,code,libelle) values (227, 'AE', 'Emirats arabes unis');
insert into llx_c_pays (rowid,code,libelle) values (228, 'UM', 'Iles mineures éloignées des états-Unis');
insert into llx_c_pays (rowid,code,libelle) values (229, 'UY', 'Uruguay' );
insert into llx_c_pays (rowid,code,libelle) values (230, 'UZ', 'Ouzbékistan' );
insert into llx_c_pays (rowid,code,libelle) values (231, 'VU', 'Vanuatu' );
insert into llx_c_pays (rowid,code,libelle) values (232, 'VE', 'Vénézuela' );
insert into llx_c_pays (rowid,code,libelle) values (233, 'VN', 'Viêt Nam' );
insert into llx_c_pays (rowid,code,libelle) values (234, 'VG', 'Iles Vierges britanniques');
insert into llx_c_pays (rowid,code,libelle) values (235, 'VI', 'Iles Vierges américaines');
insert into llx_c_pays (rowid,code,libelle) values (236, 'WF', 'Wallis-et-Futuna');
insert into llx_c_pays (rowid,code,libelle) values (237, 'EH', 'Sahara occidental');
insert into llx_c_pays (rowid,code,libelle) values (238, 'YE', 'Yémen' );
insert into llx_c_pays (rowid,code,libelle) values (239, 'ZM', 'Zambie' );
insert into llx_c_pays (rowid,code,libelle) values (240, 'ZW', 'Zimbabwe' );
delete from llx_c_regions where rowid='2901' and code_region='2901';
delete from llx_c_departements where fk_region='2901';
insert into llx_c_regions (rowid,fk_pays,code_region,cheflieu,tncc,nom) values (2801,28,2801, '',0,'Australia');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'NSW','',1,'','New South Wales');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'VIC','',1,'','Victoria');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'QLD','',1,'','Queensland');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801, 'SA','',1,'','South Australia');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'ACT','',1,'','Australia Capital Territory');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801,'TAS','',1,'','Tasmania');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801, 'WA','',1,'','Western Australia');
insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (2801, 'NT','',1,'','Northern Territory');
delete from llx_c_tva where rowid='291' and fk_pays='5';
delete from llx_c_tva where rowid='292' and fk_pays='5';
delete from llx_c_tva where rowid='291' and fk_pays='29';
delete from llx_c_tva where rowid='292' and fk_pays='29';
delete from llx_c_tva where rowid='261' and fk_pays='26';
delete from llx_c_tva where rowid='262' and fk_pays='26';
delete from llx_c_tva where rowid='263' and fk_pays='26';
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (281, 28, '10','0','VAT Rate 10',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (282, 28, '0','0','VAT Rate 0',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (251,25, '17','0','VAT Rate 17',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (252,25, '12','0','VAT Rate 12',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (253,25, '0','0','VAT Rate 0',1);
update llx_const set name='DON_ADDON_MODEL' where name='DON_ADDON';
update llx_const set value='neptune' where value='pluton' and name = 'FACTURE_ADDON';
update llx_const set value='azur' where value='orange' and name = 'PROPALE_ADDON';
update llx_const set value='mod_commande_diamant' where value='mod_commande_jade' and name ='COMMANDE_ADDON';
insert into llx_const (name, value, type, visible) values ('FICHEINTER_ADDON', 'pacific','chaine',0);
alter table llx_propal_model_pdf rename to llx_document_model;
alter table llx_document_model DROP PRIMARY KEY;
alter table llx_document_model add column rowid integer AUTO_INCREMENT PRIMARY KEY FIRST;
alter table llx_document_model add column type varchar(20) NOT NULL after nom;
update llx_document_model set type='propal' where type='';
delete from llx_document_model where nom='adytek';
delete from llx_document_model where nom='rouge' and type='order';
delete from llx_document_model where nom='azur' and type='order';
delete from llx_document_model where nom='orange' and type='propal';
delete from llx_document_model where nom='transporteur' and type='shipping';
delete from llx_document_model where nom='dorade' and type='shipping';
ALTER TABLE llx_facture ADD UNIQUE INDEX idx_facture_uk_facnumber (facnumber);
alter table llx_facture_rec add column remise_absolue real default 0 after remise_percent;
alter table llx_facture_rec add column fk_mode_reglement integer default 0 after fk_cond_reglement;
alter table llx_facture_rec add column date_lim_reglement date after fk_mode_reglement;
alter table llx_facture_rec add column note_public text after note;
update llx_facture_rec set fk_mode_reglement='0' where fk_mode_reglement='NULL';
ALTER TABLE llx_facture_rec ADD INDEX idx_facture_rec_fk_soc (fk_soc);
ALTER TABLE llx_facture_rec ADD INDEX idx_facture_rec_fk_user_author (fk_user_author);
ALTER TABLE llx_facture_rec ADD INDEX idx_facture_rec_fk_projet (fk_projet);
ALTER TABLE llx_facture_rec ADD CONSTRAINT fk_facture_rec_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
ALTER TABLE llx_facture_rec ADD CONSTRAINT fk_facture_rec_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
ALTER TABLE llx_facture_rec ADD UNIQUE INDEX idx_facture_rec_uk_titre (titre);
ALTER TABLE llx_commandedet ADD COLUMN fk_remise_except integer NULL AFTER remise;
ALTER TABLE llx_commandedet ADD COLUMN special_code tinyint(1) UNSIGNED DEFAULT 0;
ALTER TABLE llx_propaldet ADD COLUMN fk_remise_except integer NULL AFTER remise;
ALTER TABLE llx_contratdet ADD COLUMN fk_remise_except integer NULL AFTER remise;
create table llx_livraison
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_commande integer DEFAULT 0,
fk_expedition integer,
ref varchar(30) NOT NULL,
date_creation datetime,
date_valid datetime,
fk_user_author integer,
fk_user_valid integer,
fk_statut smallint default 0,
note text,
note_public text,
model_pdf varchar(50),
date_livraison date default NULL,
fk_adresse_livraison integer,
UNIQUE INDEX (ref),
key(fk_commande)
)ENGINE=innodb;
alter table llx_livraison drop foreign key fk_livraison_societe;
alter table llx_livraison drop column fk_soc;
create table llx_livraisondet
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_livraison integer,
fk_commande_ligne integer NOT NULL,
qty real,
key(fk_livraison),
key(fk_commande_ligne)
)ENGINE=innodb;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (90, 'commande', 'internal', 'SALESREPSIGN', 'Commercial signataire de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (91, 'commande', 'internal', 'SALESREPFOLL', 'Commercial suivi de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (100, 'commande', 'external', 'BILLING', 'Contact client facturation commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (101, 'commande', 'external', 'CUSTOMER', 'Contact client suivi commande', 1);
alter table llx_bank_account add column ref varchar(12) NOT NULL;
alter table llx_bank_account add column url varchar(128);
alter table llx_bank_account add column currency_code varchar(2) NOT NULL;
alter table llx_bank_account add column min_allowed integer DEFAULT 0;
alter table llx_bank_account add column min_desired integer DEFAULT 0;
alter table llx_bank_account add column comment varchar(254);
alter table llx_bank_account modify bic varchar(11);
update llx_bank_account set currency_code='EU';
update llx_bank_account set rappro=0 where courant=2;
ALTER TABLE llx_bank ADD COLUMN fk_bordereau INTEGER DEFAULT 0;
ALTER TABLE llx_bank ADD COLUMN banque varchar(255);
ALTER TABLE llx_bank ADD COLUMN emetteur varchar(255);
alter table llx_accountingsystem_det rename to llx_accountingaccount;
insert into llx_rights_def (id, libelle, module, type, bydefault, subperms, perms) values (262,'Consulter tous les clients','commercial','r',1,'voir','client');
-- V4.1 insert into llx_user_rights(fk_user,fk_id) select distinct fk_user, '262' from llx_user_rights where fk_id = 261;
update llx_rights_def set subperms='creer' where subperms='supprimer' AND module='user' AND perms='self' AND id=255;
update llx_rights_def set module='tax' where module='compta' AND id in ('91','92','93');
update llx_rights_def set subperms='receptionner' where id=186;
alter table llx_commandedet add column rang integer DEFAULT 0;
alter table llx_propaldet add column rang integer DEFAULT 0;
alter table llx_facture drop column model;
alter table llx_facture add column model_pdf varchar(50) after note_public;
alter table llx_facture drop foreign key fk_facture_fk_facture;
alter table llx_facture drop column fk_facture;
alter table llx_facture add column fk_facture_source integer after fk_user_valid;
ALTER TABLE llx_facture ADD INDEX idx_facture_fk_facture_source (fk_facture_source);
ALTER TABLE llx_facture ADD CONSTRAINT fk_facture_source_fk_facture FOREIGN KEY (fk_facture_source) REFERENCES llx_facture (rowid);
alter table llx_facture add column type smallint DEFAULT 0 NOT NULL after facnumber;
-- Supprimme orphelins pour permettre montée de la clé
-- V4 DELETE llx_commandedet FROM llx_commandedet LEFT JOIN llx_commande ON llx_commandedet.fk_commande = llx_commande.rowid WHERE llx_commande.rowid IS NULL;
ALTER TABLE llx_commandedet ADD INDEX idx_commandedet_fk_commande (fk_commande);
ALTER TABLE llx_commandedet ADD CONSTRAINT fk_commandedet_fk_commande FOREIGN KEY (fk_commande) REFERENCES llx_commande (rowid);
-- drop table llx_societe_remise_except;
create table llx_societe_remise_except
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_soc integer NOT NULL,
datec datetime,
amount_ht real NOT NULL,
fk_user integer NOT NULL,
fk_facture integer,
description varchar(255) NOT NULL
)ENGINE=innodb;
alter table llx_societe_remise_except ADD COLUMN amount_tva real DEFAULT 0 NOT NULL after amount_ht;
alter table llx_societe_remise_except ADD COLUMN amount_ttc real DEFAULT 0 NOT NULL after amount_tva;
alter table llx_societe_remise_except ADD COLUMN tva_tx real DEFAULT 0 NOT NULL after amount_ttc;
alter table llx_societe_remise_except ADD COLUMN fk_facture_source integer after fk_user;
update llx_societe_remise_except set amount_tva=0, tva_tx=0, amount_ttc = amount_ht where amount_ttc = 0;
delete from llx_societe_remise_except WHERE amount_ht=0;
-- Supprimme orphelins pour permettre montée de la clé
-- V4 DELETE llx_societe_remise_except FROM llx_societe_remise_except LEFT JOIN llx_facturedet ON llx_societe_remise_except.fk_facture = llx_facturedet.rowid WHERE llx_facturedet.rowid IS NULL;
ALTER TABLE llx_societe_remise_except DROP FOREIGN KEY fk_societe_remise_fk_facture;
ALTER TABLE llx_societe_remise_except DROP FOREIGN KEY fk_societe_remise_fk_facture_source;
ALTER TABLE llx_societe_remise_except ADD INDEX idx_societe_remise_except_fk_user (fk_user);
ALTER TABLE llx_societe_remise_except ADD INDEX idx_societe_remise_except_fk_soc (fk_soc);
ALTER TABLE llx_societe_remise_except ADD INDEX idx_societe_remise_except_fk_facture (fk_facture);
ALTER TABLE llx_societe_remise_except ADD INDEX idx_societe_remise_except_fk_facture_source (fk_facture_source);
ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_user FOREIGN KEY (fk_user) REFERENCES llx_user (rowid);
ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (idp);
ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_facture FOREIGN KEY (fk_facture) REFERENCES llx_facturedet (rowid);
ALTER TABLE llx_societe_remise_except ADD CONSTRAINT fk_societe_remise_fk_facture_source FOREIGN KEY (fk_facture_source) REFERENCES llx_facture (rowid);
update llx_societe_remise_except set description='Remise sans description' where description is NULL or description ='';
alter table llx_societe_remise_except modify description varchar(255) NOT NULL;
insert into llx_const (name, value, type, visible, note) VALUES ('PROPALE_VALIDITY_DURATION', '15', 'chaine', 0, 'Durée de validitée des propales');
alter table llx_propal add column ref_client varchar(30) after ref;
alter table llx_societe_adresse_livraison drop column fk_departement;
alter table llx_user change datelastaccess datelastlogin datetime;
alter table llx_user add column datepreviouslogin datetime after datelastlogin;
alter table llx_user add column ldap_sid varchar(255) DEFAULT NULL;
alter table llx_user add column statut tinyint DEFAULT 1;
alter table llx_user add column lang varchar(6);
alter table llx_user add column pass_crypted varchar(128) after pass;
alter table llx_user add column office_phone varchar(20);
alter table llx_user add column office_fax varchar(20);
alter table llx_user add column user_mobile varchar(20);
alter table llx_user modify login varchar(24) NOT NULL;
alter table llx_user drop code;
update llx_user set pass_crypted = MD5(pass) where pass IS NOT NULL AND pass_crypted IS NULL and length(pass) < 32;
update llx_user set pass_crypted = pass where pass IS NOT NULL AND pass_crypted IS NULL and length(pass) = 32;
update llx_user set pass = NULL where length(pass) = 32;
ALTER TABLE llx_user modify fk_societe integer;
ALTER TABLE llx_user modify fk_socpeople integer;
alter table llx_user add column fk_member integer after fk_socpeople;
update llx_user set fk_societe = NULL where fk_societe = 0;
update llx_user set fk_socpeople = NULL where fk_socpeople = 0;
update llx_user set fk_member = NULL where fk_member = 0;
ALTER TABLE llx_user DROP INDEX login;
ALTER TABLE llx_user ADD UNIQUE INDEX uk_user_login (login);
ALTER TABLE llx_user ADD INDEX uk_user_fk_societe (fk_societe);
ALTER TABLE llx_user ADD UNIQUE INDEX uk_user_fk_socpeople (fk_socpeople);
ALTER TABLE llx_user ADD UNIQUE INDEX uk_user_fk_member (fk_member);
alter table llx_boxes add column fk_user integer;
alter table llx_commande_fournisseur drop column fk_soc_contact;
alter table llx_commande drop column fk_soc_contact;
alter table llx_livraison drop column fk_soc_contact;
alter table llx_propal drop column fk_soc_contact;
alter table llx_commandedet drop column label;
insert into llx_action_def (rowid,code,titre,description,objet_type) values (3,'NOTIFY_VAL_ORDER_SUUPLIER','Validation commande fournisseur','Déclenché lors de la validation d\'une commande fournisseur','order_supplier');
drop table if exists llx_sqltables;
ALTER IGNORE TABLE llx_categorie_product DROP FOREIGN KEY llx_categorie_product_ibfk_1;
ALTER IGNORE TABLE llx_categorie_product DROP FOREIGN KEY llx_categorie_product_ibfk_2;
ALTER IGNORE TABLE llx_categorie_product DROP FOREIGN KEY llx_categorie_product_ibfk_3;
ALTER IGNORE TABLE llx_categorie_product DROP FOREIGN KEY llx_categorie_product_ibfk_4;
ALTER IGNORE TABLE llx_categorie_product DROP FOREIGN KEY llx_categorie_product_ibfk_5;
ALTER TABLE llx_categorie_product ADD CONSTRAINT fk_categorie_product_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_product ADD CONSTRAINT fk_categorie_product_product_rowid FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
ALTER TABLE llx_categorie_product ADD PRIMARY KEY (fk_categorie, fk_product);
alter table llx_product modify label varchar(255) NOT NULL;
alter table llx_product modify description text;
ALTER TABLE llx_product ADD COLUMN price_base_type varchar(3) DEFAULT 'HT' AFTER price;
ALTER TABLE llx_product ADD COLUMN price_ttc float(12,4) DEFAULT 0 AFTER price_base_type;
alter table llx_product_det modify label varchar(255) NOT NULL;
alter table llx_product_det modify description text;
create table llx_accountingdebcred
(
fk_transaction integer NOT NULL,
fk_account integer NOT NULL,
amount real NOT NULL,
direction varchar(1) NOT NULL
)ENGINE=innodb;
alter table llx_facturedet_rec add column total_ht real;
alter table llx_facturedet_rec add column total_tva real;
alter table llx_facturedet_rec add column total_ttc real;
alter table llx_adherent add column phone varchar(30) after email;
alter table llx_adherent add column phone_perso varchar(30) after phone;
alter table llx_adherent add column phone_mobile varchar(30) after phone_perso;
delete from llx_adherent_type where libelle IS NULL;
alter table llx_adherent_type modify libelle varchar(50) NOT NULL;
update llx_facture set fk_facture_source=null where fk_facture_source is not null and type = 0;
update llx_facture set fk_statut=2 where paye=1;
update llx_facture set fk_statut=2 where close_code is not null and close_code != '' and close_code != 'replaced';
update llx_boxes set fk_user = 0 where fk_user IS NULL;
ALTER TABLE llx_boxes modify fk_user integer default 0 NOT NULL;
-- Supprimme orphelins pour permettre montee de la cle
-- V4 DELETE llx_boxes FROM llx_boxes LEFT JOIN llx_boxes_def ON llx_boxes.box_id = llx_boxes_def.rowid WHERE llx_boxes_def.rowid IS NULL;
ALTER TABLE llx_boxes ADD INDEX idx_boxes_boxid (box_id);
-- V4 ALTER TABLE llx_boxes ADD CONSTRAINT fk_boxes_box_id FOREIGN KEY (box_id) REFERENCES llx_boxes_def (rowid);
ALTER TABLE llx_boxes ADD INDEX idx_boxes_fk_user (fk_user);
create table llx_categorie_fournisseur
(
fk_categorie integer NOT NULL,
fk_societe integer NOT NULL,
UNIQUE (fk_categorie, fk_societe)
)ENGINE=innodb;
create table llx_fournisseur_ca
(
fk_societe integer,
date_calcul datetime,
year smallint UNSIGNED,
ca_genere float,
UNIQUE (fk_societe, year)
)ENGINE=innodb;
alter table llx_fournisseur_ca add ca_achat float(11,2) DEFAULT 0;
create table llx_product_ca
(
fk_product integer,
date_calcul datetime,
year smallint UNSIGNED,
ca_genere float,
UNIQUE (fk_product, year)
)ENGINE=innodb;
create table llx_commande_fournisseur_dispatch
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_commande integer,
fk_product integer,
qty float, -- quantit<69>
fk_entrepot integer,
fk_user integer,
datec datetime
)ENGINE=innodb;
ALTER TABLE llx_commande_fournisseur_dispatch ADD INDEX (fk_commande);
create table llx_stock_valorisation
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp, -- date technique mise a jour automatiquement
date_valo datetime, -- date de valorisation
fk_product integer NOT NULL, -- id du produit concerne par l'operation
qty_ope float(9,3), -- quantite de l'operation
price_ope float(12,4), -- prix unitaire du produit concerne par l'operation
valo_ope float(12,4), -- valorisation de l'operation
price_pmp float(12,4), -- valeur PMP de l'operation
qty_stock float(9,3) DEFAULT 0, -- qunatite en stock
valo_pmp float(12,4), -- valorisation du stock en PMP
fk_stock_mouvement integer, -- id du mouvement de stock
key(fk_product)
)ENGINE=innodb;
create table llx_entrepot_valorisation
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp, -- date technique mise a jour automatiquement
date_calcul date, -- date auquel a ete calcule la valeur
fk_entrepot integer UNSIGNED NOT NULL ,
valo_pmp float(12,4), -- valoristaion du stock en PMP
key(fk_entrepot)
)ENGINE=innodb;
ALTER TABLE llx_entrepot ADD COLUMN valo_pmp float(12,4) DEFAULT 0;
create table llx_user_entrepot
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_entrepot integer UNSIGNED, -- pointe sur llx_entrepot
fk_user integer UNSIGNED, -- pointe sur llx_user
consult tinyint(1) UNSIGNED,
send tinyint(1) UNSIGNED
)ENGINE=innodb;
create table llx_product_subproduct
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_product integer NOT NULL, -- id du produit maitre
fk_product_subproduct integer NOT NULL, -- id du sous-produit
UNIQUE(fk_product, fk_product_subproduct)
)ENGINE=innodb;
create table llx_bordereau_cheque
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
datec datetime,
date_bordereau date,
number mediumint,
amount float(12,2),
nbcheque smallint UNSIGNED DEFAULT 0,
fk_bank_account integer,
fk_user_author integer,
note text,
statut tinyint(1) UNSIGNED DEFAULT 0
)ENGINE=innodb;
alter table llx_product_price add price_level tinyint(4) NULL DEFAULT 1;
alter table llx_product_price add column price_ttc float(12,4) DEFAULT 0 after price;
alter table llx_product_price add column price_base_type varchar(3) DEFAULT 'HT' after price_ttc;
ALTER TABLE llx_document_model ADD UNIQUE uk_document_model (nom,type);
ALTER TABLE llx_chargesociales drop column date_pai;
UPDATE llx_facture SET type=0 where type=3;
create table llx_export_model
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(50) NOT NULL,
type varchar(20) NOT NULL,
field text
)ENGINE=innodb;
ALTER table llx_export_model add fk_user integer DEFAULT 0 NOT NULL after rowid;
ALTER TABLE llx_export_model ADD UNIQUE uk_export_model (label);
UPDATE llx_rights_def SET ID=ID+1001 WHERE ID BETWEEN 180 AND 189 AND module='fournisseur';
UPDATE llx_user_rights SET fk_id=fk_id+1001 WHERE fk_id BETWEEN 180 AND 189;
UPDATE llx_usergroup_rights SET fk_id=fk_id+1001 WHERE fk_id BETWEEN 180 AND 189;
UPDATE llx_rights_def SET ID=ID+1000 WHERE ID BETWEEN 230 AND 236 AND module='fournisseur';
UPDATE llx_user_rights SET fk_id=fk_id+1000 WHERE fk_id BETWEEN 230 AND 236;
UPDATE llx_usergroup_rights SET fk_id=fk_id+1000 WHERE fk_id BETWEEN 230 AND 236;
UPDATE llx_rights_def SET ID=ID+1 WHERE ID BETWEEN 1320 AND 1320 AND module='facture';
UPDATE llx_user_rights SET fk_id=fk_id+1 WHERE fk_id BETWEEN 1320 AND 1320;
UPDATE llx_usergroup_rights SET fk_id=fk_id+1 WHERE fk_id BETWEEN 1320 AND 1320;
UPDATE llx_rights_def SET ID=ID+1 WHERE ID BETWEEN 1420 AND 1420 AND module='commande';
UPDATE llx_user_rights SET fk_id=fk_id+1 WHERE fk_id BETWEEN 1420 AND 1420;
UPDATE llx_usergroup_rights SET fk_id=fk_id+1 WHERE fk_id BETWEEN 1420 AND 1420;
-- Not used. Just to be compatible with upgrade process of higher versions
alter table llx_const add column entity integer DEFAULT 1 NOT NULL;

File diff suppressed because it is too large Load Diff

View File

@ -1,351 +0,0 @@
--
-- Attention a l ordre des requetes.
-- Ce fichier doit etre charge sur une version 2.2.0
--
DROP TABLE llx_facture_tva_sum;
DROP TABLE llx_c_ape;
delete from llx_const where name='MAIN_GRAPH_LIBRARY' and (value like 'phplot%' or value like 'artichow%');
ALTER TABLE llx_societe_adresse_livraison ADD COLUMN tel varchar(20) after fk_pays;
ALTER TABLE llx_societe_adresse_livraison ADD COLUMN fax varchar(20) after tel;
RENAME TABLE llx_c_barcode TO llx_c_barcode_type;
alter table llx_c_barcode_type modify coder varchar(16) NOT NULL;
update llx_c_barcode_type set coder = 0 where coder in (1,2);
update llx_const set value='' where name='MAIN_FORCE_SETLOCALE_LC_ALL' and value='MAIN_FORCE_SETLOCALE_LC_ALL';
update llx_const set value='' where name='MAIN_FORCE_SETLOCALE_LC_MONETARY' and value='MAIN_FORCE_SETLOCALE_LC_MONETARY';
update llx_const set value='' where name='MAIN_FORCE_SETLOCALE_LC_NUMERIC' and value='MAIN_FORCE_SETLOCALE_LC_NUMERIC';
update llx_const set value='' where name='MAIN_FORCE_SETLOCALE_LC_TIME' and value='MAIN_FORCE_SETLOCALE_LC_TIME';
-- remove old deprecated options
update llx_const set name='SOCIETE_CODECLIENT_ADDON' where name='CODECLIENT_ADDON';
update llx_const set name='SOCIETE_CODEFOURNISSEUR_ADDON' where name='CODEFOURNISSEUR_ADDON';
delete from llx_const where name='CODECLIENT_ADDON';
delete from llx_const where name='CODEFOURNISSEUR_ADDON';
alter table llx_const add tms timestamp;
update llx_const set tms=sysdate() where tms is null;
update llx_const set tms=sysdate() where tms <= 0;
alter table llx_document_model modify type varchar(20) NOT NULL;
DELETE FROM llx_rights_def WHERE module = 'menudb';
ALTER table llx_boxes_def drop column name;
ALTER table llx_boxes_def add column tms timestamp;
-- Rename primary key of llx_menu
ALTER TABLE llx_menu_const drop foreign key fk_menu_const_fk_menu;
alter table llx_menu drop primary key;
alter table llx_menu modify rowid integer AUTO_INCREMENT NOT NULL PRIMARY KEY;
ALTER TABLE llx_menu_const ADD CONSTRAINT fk_menu_const_fk_menu FOREIGN KEY (fk_menu) REFERENCES llx_menu (rowid);
alter table llx_menu modify user integer NOT NULL default '0';
alter table llx_menu change `order` position integer NOT NULL;
alter table llx_menu change `right` perms varchar(255);
alter table llx_menu add column module varchar(64) after menu_handler;
alter table llx_menu add column tms timestamp;
-- Add a unique key
update llx_menu set url='/comm/prospect/prospects.php?leftmenu=prospects' where rowid=702 and url='/contact/index.php?leftmenu=prospects&type=p';
ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, url);
-- Drop unused table
drop table if exists llx_so_gr;
-- Modification expedition
create table llx_co_exp
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_commande integer NOT NULL,
fk_expedition integer NOT NULL,
key(fk_commande),
key(fk_expedition)
)ENGINE=innodb;
-- V4 ALTER TABLE llx_expedition DROP INDEX fk_expedition_methode;
-- V4 ALTER TABLE llx_expedition DROP INDEX fk_commande;
-- V4 ALTER TABLE llx_expedition DROP INDEX ref;
-- V4 ALTER TABLE llx_expeditiondet DROP INDEX fk_expedition;
-- V4 ALTER TABLE llx_expeditiondet DROP INDEX fk_commande_ligne;
-- V4.1 update llx_commande set fk_adresse_livraison = null where fk_adresse_livraison is not null and fk_adresse_livraison not in (select rowid from llx_societe_adresse_livraison);
-- V4.1 delete from llx_expeditiondet where fk_expedition not in (select rowid from llx_expedition);
-- V4.1 delete from llx_livraisondet where fk_livraison not in (select rowid from llx_livraison);
alter table llx_expedition add column fk_soc integer NOT NULL after ref;
alter table llx_expedition add column fk_adresse_livraison integer DEFAULT NULL after date_expedition;
-- V4.1 UPDATE llx_expedition as e SET e.fk_soc = (SELECT c.fk_soc FROM llx_commande AS c WHERE e.fk_commande = c.rowid);
-- V4.1 UPDATE llx_expedition as e SET e.fk_adresse_livraison = (SELECT c.fk_adresse_livraison FROM llx_commande AS c WHERE e.fk_commande = c.rowid);
update llx_expedition set fk_adresse_livraison=NULL where fk_adresse_livraison = 0;
ALTER TABLE llx_expedition ADD INDEX idx_expedition_fk_soc (fk_soc);
ALTER TABLE llx_expedition ADD INDEX idx_expedition_fk_user_author (fk_user_author);
ALTER TABLE llx_expedition ADD INDEX idx_expedition_fk_user_valid (fk_user_valid);
ALTER TABLE llx_expedition ADD INDEX idx_expedition_fk_adresse_livraison (fk_adresse_livraison);
ALTER TABLE llx_expedition ADD INDEX idx_expedition_fk_expedition_methode (fk_expedition_methode);
-- V4 ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
-- V4 ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
-- V4 ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
-- V4 ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_adresse_livraison FOREIGN KEY (fk_adresse_livraison) REFERENCES llx_societe_adresse_livraison (rowid);
-- V4 ALTER TABLE llx_expedition ADD CONSTRAINT fk_expedition_fk_expedition_methode FOREIGN KEY (fk_expedition_methode) REFERENCES llx_expedition_methode (rowid);
ALTER TABLE llx_expedition ADD UNIQUE INDEX idx_expedition_uk_ref (ref);
ALTER TABLE llx_expeditiondet CHANGE fk_commande_ligne fk_origin_line integer;
ALTER TABLE llx_expeditiondet ADD COLUMN fk_entrepot integer after fk_origin_line;
ALTER TABLE llx_expeditiondet ADD COLUMN rang integer DEFAULT 0 after qty;
-- V4.1 UPDATE llx_expeditiondet as ed SET ed.fk_entrepot = (SELECT e.fk_entrepot FROM llx_expedition AS e WHERE ed.fk_expedition = e.rowid);
ALTER TABLE llx_expedition DROP COLUMN fk_entrepot;
ALTER TABLE llx_expeditiondet ADD INDEX idx_expeditiondet_fk_expedition (fk_expedition);
ALTER TABLE llx_expeditiondet ADD INDEX idx_expeditiondet_fk_entrepot (fk_entrepot);
-- V4 ALTER TABLE llx_expeditiondet ADD CONSTRAINT fk_expeditiondet_fk_expedition FOREIGN KEY (fk_expedition) REFERENCES llx_expedition (rowid);
-- V4 ALTER TABLE llx_expeditiondet ADD CONSTRAINT fk_expeditiondet_fk_entrepot FOREIGN KEY (fk_entrepot) REFERENCES llx_entrepot (rowid);
-- Modification livraison
create table llx_co_liv
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_commande integer NOT NULL,
fk_livraison integer NOT NULL,
key(fk_commande),
key(fk_livraison)
)ENGINE=innodb;
-- V4 ALTER TABLE llx_livraison DROP INDEX fk_commande;
-- V4 ALTER TABLE llx_livraison DROP INDEX ref;
-- V4 ALTER TABLE llx_livraisondet DROP INDEX fk_livraison;
-- V4 ALTER TABLE llx_livraisondet DROP INDEX fk_commande_ligne;
ALTER TABLE llx_livraison DROP COLUMN total_ttc;
ALTER TABLE llx_livraison add column total_ht double(24,8) DEFAULT 0;
ALTER TABLE llx_livraison MODIFY total_ht double(24,8) DEFAULT 0;
ALTER TABLE llx_livraison MODIFY fk_adresse_livraison integer DEFAULT NULL;
alter table llx_livraison add column ref_client varchar(30) after ref;
alter table llx_livraison add column fk_soc integer NOT NULL after ref_client;
UPDATE llx_livraison SET fk_adresse_livraison = NULL WHERE fk_adresse_livraison = 0;
-- V4.1 UPDATE llx_livraison as l SET l.fk_soc = (SELECT c.fk_soc FROM llx_commande AS c WHERE l.fk_commande = c.rowid);
ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_soc (fk_soc);
ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_user_author (fk_user_author);
ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_user_valid (fk_user_valid);
ALTER TABLE llx_livraison ADD INDEX idx_livraison_fk_adresse_livraison (fk_adresse_livraison);
-- V4 ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
-- V4 ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
-- V4 ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
-- V4 ALTER TABLE llx_livraison ADD CONSTRAINT fk_livraison_fk_adresse_livraison FOREIGN KEY (fk_adresse_livraison) REFERENCES llx_societe_adresse_livraison (rowid);
ALTER TABLE llx_livraison ADD UNIQUE INDEX idx_livraison_uk_ref (ref);
alter table llx_livraisondet add column fk_product integer after fk_livraison;
alter table llx_livraisondet add column description text after fk_product;
alter table llx_livraisondet add column subprice double(24,8) DEFAULT 0 after qty;
alter table llx_livraisondet add column total_ht double(24,8) DEFAULT 0 after subprice;
alter table llx_livraisondet add column rang integer DEFAULT 0 after total_ht;
ALTER TABLE llx_livraisondet ADD INDEX idx_livraisondet_fk_expedition (fk_livraison);
-- V4 ALTER TABLE llx_livraisondet ADD CONSTRAINT fk_livraisondet_fk_livraison FOREIGN KEY (fk_livraison) REFERENCES llx_livraison (rowid);
create table llx_pr_exp
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_propal integer NOT NULL,
fk_expedition integer NOT NULL,
key(fk_propal),
key(fk_expedition)
)ENGINE=innodb;
create table llx_pr_liv
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_propal integer NOT NULL,
fk_livraison integer NOT NULL,
key(fk_propal),
key(fk_livraison)
)ENGINE=innodb;
ALTER TABLE llx_paiement modify fk_bank integer NOT NULL DEFAULT 0;
create table llx_element_element
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
sourceid integer NOT NULL,
sourcetype varchar(12) NOT NULL,
targetid integer NOT NULL,
targettype varchar(12) NOT NULL
) ENGINE=innodb;
ALTER TABLE llx_element_element
ADD UNIQUE INDEX idx_element_element_idx1 (sourceid, sourcetype, targetid, targettype);
ALTER TABLE llx_element_element ADD INDEX idx_element_element_targetid (targetid);
ALTER TABLE llx_actioncomm add column fk_user_mod integer after fk_user_author;
ALTER TABLE llx_actioncomm add column fk_user_done integer after fk_user_action;
--drop table if exists llx_events;
create table llx_events
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
type varchar(32) NOT NULL,
dateevent datetime,
fk_user integer,
description varchar(250) NOT NULL,
ip varchar(32) NOT NULL,
fk_object integer
) ENGINE=innodb;
ALTER TABLE llx_events ADD INDEX idx_events_dateevent (dateevent);
ALTER TABLE llx_c_forme_juridique ADD isvatexempted tinyint DEFAULT 0 NOT NULL after libelle;
ALTER TABLE llx_facturedet ADD product_type integer DEFAULT NULL after total_ttc;
ALTER TABLE llx_facture_fourn_det ADD product_type integer DEFAULT NULL after total_ttc;
-- V4.1 update llx_facturedet set product_type = 0 where fk_product in (select rowid from llx_product where fk_product_type = 0);
-- V4.1 update llx_facture_fourn_det set product_type = 0 where fk_product in (select rowid from llx_product where fk_product_type = 0);
-- V4.1 update llx_facturedet set product_type = 1 where fk_product in (select rowid from llx_product where fk_product_type = 1);
-- V4.1 update llx_facture_fourn_det set product_type = 1 where fk_product in (select rowid from llx_product where fk_product_type = 1);
-- V4.1 update llx_facturedet set product_type = 1 where product_type is null;
-- V4.1 update llx_facture_fourn_det set product_type = 1 where product_type is null;
create table llx_c_prospectlevel
(
code varchar(12) PRIMARY KEY,
label varchar(30),
sortorder smallint,
active smallint DEFAULT 1 NOT NULL
) ENGINE=innodb;
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_UNKOWN', 'Unknown', 1);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_LOW', 'Low', 2);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_MEDIUM', 'Medium', 3);
insert into llx_c_prospectlevel (code,label,sortorder) values ('PL_HIGH', 'High', 4);
alter table llx_societe add column fk_prospectlevel varchar(12) after fournisseur;
alter table llx_societe modify tva_assuj tinyint DEFAULT 1;
--update llx_actioncomm set datea = datep where datea is null and percent = 100;
--update llx_actioncomm set datea2 = datea where datea2 is null and percent = 100;
update llx_actioncomm set datep = datea where datep is null and datea is not null;
update llx_actioncomm set datep = datec where datep is null and datea is null;
update llx_actioncomm set datep2 = datep where datep2 is null and percent = 100;
alter table llx_projet modify fk_soc integer;
update llx_rights_def set module='societe' where module='commercial' and perms='client' and subperms='voir';
insert into llx_c_chargesociales (id, libelle, deductible, active, actioncompta) values (25, 'Impots revenus', 0,1,'TAXREV');
alter table llx_socpeople add priv smallint NOT NULL DEFAULT 0 after jabberid;
alter table llx_tva modify fk_bank integer;
delete from llx_const where name='MAIN_USE_PREVIEW_TABS';
alter table llx_menu_const drop column user;
update llx_menu set leftmenu = '1' where leftmenu != '0';
alter table llx_menu modify leftmenu varchar(1) default '1';
create table llx_ecm_directories
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
label varchar(32) NOT NULL,
fk_parent integer,
description varchar(255) NOT NULL,
cachenbofdoc integer NOT NULL DEFAULT 0,
date_c datetime,
date_m timestamp,
fk_user_c integer,
fk_user_m integer
) ENGINE=innodb;
create table llx_ecm_documents
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
ref varchar(16) NOT NULL,
filename varchar(255) NOT NULL,
filesize integer NOT NULL,
filemime varchar(32) NOT NULL,
fullpath_dol varchar(255) NOT NULL,
fullpath_orig varchar(255) NOT NULL,
description text,
manualkeyword text,
fk_create integer NOT NULL,
fk_update integer,
date_c datetime NOT NULL,
date_u timestamp,
fk_directory integer,
fk_status smallint DEFAULT 0,
private smallint DEFAULT 0
) ENGINE=innodb;
ALTER TABLE llx_bank modify num_chq varchar(50);
ALTER TABLE llx_menu_const ADD UNIQUE KEY uk_menu_const(fk_menu, fk_constraint);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (100, 'USLetter', 'Format Letter (A)', '216', '279', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (105, 'USLegal', 'Format Legal', '216', '356', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (110, 'USExecutive', 'Format Executive', '190', '254', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (115, 'USLedger', 'Format Ledger/Tabloid (B)', '279', '432', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (200, 'Canadian P1', 'Format Canadian P1', '560', '860', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (205, 'Canadian P2', 'Format Canadian P2', '430', '560', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (210, 'Canadian P3', 'Format Canadian P3', '280', '430', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (215, 'Canadian P4', 'Format Canadian P4', '215', '280', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (220, 'Canadian P5', 'Format Canadian P5', '140', '215', 'mm', 0);
INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) VALUES (225, 'Canadian P6', 'Format Canadian P6', '107', '140', 'mm', 0);
ALTER TABLE llx_commande_fournisseurdet DROP COLUMN price;
alter table llx_adherent modify fk_user_mod integer;
alter table llx_adherent modify fk_user_valid integer;
create table llx_c_type_fees
(
id integer AUTO_INCREMENT PRIMARY KEY,
code varchar(12) UNIQUE NOT NULL,
libelle varchar(30),
active tinyint DEFAULT 1 NOT NULL
)ENGINE=innodb;
alter table llx_deplacement modify type varchar(12) NOT NULL;
alter table llx_deplacement modify km real;
insert into llx_c_type_fees (code,libelle,active) values ('TF_OTHER', 'Other', 1);
insert into llx_c_type_fees (code,libelle,active) values ('TF_TRIP', 'Trip', 1);
insert into llx_c_type_fees (code,libelle,active) values ('TF_LUNCH', 'Lunch', 1);
drop table llx_comfourn_facfourn;
alter table llx_element_element modify sourcetype varchar(16) NOT NULL;
alter table llx_element_element modify targettype varchar(16) NOT NULL;
update llx_societe set fk_typent = 0 where fk_typent is null;
ALTER TABLE llx_surveys_answers_summary ENGINE=innodb;
-- Not used. Just to be compatible with upgrade process of higher versions
alter table llx_const add column entity integer DEFAULT 1 NOT NULL;
-- Not used. Just to be compatible with 2.7 upgrade process or higher
alter table llx_menu add column enabled varchar(255) NULL default '1';

View File

@ -1,115 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 2.4.0 or higher.
--
alter table llx_product add column price_min double(24,8) DEFAULT 0;
alter table llx_product add column price_min_ttc double(24,8) DEFAULT 0;
alter table llx_product add column finished tinyint DEFAULT NULL after canvas;
alter table llx_product_price add column price_min double(24,8) default NULL;
alter table llx_product_price add column price_min_ttc double(24,8) default NULL;
alter table llx_societe add column gencod varchar(255);
delete from llx_user_param where page <> '';
alter table llx_expedition add column tracking_number varchar(50) after fk_expedition_methode;
alter table llx_actioncomm add column location varchar(128) after percent;
-- remove enum type
alter table llx_adherent_type modify column cotisation varchar(3) NOT NULL DEFAULT 'yes';
alter table llx_adherent_type modify column vote varchar(3) NOT NULL DEFAULT 'yes';
alter table llx_adherent modify column morphy varchar(3) NOT NULL;
alter table llx_c_paper_format modify column unit varchar(5) NOT NULL;
alter table llx_const modify column type varchar(6);
alter table llx_menu modify column type varchar(4) NOT NULL;
alter table llx_notify modify column objet_type varchar(24) NOT NULL;
alter table llx_projet_task_actors modify column role varchar(5) DEFAULT 'admin';
alter table llx_projet_task modify column statut varchar(6) DEFAULT 'open';
alter table llx_rights_def modify column type varchar(1);
ALTER TABLE llx_menu ADD COLUMN enabled varchar(255) NULL default '1' after perms;
ALTER TABLE `llx_commandedet` ADD column `date_start` DATETIME DEFAULT NULL, ADD `date_end` DATETIME DEFAULT NULL ;
alter table llx_categorie add column fk_soc integer DEFAULT NULL after description;
alter table llx_product drop column nbvente;
alter table llx_product add column import_key varchar(14);
alter table llx_socpeople add column import_key varchar(14);
alter table llx_facture add column import_key varchar(14);
alter table llx_facturedet add column import_key varchar(14);
alter table llx_commande add column import_key varchar(14);
alter table llx_commandedet add column import_key varchar(14);
alter table llx_facture_fourn add column import_key varchar(14);
alter table llx_facture_fourn_det add column import_key varchar(14);
alter table llx_commande modify column source smallint NULL;
update llx_c_prospectlevel set code='PL_NONE', label='None' where code='PL_UNKOWN' or code='PL_NONE';
update llx_societe set fk_prospectlevel=null where fk_prospectlevel='PL_UNKOWN';
alter table llx_expedition add height integer;
alter table llx_expedition add width integer;
alter table llx_expedition add size_units integer;
alter table llx_expedition add size integer;
alter table llx_expedition add weight_units integer;
alter table llx_expedition add weight integer;
ALTER TABLE llx_paiement_facture ADD UNIQUE INDEX uk_paiement_facture(fk_paiement, fk_facture);
ALTER TABLE llx_paiementfourn_facturefourn ADD UNIQUE INDEX uk_paiementfourn_facturefourn(fk_paiementfourn, fk_facturefourn);
update llx_expedition_methode set code='ENL', libelle='Enlevement' where code='enlevement';
update llx_expedition_methode set code='TRANS', libelle='Transporteur' where code='transporteur';
alter table llx_fichinterdet modify date datetime;
alter table llx_don modify fk_don_projet integer NULL;
alter table llx_don modify fk_user_valid integer NULL;
alter table llx_don add note_public text;
alter table llx_don add model_pdf varchar(50);
alter table llx_don add import_key varchar(14);
ALTER TABLE llx_export_model DROP INDEX uk_export_model;
ALTER TABLE llx_export_model ADD UNIQUE uk_export_model (label,type);
alter table llx_adherent_options_label add column type varchar(8);
alter table llx_adherent_options_label add column size integer DEFAULT 0;
alter table llx_adherent_options_label add column pos integer DEFAULT 0;
-- Reverse option
update llx_const set visible = 1, name = 'FACTURE_ENABLE_RECUR', value='1' where name = 'FACTURE_DISABLE_RECUR' and value = '0';
delete from llx_const where name = 'FACTURE_DISABLE_RECUR' and value = '1';
delete from llx_const where name like 'MAIN_FASTSEARCH_%';
alter table llx_bank_account modify comment text;
update llx_bank_account set ref = label where ref is null or ref = '';
-- 2.5.1
update llx_actioncomm set datep = datea where datep is null;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (70, 'facture_fourn', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (71, 'facture_fourn', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'facture_fourn', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'facture_fourn', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
alter table llx_product_stock add column pmp double(24,8) default 0 NOT NULL;
alter table llx_expedition_methode change statut active tinyint DEFAULT 1;
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (1,'CATCH','Catch','Catch by client',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (2,'TRANS','Transporter','Generic transporter',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi',0);
-- Not used. Just to be compatible with upgrade process of higher versions
alter table llx_const add column entity integer DEFAULT 1 NOT NULL;
-- Not used. Just to be compatible with 2.7 upgrade process or higher
alter table llx_menu add column enabled varchar(255) NULL default '1';

View File

@ -1,139 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 2.5.0 or higher.
--
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (140,'order_supplier','internal', 'SALESREPFOLL', 'Responsable suivi de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (141,'order_supplier','internal', 'SHIPPING', 'Responsable reception de la commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (142,'order_supplier','external', 'BILLING', 'Contact fournisseur facturation commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (143,'order_supplier','external', 'CUSTOMER', 'Contact fournisseur suivi commande', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (145,'order_supplier','external', 'SHIPPING', 'Contact fournisseur livraison commande', 1);
update llx_const set visible = 1 where name = 'PROPALE_ADD_DELIVERY_ADDRESS';
delete from llx_const where name like 'MAIN_LOGEVENTS_%' and name not like 'MAIN_LOGEVENTS_USER%' and name not like 'MAIN_LOGEVENTS_GROUP%';
delete from llx_events where type not like 'USER%' and type not like 'GROUP%';
alter table llx_expedition_methode change statut active tinyint DEFAULT 1;
update llx_actioncomm set datep = datea where datep is null;
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (1,'CATCH','Catch','Catch by client',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (2,'TRANS','Transporter','Generic transporter',1);
INSERT INTO llx_expedition_methode (rowid,code,libelle,description,active) VALUES (3,'COLSUI','Colissimo Suivi','Colissimo Suivi',0);
UPDATE llx_expedition_methode set code='CATCH', libelle='Catch', description='Catch by client' where rowid=1;
UPDATE llx_expedition_methode set code='TRANS', libelle='Transporter', description='Generic transporter' where rowid=2;
UPDATE llx_expedition_methode set code='COLSUI', libelle='Colissimo Suivi', description='Colissimo Suivi' where rowid=3;
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (70, 'facture_fourn', 'internal', 'SALESREPFOLL', 'Responsable suivi du paiement', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (71, 'facture_fourn', 'external', 'BILLING', 'Contact fournisseur facturation', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (72, 'facture_fourn', 'external', 'SHIPPING', 'Contact fournisseur livraison', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (73, 'facture_fourn', 'external', 'SERVICE', 'Contact fournisseur prestation', 1);
alter table llx_product_stock add column pmp double(24,8) default 0 NOT NULL;
alter table llx_product add column pmp double(24,8) default 0 NOT NULL;
alter table llx_product_stock modify column reel real;
ALTER TABLE llx_bank ADD INDEX idx_bank_datev(datev);
ALTER TABLE llx_bank ADD INDEX idx_bank_dateo(dateo);
ALTER TABLE llx_bank ADD INDEX idx_bank_fk_account(fk_account);
ALTER TABLE llx_bank ADD INDEX idx_bank_rappro(rappro);
ALTER TABLE llx_mailing_cibles add column other varchar(255) NULL;
ALTER TABLE llx_mailing_cibles ADD INDEX idx_mailing_cibles_email (email);
ALTER TABLE llx_categorie ADD INDEX idx_categorie_type (type);
ALTER TABLE llx_product drop column stock_propale;
ALTER TABLE llx_product drop column stock_commande;
ALTER TABLE llx_product add column stock integer after import_key;
ALTER TABLE llx_product ADD INDEX idx_product_barcode (barcode);
ALTER TABLE llx_product ADD INDEX idx_product_import_key (import_key);
ALTER TABLE llx_adherent drop index login;
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_login (login);
ALTER TABLE llx_adherent add column fk_soc integer NULL after societe;
ALTER TABLE llx_adherent ADD INDEX idx_adherent_fk_soc (fk_soc);
ALTER TABLE llx_adherent ADD CONSTRAINT adherent_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
ALTER TABLE llx_adherent modify column fk_user_author integer NULL;
ALTER TABLE llx_societe drop column rubrique;
-- SAINT PIERRE ET MIQUELON
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1931,193, '0','0','No VAT in SPM',1);
-- SAINT MARTIN
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (2461,246, '0','0','VAT Rate 0',1);
insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'35','Regime auto-entrepreneur');
alter table llx_user_param drop column page;
alter table llx_commande_fournisseur_log add column comment varchar(255) NULL;
delete from llx_categorie_association where fk_categorie_mere = fk_categorie_fille;
alter table llx_societe add price_level tinyint(4) NULL;
delete from llx_document_model where nom = 'huitre' and type = 'invoice';
drop table llx_don_projet;
alter table llx_facture_fourn_det add column date_start datetime DEFAULT NULL;
alter table llx_facture_fourn_det add column date_end datetime DEFAULT NULL;
alter table llx_commandedet add column product_type integer DEFAULT 0 after total_ttc;
alter table llx_propaldet add column product_type integer DEFAULT 0 after total_ttc;
alter table llx_propaldet add column date_start datetime DEFAULT NULL after product_type;
alter table llx_propaldet add column date_end datetime DEFAULT NULL after date_start;
alter table llx_commande_fournisseurdet add column product_type integer DEFAULT 0 after total_ttc;
alter table llx_commande_fournisseurdet add column date_start datetime DEFAULT NULL after product_type;
alter table llx_commande_fournisseurdet add column date_end datetime DEFAULT NULL after date_start;
alter table llx_commande_fournisseur drop column product_type;
alter table llx_commande_fournisseur drop column date_start;
alter table llx_commande_fournisseur drop column date_end;
drop table llx_models;
-- V4.1 delete from llx_projet_task where fk_projet not in (select rowid from llx_projet);
-- V4.1 ALTER TABLE llx_projet_task ADD CONSTRAINT fk_projet_task_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
ALTER TABLE llx_adherent modify fk_adherent_type integer NOT NULL;
ALTER TABLE llx_adherent ADD INDEX idx_adherent_fk_adherent_type (fk_adherent_type);
-- V4.1 delete from llx_adherent where fk_adherent_type not in (select rowid from llx_adherent_type);
-- V4.1 ALTER TABLE llx_adherent ADD CONSTRAINT fk_adherent_adherent_type FOREIGN KEY (fk_adherent_type) REFERENCES llx_adherent_type (rowid);
-- Put at the end. Cas have duplicate values
ALTER TABLE llx_categorie_association drop index idx_categorie_association_fk_categorie_fille;
ALTER TABLE llx_categorie_association ADD UNIQUE INDEX uk_categorie_association (fk_categorie_mere, fk_categorie_fille);
ALTER TABLE llx_categorie_association ADD UNIQUE INDEX uk_categorie_association_fk_categorie_fille (fk_categorie_fille);
-- Multi company
ALTER TABLE llx_const ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER name;
ALTER TABLE llx_user ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER login;
ALTER TABLE llx_usergroup ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER nom;
ALTER TABLE llx_const DROP INDEX name;
ALTER TABLE llx_user DROP INDEX uk_user_login;
ALTER TABLE llx_usergroup DROP INDEX nom;
ALTER TABLE llx_const ADD UNIQUE INDEX uk_const (name, entity);
ALTER TABLE llx_user ADD UNIQUE INDEX uk_user_login (login, entity);
ALTER TABLE llx_usergroup ADD UNIQUE INDEX uk_usergroup_name (nom, entity);
-- Not used. Just to be compatible with 2.7 upgrade process or higher
alter table llx_menu add column enabled varchar(255) NULL default '1';

View File

@ -1,476 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 2.6.0 or higher.
--
alter table llx_tmp_caisse modify fk_tva integer NOT NULL;
drop table llx_facture_stats;
drop table llx_stock_valorisation;
drop table llx_entrepot_valorisation;
drop table llx_groupesociete_remise;
drop table llx_groupesociete;
update llx_actioncomm set datep = datec where datep is null and datec is not null;
-- Create new table for import module
create table llx_import_model
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_user integer DEFAULT 0 NOT NULL,
label varchar(50) NOT NULL,
type varchar(20) NOT NULL,
field text NOT NULL
)ENGINE=innodb;
update llx_bank_url set type='banktransfert' where type='?' and label='(banktransfert)';
ALTER TABLE llx_import_model ADD UNIQUE INDEX uk_import_model (label,type);
delete from llx_const where name = 'FACTURE_ENABLE_RECUR';
alter table llx_facturedet_rec add column product_type integer DEFAULT 0 after fk_product;
alter table llx_c_chargesociales change actioncompta code varchar(12) NOT NULL;
alter table llx_c_chargesociales add column fk_pays integer DEFAULT 1 NOT NULL;
-- Usage of llx_menu_const and llx_menu_constraint is too complicated
-- so we made first change to remove it
alter table llx_menu_const drop foreign key fk_menu_const_fk_menu;
update llx_menu_constraint set action = '$conf->societe->enabled' where action = '$conf->commercial->enabled';
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_fk_soc (fk_soc);
alter table llx_facture add column tms timestamp after date_valid;
alter table llx_facture_fourn add column tms timestamp after datef;
alter table llx_facture_fourn add column fk_facture_source integer after fk_user_valid;
update llx_facture set tms = datec where tms <= 0;
update llx_facture_fourn set tms = datec where tms <= 0;
-- Clean no more required parameters
delete from llx_const where name = 'MAIN_MODULE_COMMERCIAL';
delete from llx_const where name like 'MAIN_MODULE_%_DIR_OUTPUT';
delete from llx_const where name like 'MAIN_MODULE_%_DIR_TEMP';
delete from llx_const where name like 'PRODUIT_CONFIRM_DELETE_LINE';
delete from llx_const where name = 'MAIN_MODULE_SYSLOG' and entity = 2;
delete from llx_const where name = 'SYSLOG_FILE' and entity = 2;
delete from llx_const where name = 'SYSLOG_LEVEL' and entity = 2;
alter table llx_societe add column import_key varchar(14);
-- V4.1 delete from llx_paiementfourn where rowid not in (select fk_paiementfourn from llx_paiementfourn_facturefourn);
-- V4.1 delete from llx_paiementfourn_facturefourn where fk_facturefourn not in (select rowid from llx_facture_fourn);
-- Multi company
ALTER TABLE llx_rights_def ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER module;
ALTER TABLE llx_events ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER type;
ALTER TABLE llx_boxes_def ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER file;
ALTER TABLE llx_user_param ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER fk_user;
ALTER TABLE llx_societe ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER nom;
ALTER TABLE llx_socpeople ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER fk_soc;
ALTER TABLE llx_product ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_entrepot ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_chargesociales ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER libelle;
ALTER TABLE llx_tva ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_bank_account ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_document_model ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER nom;
ALTER TABLE llx_menu ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER menu_handler;
ALTER TABLE llx_ecm_directories ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_mailing ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER titre;
ALTER TABLE llx_categorie ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_propal ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_commande ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_commande_fournisseur ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_product_fournisseur ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref_fourn;
ALTER TABLE llx_facture ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER facnumber;
ALTER TABLE llx_expedition ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_facture_fourn ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER facnumber;
ALTER TABLE llx_livraison ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_fichinter ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_contrat ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_c_barcode_type ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER code;
ALTER TABLE llx_dolibarr_modules ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER numero;
ALTER TABLE llx_bank_categ ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER label;
ALTER TABLE llx_bordereau_cheque ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER number;
ALTER TABLE llx_prelevement_bons ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_projet ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_adherent ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
ALTER TABLE llx_adherent_type ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER rowid;
ALTER TABLE llx_adherent_options_label ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER name;
ALTER TABLE llx_facture_rec ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER fk_soc;
ALTER TABLE llx_rights_def DROP PRIMARY KEY;
ALTER TABLE llx_dolibarr_modules DROP PRIMARY KEY;
ALTER TABLE llx_adherent_options_label DROP PRIMARY KEY;
ALTER TABLE llx_adherent_options_label MODIFY COLUMN name varchar(64) NOT NULL;
ALTER TABLE llx_adherent_options_label ADD COLUMN rowid integer AUTO_INCREMENT PRIMARY KEY FIRST;
ALTER TABLE llx_user_param DROP INDEX fk_user;
ALTER TABLE llx_societe DROP INDEX uk_societe_prefix_comm;
ALTER TABLE llx_societe DROP INDEX uk_societe_code_client;
ALTER TABLE llx_product DROP INDEX uk_product_ref;
ALTER TABLE llx_entrepot DROP INDEX label;
ALTER TABLE llx_bank_account DROP INDEX uk_bank_account_label;
ALTER TABLE llx_document_model DROP INDEX uk_document_model;
ALTER TABLE llx_menu DROP INDEX idx_menu_uk_menu;
ALTER TABLE llx_categorie DROP INDEX uk_categorie_ref;
ALTER TABLE llx_propal DROP INDEX ref;
ALTER TABLE llx_commande DROP INDEX ref;
ALTER TABLE llx_commande_fournisseur DROP INDEX uk_commande_fournisseur_ref;
ALTER TABLE llx_product_fournisseur DROP INDEX fk_product;
ALTER TABLE llx_product_fournisseur DROP INDEX fk_soc;
ALTER TABLE llx_facture DROP INDEX idx_facture_uk_facnumber;
ALTER TABLE llx_expedition DROP INDEX idx_expedition_uk_ref;
ALTER TABLE llx_facture_fourn DROP INDEX uk_facture_fourn_ref;
ALTER TABLE llx_livraison DROP INDEX idx_expedition_uk_ref;
ALTER TABLE llx_livraison DROP INDEX idx_livraison_uk_ref;
ALTER TABLE llx_fichinter DROP INDEX ref;
ALTER TABLE llx_prelevement_bons DROP INDEX ref;
ALTER TABLE llx_projet DROP INDEX ref;
ALTER TABLE llx_boxes_def DROP INDEX uk_boxes_def;
ALTER TABLE llx_adherent DROP INDEX uk_adherent_login;
ALTER TABLE llx_adherent_type DROP INDEX uk_adherent_type_libelle;
ALTER TABLE llx_facture_rec DROP INDEX idx_facture_rec_uk_titre;
ALTER TABLE llx_rights_def ADD PRIMARY KEY pk_rights_def (id, entity);
ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity);
ALTER TABLE llx_user_param ADD UNIQUE INDEX uk_user_param (fk_user,param,entity);
ALTER TABLE llx_societe ADD UNIQUE INDEX uk_societe_prefix_comm (prefix_comm, entity);
ALTER TABLE llx_societe ADD UNIQUE INDEX uk_societe_code_client (code_client, entity);
ALTER TABLE llx_product ADD UNIQUE INDEX uk_product_ref (ref, entity);
ALTER TABLE llx_entrepot ADD UNIQUE INDEX uk_entrepot_label (label, entity);
ALTER TABLE llx_bank_account ADD UNIQUE INDEX uk_bank_account_label (label, entity);
ALTER TABLE llx_document_model ADD UNIQUE INDEX uk_document_model (nom, type, entity);
ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, url, entity);
ALTER TABLE llx_categorie ADD UNIQUE INDEX uk_categorie_ref (label, type, entity);
ALTER TABLE llx_propal ADD UNIQUE INDEX uk_propal_ref (ref, entity);
ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity);
ALTER TABLE llx_commande_fournisseur ADD UNIQUE INDEX uk_commande_fournisseur_ref (ref, fk_soc, entity);
ALTER TABLE llx_product_fournisseur ADD UNIQUE INDEX uk_product_fournisseur_ref (ref_fourn, fk_soc, entity);
ALTER TABLE llx_product_fournisseur ADD INDEX idx_product_fourn_fk_product (fk_product, entity);
ALTER TABLE llx_product_fournisseur ADD INDEX idx_product_fourn_fk_soc (fk_soc, entity);
ALTER TABLE llx_facture ADD UNIQUE INDEX idx_facture_uk_facnumber (facnumber, entity);
ALTER TABLE llx_expedition ADD UNIQUE INDEX idx_expedition_uk_ref (ref, entity);
ALTER TABLE llx_facture_fourn ADD UNIQUE INDEX uk_facture_fourn_ref (facnumber, fk_soc, entity);
ALTER TABLE llx_livraison ADD UNIQUE INDEX idx_livraison_uk_ref (ref, entity);
ALTER TABLE llx_fichinter ADD UNIQUE INDEX uk_fichinter_ref (ref, entity);
ALTER TABLE llx_contrat ADD UNIQUE INDEX uk_contrat_ref (ref, entity);
ALTER TABLE llx_bordereau_cheque ADD UNIQUE INDEX uk_bordereau_cheque (number, entity);
ALTER TABLE llx_prelevement_bons ADD UNIQUE INDEX uk_prelevement_bons_ref (ref, entity);
ALTER TABLE llx_projet ADD UNIQUE INDEX uk_projet_ref (ref, entity);
ALTER TABLE llx_boxes_def ADD UNIQUE INDEX uk_boxes_def (file, entity);
ALTER TABLE llx_adherent ADD UNIQUE INDEX uk_adherent_login (login, entity);
ALTER TABLE llx_adherent_type ADD UNIQUE INDEX uk_adherent_type_libelle (libelle, entity);
ALTER TABLE llx_adherent_options_label ADD UNIQUE INDEX uk_adherent_options_label_name (name, entity);
ALTER TABLE llx_facture_rec ADD UNIQUE INDEX idx_facture_rec_uk_titre (titre, entity);
ALTER TABLE llx_projet ADD INDEX idx_projet_fk_soc (fk_soc);
-- V4.1 update llx_projet set fk_soc=null where fk_soc is not null and fk_soc not in (select rowid from llx_societe);
ALTER TABLE llx_projet ADD CONSTRAINT fk_projet_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
ALTER TABLE llx_facture_rec ADD CONSTRAINT fk_facture_rec_fk_soc FOREIGN KEY (fk_soc) REFERENCES llx_societe (rowid);
UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_USER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_POPUP_CALENDAR' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MAIL_SMTP_SERVER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MAIL_SMTP_PORT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_UPLOAD_DOC' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_FEATURES_LEVEL' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_SOCIETE' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_CONTACT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_PRODUITSERVICE' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SEARCHFORM_ADHERENT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SIZE_LISTE_LIMIT' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_SHOW_WORKBOARD' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='SOCIETE_NOLIST_COURRIER' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='GENBARCODE_LOCATION' AND entity=1;
UPDATE llx_const SET entity=0 WHERE name='MAIN_MODULE_SYSLOG';
UPDATE llx_const SET entity=0 WHERE name='SYSLOG_FILE';
UPDATE llx_const SET entity=0 WHERE name='SYSLOG_LEVEL';
-- Fix to solve forgoten names on keys
ALTER TABLE llx_dolibarr_modules drop primary KEY;
ALTER TABLE llx_dolibarr_modules ADD PRIMARY KEY pk_dolibarr_modules (numero, entity);
ALTER TABLE llx_events add column user_agent varchar(128) NULL after ip;
alter table llx_commande_fournisseur add column ref_supplier varchar(30) after entity;
alter table llx_mailing add column bgcolor varchar(8) after body;
alter table llx_mailing add column bgimage varchar(255) after bgcolor;
-- Added US states
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (1101, 11, 1101, '', 0, 'United-States', 1);
--
-- Provinces US
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AL', 1101, '', 0, 'ALABAMA', 'Alabama', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AK', 1101, '', 0, 'ALASKA', 'Alaska', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AZ', 1101, '', 0, 'ARIZONA', 'Arizona', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('AR', 1101, '', 0, 'ARKANSAS', 'Arkansas', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CA', 1101, '', 0, 'CALIFORNIA', 'California', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CO', 1101, '', 0, 'COLORADO', 'Colorado', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('CT', 1101, '', 0, 'CONNECTICUT', 'Connecticut', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('DE', 1101, '', 0, 'DELAWARE', 'Delaware', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('FL', 1101, '', 0, 'FLORIDA', 'Florida', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('GA', 1101, '', 0, 'GEORGIA', 'Georgia', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('HI', 1101, '', 0, 'HAWAII', 'Hawaii', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ID', 1101, '', 0, 'IDAHO', 'Idaho', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IL', 1101, '', 0, 'ILLINOIS','Illinois', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IN', 1101, '', 0, 'INDIANA', 'Indiana', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('IA', 1101, '', 0, 'IOWA', 'Iowa', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('KS', 1101, '', 0, 'KANSAS', 'Kansas', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('KY', 1101, '', 0, 'KENTUCKY', 'Kentucky', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('LA', 1101, '', 0, 'LOUISIANA', 'Louisiana', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ME', 1101, '', 0, 'MAINE', 'Maine', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MD', 1101, '', 0, 'MARYLAND', 'Maryland', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MA', 1101, '', 0, 'MASSACHUSSETTS', 'Massachusetts', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MI', 1101, '', 0, 'MICHIGAN', 'Michigan', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MN', 1101, '', 0, 'MINNESOTA', 'Minnesota', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MS', 1101, '', 0, 'MISSISSIPPI', 'Mississippi', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MO', 1101, '', 0, 'MISSOURI', 'Missouri', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('MT', 1101, '', 0, 'MONTANA', 'Montana', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NE', 1101, '', 0, 'NEBRASKA', 'Nebraska', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NV', 1101, '', 0, 'NEVADA', 'Nevada', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NH', 1101, '', 0, 'NEW HAMPSHIRE', 'New Hampshire', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NJ', 1101, '', 0, 'NEW JERSEY', 'New Jersey', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NM', 1101, '', 0, 'NEW MEXICO', 'New Mexico', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NY', 1101, '', 0, 'NEW YORK', 'New York', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('NC', 1101, '', 0, 'NORTH CAROLINA', 'North Carolina', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('ND', 1101, '', 0, 'NORTH DAKOTA', 'North Dakota', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OH', 1101, '', 0, 'OHIO', 'Ohio', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OK', 1101, '', 0, 'OKLAHOMA', 'Oklahoma', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('OR', 1101, '', 0, 'OREGON', 'Oregon', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('PA', 1101, '', 0, 'PENNSYLVANIA', 'Pennsylvania', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('RI', 1101, '', 0, 'RHODE ISLAND', 'Rhode Island', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('SC', 1101, '', 0, 'SOUTH CAROLINA', 'South Carolina', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('SD', 1101, '', 0, 'SOUTH DAKOTA', 'South Dakota', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('TN', 1101, '', 0, 'TENNESSEE', 'Tennessee', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('TX', 1101, '', 0, 'TEXAS', 'Texas', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('UT', 1101, '', 0, 'UTAH', 'Utah', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('VT', 1101, '', 0, 'VERMONT', 'Vermont', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('VA', 1101, '', 0, 'VIRGINIA', 'Virginia', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WA', 1101, '', 0, 'WASHINGTON', 'Washington', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WV', 1101, '', 0, 'WEST VIRGINIA', 'West Virginia', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WI', 1101, '', 0, 'WISCONSIN', 'Wisconsin', 1);
insert into llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) values ('WY', 1101, '', 0, 'WYOMING', 'Wyoming', 1);
alter table llx_facture_fourn_det add column ref varchar(50) after fk_product;
alter table llx_facture_fourn_det add column label varchar(255) after ref;
alter table llx_societe_rib modify column iban_prefix varchar(34);
alter table llx_bank_account modify column iban_prefix varchar(34);
alter table llx_projet add column datec date after fk_statut;
delete from llx_action_def;
insert into llx_action_def (rowid,code,titre,description,objet_type) values (1,'NOTIFY_VAL_FICHINTER','Validation fiche intervention','Executed when a intervention is validated','ficheinter');
insert into llx_action_def (rowid,code,titre,description,objet_type) values (2,'NOTIFY_VAL_FAC','Validation facture client','Executed when a customer invoice is approved','facture');
insert into llx_action_def (rowid,code,titre,description,objet_type) values (3,'NOTIFY_APP_ORDER_SUPPLIER','Approbation commande fournisseur','Executed when a supplier order is approved','order_supplier');
insert into llx_action_def (rowid,code,titre,description,objet_type) values (4,'NOTIFY_REF_ORDER_SUPPLIER','Refus commande fournisseur','Executed when a supplier order is refused','order_supplier');
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 51, 5, '19','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 52, 5, '7','0','VAT reduced rate', 1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 53, 5, '0','0','VAT Rate 0', 1);
-- Add rule to avoid duplicate use of discount
update llx_facturedet set fk_remise_except = null where fk_remise_except = 0;
ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except);
-- Add Mauritius
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15201', 'Mauritius Private Company Limited By Shares', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15202', 'Mauritius Company Limited By Guarantee', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15203', 'Mauritius Public Company Limited By Shares', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15204', 'Mauritius Foreign Company', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15205', 'Mauritius GBC1 (Offshore Company)', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15206', 'Mauritius GBC2 (International Company)', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15207', 'Mauritius General Partnership', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15208', 'Mauritius Limited Partnership', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15209', 'Mauritius Sole Proprietorship', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (152, '15210', 'Mauritius Trusts', 1);
insert into llx_c_currencies ( code, code_iso, active, label ) values ( 'MU', 'MUR', 1, 'Roupies mauritiennes');
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1521,152, '0','0','VAT Rate 0',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (1522,152, '15','0','VAT Rate 15',1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15201, 152, 15201, '', 0, 'Rivière Noire', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15202, 152, 15202, '', 0, 'Flacq', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15203, 152, 15203, '', 0, 'Grand Port', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15204, 152, 15204, '', 0, 'Moka', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15205, 152, 15205, '', 0, 'Pamplemousses', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15206, 152, 15206, '', 0, 'Plaines Wilhems', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15207, 152, 15207, '', 0, 'Port-Louis', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15208, 152, 15208, '', 0, 'Rivière du Rempart', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15209, 152, 15209, '', 0, 'Savanne', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15210, 152, 15210, '', 0, 'Rodrigues', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15211, 152, 15211, '', 0, 'Les îles Agaléga', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (15212, 152, 15212, '', 0, 'Les écueils des Cargados Carajos', 1);
alter table llx_const modify column name varchar(255) NOT NULL;
alter table llx_const modify column value text NOT NULL;
-- SWEDEN (id 20)
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (201,20, '25','0','VAT standard rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (202,20, '12','0','VAT reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (203,20, '6','0','VAT super-reduced rate',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (204,20, '0','0','VAT Rate 0', 1);
-- Regions Suisse (id pays=6)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (601, 6, 601, '', 1, 'Cantons', 1);
-- Cantons Suisse
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'AG','ARGOVIE','Argovie',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'AI','APPENZELL RHODES INTERIEURES','Appenzell Rhodes intérieures',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'AR','APPENZELL RHODES EXTERIEURES','Appenzell Rhodes extérieures',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'BE','BERNE','Berne',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'BL','BALE CAMPAGNE','Bâle Campagne',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'BS','BALE VILLE','Bâle Ville',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'FR','FRIBOURG','Fribourg',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'GE','GENEVE','Genève',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'GL','GLARIS','Glaris',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'GR','GRISONS','Grisons',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'JU','JURA','Jura',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'LU','LUCERNE','Lucerne',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'NE','NEUCHATEL','Neuchâtel',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'NW','NIDWALD','Nidwald',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'OW','OBWALD','Obwald',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'SG','SAINT-GALL','Saint-Gall',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'SH','SCHAFFHOUSE','Schaffhouse',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'SO','SOLEURE','Soleure',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'SZ','SCHWYZ','Schwyz',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'TG','THURGOVIE','Thurgovie',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'TI','TESSIN','Tessin',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'UR','URI','Uri',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'VD','VAUD','Vaud',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'VS','VALAIS','Valais',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'ZG','ZUG','Zug',1);
INSERT INTO llx_c_departements (fk_region, code_departement, ncc, nom, active) VALUES (601,'ZH','ZURICH','Zürich',1);
-- Regions spain (id pays=4)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (401, 4, 401, '', 0, 'Andalucia', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (402, 4, 402, '', 0, 'Aragón', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (403, 4, 403, '', 0, 'Castilla y León', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (404, 4, 404, '', 0, 'Castilla la Mancha', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (405, 4, 405, '', 0, 'Canarias', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (406, 4, 406, '', 0, 'Cataluña', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (407, 4, 407, '', 0, 'Comunidad de Ceuta', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (408, 4, 408, '', 0, 'Comunidad Foral de Navarra', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (409, 4, 409, '', 0, 'Comunidad de Melilla', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (410, 4, 410, '', 0, 'Cantabria', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (411, 4, 411, '', 0, 'Comunidad Valenciana', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (412, 4, 412, '', 0, 'Extemadura', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (413, 4, 413, '', 0, 'Galicia', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (414, 4, 414, '', 0, 'Islas Baleares', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (415, 4, 415, '', 0, 'La Rioja', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (416, 4, 416, '', 0, 'Comunidad de Madrid', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (417, 4, 417, '', 0, 'Región de Murcia', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (418, 4, 418, '', 0, 'Principado de Asturias', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (419, 4, 419, '', 0, 'Pais Vasco', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (420, 4, 420, '', 0, 'Otros', 1);
-- Provinces Spain
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('01', 419, '', 19, 'PAIS VASCO', 'País Vasco', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('02', 404, '', 4, 'ALBACETE', 'Albacete', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('03', 411, '', 11, 'ALICANTE', 'Alicante', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('04', 401, '', 1, 'ALMERIA', 'Almería', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('05', 403, '', 3, 'AVILA', 'Avila', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('06', 412, '', 12, 'BADAJOZ', 'Badajoz', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('07', 414, '', 14, 'ISLAS BALEARES', 'Islas Baleares', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('08', 406, '', 6, 'BARCELONA', 'Barcelona', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('09', 403, '', 8, 'BURGOS', 'Burgos', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('10', 412, '', 12, 'CACERES', 'Cáceres', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('11', 401, '', 1, 'CADIz', 'Cádiz', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('12', 411, '', 11, 'CASTELLON', 'Castellón', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('13', 404, '', 4, 'CIUDAD REAL', 'Ciudad Real', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('14', 401, '', 1, 'CORDOBA', 'Córdoba', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('15', 413, '', 13, 'LA CORUÑA', 'La Coruña', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('16', 404, '', 4, 'CUENCA', 'Cuenca', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('17', 406, '', 6, 'GERONA', 'Gerona', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('18', 401, '', 1, 'GRANADA', 'Granada', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('19', 404, '', 4, 'GUADALAJARA', 'Guadalajara', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('20', 419, '', 19, 'GUIPUZCOA', 'Guipúzcoa', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('21', 401, '', 1, 'HUELVA', 'Huelva', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('22', 402, '', 2, 'HUESCA', 'Huesca', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('23', 401, '', 1, 'JAEN', 'Jaén', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('24', 403, '', 3, 'LEON', 'León', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('25', 406, '', 6, 'LERIDA', 'Lérida', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('26', 415, '', 15, 'LA RIOJA', 'La Rioja', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('27', 413, '', 13, 'LUGO', 'Lugo', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('28', 416, '', 16, 'MADRID', 'Madrid', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('29', 401, '', 1, 'MALAGA', 'Málaga', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('30', 417, '', 17, 'MURCIA', 'Murcia', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('31', 408, '', 8, 'NAVARRA', 'Navarra', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('32', 413, '', 13, 'ORENSE', 'Orense', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('33', 418, '', 18, 'ASTURIAS', 'Asturias', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('34', 403, '', 3, 'PALENCIA', 'Palencia', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('35', 405, '', 5, 'LAS PALMAS', 'Las Palmas', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('36', 413, '', 13, 'PONTEVEDRA', 'Pontevedra', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('37', 403, '', 3, 'SALAMANCA', 'Salamanca', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('38', 405, '', 5, 'STA. CRUZ DE TENERIFE', 'Sta. Cruz de Tenerife', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('39', 410, '', 10, 'CANTABRIA', 'Cantabria', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('40', 403, '', 3, 'SEGOVIA', 'Segovia', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('41', 401, '', 1, 'SEVILLA', 'Sevilla', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('42', 403, '', 3, 'SORIA', 'Soria', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('43', 406, '', 6, 'TARRAGONA', 'Tarragona', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('44', 402, '', 2, 'TERUEL', 'Teruel', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('45', 404, '', 5, 'TOLEDO', 'Toledo', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('46', 411, '', 11, 'VALENCIA', 'Valencia', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('47', 403, '', 3, 'VALLADOLID', 'Valladolid', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('48', 419, '', 19, 'VIZCAYA', 'Vizcaya', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('49', 403, '', 3, 'ZAMORA', 'Zamora', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('50', 402, '', 1, 'ZARAGOZA', 'Zaragoza', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('51', 407, '', 7, 'CEUTA', 'Ceuta', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('52', 409, '', 9, 'MELILLA', 'Melilla', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('53', 420, '', 20, 'OTROS', 'Otros', 1);
alter table llx_product_price modify price_level smallint NULL DEFAULT 1;
alter table llx_commandedet modify special_code integer UNSIGNED DEFAULT 0;
alter table llx_facturedet modify special_code integer UNSIGNED DEFAULT 0;
alter table llx_propaldet modify special_code integer UNSIGNED DEFAULT 0;
alter table llx_societe modify special_code integer NULL;
alter table llx_c_forme_juridique modify code integer NOT NULL;
ALTER TABLE llx_bank_class ADD UNIQUE INDEX idx_bank_class_lineid (lineid);
ALTER TABLE llx_c_ecotaxe ADD UNIQUE INDEX uk_c_ecotaxe (code);
ALTER TABLE llx_c_methode_commande_fournisseur ADD UNIQUE INDEX uk_c_methode_commande_fournisseur (code);
ALTER TABLE llx_menu change user usertype integer NOT NULL default '0';
-- Rename index
ALTER TABLE llx_adherent_options MODIFY COLUMN optid integer;
ALTER TABLE llx_adherent_options DROP PRIMARY KEY;
ALTER TABLE llx_adherent_options DROP INDEX uk_adherent_options;
ALTER TABLE llx_adherent_options DROP INDEX idx_adherent_options;
ALTER TABLE llx_adherent_options DROP INDEX adhid;
ALTER TABLE llx_adherent_options CHANGE optid rowid integer AUTO_INCREMENT PRIMARY KEY;
ALTER TABLE llx_adherent_options CHANGE adhid fk_member integer NOT NULL;
ALTER TABLE llx_adherent_options ADD INDEX idx_adherent_options (fk_member);
ALTER TABLE llx_adherent DROP INDEX idx_adherent_fk_soc;
ALTER TABLE llx_propaldet ADD INDEX idx_propaldet_fk_propal (fk_propal);
-- V4.1 delete from llx_propaldet where fk_propal not in (select rowid from llx_propal);
ALTER TABLE llx_propaldet ADD CONSTRAINT fk_propaldet_fk_propal FOREIGN KEY (fk_propal) REFERENCES llx_propal (rowid);
ALTER TABLE llx_bank_class DROP INDEX idx_bank_class_lineid;
ALTER TABLE llx_bank_class DROP INDEX uk_bank_class_lineid;
ALTER TABLE llx_bank_class ADD UNIQUE INDEX uk_bank_class_lineid (lineid, fk_categ);
-- Not used. Just to be compatible with 2.7 upgrade process or higher
alter table llx_menu add column enabled varchar(255) NULL default '1';

View File

@ -1,211 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 2.7.0 or higher.
--
ALTER TABLE llx_actioncomm CHANGE fk_projet fk_project integer;
ALTER TABLE llx_don ADD COLUMN ref varchar(30) DEFAULT NULL AFTER rowid;
ALTER TABLE llx_don ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_stock_mouvement ADD COLUMN label varchar(128);
ALTER TABLE llx_deplacement ADD COLUMN ref varchar(30) DEFAULT NULL AFTER rowid;
ALTER TABLE llx_deplacement ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_deplacement ADD COLUMN note_public text;
ALTER TABLE llx_element_element DROP INDEX idx_element_element_idx1;
ALTER TABLE llx_element_element DROP INDEX idx_element_element_targetid;
ALTER TABLE llx_element_element CHANGE sourceid fk_source integer NOT NULL;
ALTER TABLE llx_element_element CHANGE targetid fk_target integer NOT NULL;
ALTER TABLE llx_element_element ADD UNIQUE INDEX idx_element_element_idx1 (fk_source, sourcetype, fk_target, targettype);
ALTER TABLE llx_element_element ADD INDEX idx_element_element_fk_target (fk_target);
ALTER TABLE llx_ecm_document RENAME TO llx_ecm_documents;
ALTER TABLE llx_ecm_documents ADD COLUMN entity integer DEFAULT 1 NOT NULL AFTER ref;
ALTER TABLE llx_ecm_documents ADD COLUMN crc varchar(32) DEFAULT '' NOT NULL AFTER private;
ALTER TABLE llx_ecm_documents ADD COLUMN cryptkey varchar(50) DEFAULT '' NOT NULL AFTER crc;
ALTER TABLE llx_ecm_documents ADD COLUMN cipher varchar(50) DEFAULT 'twofish' NOT NULL AFTER cryptkey;
ALTER TABLE llx_facture_fourn_det MODIFY COLUMN qty real;
ALTER TABLE llx_notify ADD COLUMN email VARCHAR(255);
ALTER TABLE llx_c_currencies ADD COLUMN labelsing varchar(64);
update llx_c_currencies set labelsing='Euro' where code_iso='EUR';
update llx_c_currencies set labelsing='Dollar' where code_iso='USD';
insert into llx_action_def (rowid,code,titre,description,objet_type) values (5,'NOTIFY_VAL_ORDER','Validation commande client','Executed when a customer order is validated','order');
insert into llx_action_def (rowid,code,titre,description,objet_type) values (6,'NOTIFY_VAL_PROPAL','Validation proposition client','Executed when a commercial proposal is validated','propal');
UPDATE llx_c_type_contact SET element='project' WHERE element='projet';
UPDATE llx_const set value='mail' where value='simplemail' and name='MAIN_MAIL_SENDMODE';
ALTER TABLE llx_projet ADD COLUMN model_pdf varchar(50) AFTER note;
ALTER TABLE llx_societe ADD COLUMN localtax1_assuj tinyint DEFAULT 0 after tva_assuj;
ALTER TABLE llx_societe ADD COLUMN localtax2_assuj tinyint DEFAULT 0 after localtax1_assuj;
ALTER TABLE llx_user ADD COLUMN photo varchar(255) after statut;
-- Create table of extra fields
create table llx_extra_fields
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
entity integer DEFAULT 1 NOT NULL,
object varchar(64) NOT NULL,
assign integer,
name varchar(64) NOT NULL,
label varchar(64) NOT NULL,
format varchar(8) NOT NULL,
fieldsize integer,
maxlength integer,
options varchar(45),
rank integer
)ENGINE=innodb;
ALTER TABLE llx_extra_fields ADD UNIQUE INDEX idx_extra_fields_name (name, entity);
-- Create table of possible values
create table llx_extra_fields_options
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
fk_extra_fields integer NOT NULL,
value varchar(255) NOT NULL,
rank integer
)ENGINE=innodb;
ALTER TABLE llx_extra_fields_options ADD INDEX idx_extra_fields_options_fk_extra_fields (fk_extra_fields);
ALTER TABLE llx_extra_fields_options ADD CONSTRAINT fk_extra_fields_options_fk_extra_fields FOREIGN KEY (fk_extra_fields) REFERENCES llx_extra_fields (rowid);
-- Create table of values
create table llx_extra_fields_values
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
entity integer DEFAULT 1 NOT NULL,
datec datetime,
datem datetime,
fk_object integer NOT NULL,
fk_extra_fields integer NOT NULL,
value varchar(255),
fk_user_create integer,
fk_user_modif integer
)ENGINE=innodb;
ALTER TABLE llx_extra_fields_values ADD INDEX idx_extra_fields_values_fk_extra_fields (fk_extra_fields, entity);
ALTER TABLE llx_extra_fields_values ADD CONSTRAINT fk_extra_fields_values_fk_extra_fields FOREIGN KEY (fk_extra_fields) REFERENCES llx_extra_fields (rowid);
ALTER TABLE llx_bank_class DROP INDEX idx_bank_class_lineid;
ALTER TABLE llx_bank_class DROP INDEX uk_bank_class_lineid;
ALTER TABLE llx_bank_class ADD UNIQUE INDEX uk_bank_class_lineid (lineid, fk_categ);
ALTER TABLE llx_rights_def MODIFY COLUMN module varchar(64);
-- Enhancement of project tasks
ALTER TABLE llx_projet ADD COLUMN datee DATE AFTER dateo;
ALTER TABLE llx_projet ADD COLUMN public integer;
ALTER TABLE llx_projet_task ADD COLUMN datec datetime AFTER fk_task_parent;
ALTER TABLE llx_projet_task ADD COLUMN tms timestamp AFTER datec;
ALTER TABLE llx_projet_task ADD COLUMN dateo datetime AFTER tms;
ALTER TABLE llx_projet_task ADD COLUMN datee datetime AFTER dateo;
ALTER TABLE llx_projet_task ADD COLUMN datev datetime AFTER datee;
ALTER TABLE llx_projet_task CHANGE title label varchar(255) NOT NULL;
ALTER TABLE llx_projet_task ADD COLUMN description text AFTER label;
ALTER TABLE llx_projet_task MODIFY description text;
ALTER TABLE llx_projet_task MODIFY duration_effective real DEFAULT 0 NOT NULL;
ALTER TABLE llx_projet_task ADD COLUMN progress integer DEFAULT 0 AFTER duration_effective;
ALTER TABLE llx_projet_task ADD COLUMN priority integer DEFAULT 0 AFTER progress;
ALTER TABLE llx_projet_task ADD COLUMN fk_milestone integer DEFAULT 0 AFTER priority;
ALTER TABLE llx_projet_task ADD COLUMN fk_user_modif integer AFTER fk_user_creat;
ALTER TABLE llx_projet_task ADD COLUMN fk_user_valid integer AFTER fk_user_modif;
UPDATE llx_projet_task SET statut='1' WHERE statut='open';
ALTER TABLE llx_projet_task CHANGE statut fk_statut smallint DEFAULT 0 NOT NULL;
ALTER TABLE llx_projet_task CHANGE note note_private text;
ALTER TABLE llx_projet_task ADD COLUMN note_public text AFTER note_private;
ALTER TABLE llx_projet_task ADD COLUMN rang integer DEFAULT 0 AFTER note_public;
-- Delete old key
ALTER TABLE llx_projet_task DROP INDEX fk_projet;
ALTER TABLE llx_projet_task DROP INDEX fk_user_creat;
ALTER TABLE llx_projet_task DROP INDEX statut;
-- Add new key
ALTER TABLE llx_projet_task ADD INDEX idx_projet_task_fk_projet (fk_projet);
ALTER TABLE llx_projet_task ADD INDEX idx_projet_task_fk_user_creat (fk_user_creat);
ALTER TABLE llx_projet_task ADD INDEX idx_projet_task_fk_user_valid (fk_user_valid);
-- V4.1 DELETE FROM llx_projet_task WHERE fk_projet NOT IN (SELECT rowid from llx_projet);
-- V4.1 UPDATE llx_projet_task set fk_user_creat=NULL WHERE fk_user_creat IS NOT NULL AND fk_user_creat NOT IN (SELECT rowid from llx_user);
-- V4.1 UPDATE llx_projet_task set fk_user_valid=NULL WHERE fk_user_valid IS NOT NULL AND fk_user_valid NOT IN (SELECT rowid from llx_user);
ALTER TABLE llx_projet_task ADD CONSTRAINT fk_projet_task_fk_projet FOREIGN KEY (fk_projet) REFERENCES llx_projet (rowid);
ALTER TABLE llx_projet_task ADD CONSTRAINT fk_projet_task_fk_user_creat FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid);
ALTER TABLE llx_projet_task ADD CONSTRAINT fk_projet_task_fk_user_valid FOREIGN KEY (fk_user_valid) REFERENCES llx_user (rowid);
ALTER TABLE llx_element_contact DROP FOREIGN KEY fk_element_contact_fk_c_type_contact;
ALTER TABLE llx_element_contact DROP INDEX fk_element_contact_fk_c_type_contact;
UPDATE llx_c_type_contact SET rowid='160' WHERE rowid='80';
UPDATE llx_c_type_contact SET rowid='170' WHERE rowid='81';
UPDATE llx_element_contact SET fk_c_type_contact='160' WHERE fk_c_type_contact='80';
UPDATE llx_element_contact SET fk_c_type_contact='170' WHERE fk_c_type_contact='81';
ALTER TABLE llx_element_contact ADD CONSTRAINT fk_element_contact_fk_c_type_contact FOREIGN KEY (fk_c_type_contact) REFERENCES llx_c_type_contact(rowid);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (161, 'project', 'internal', 'CONTRIBUTOR', 'Intervenant', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (171, 'project', 'external', 'CONTRIBUTOR', 'Intervenant', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (180, 'project_task', 'internal', 'TASKEXECUTIVE', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (181, 'project_task', 'internal', 'CONTRIBUTOR', 'Intervenant', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (190, 'project_task', 'external', 'TASKEXECUTIVE', 'Responsable', 1);
insert into llx_c_type_contact(rowid, element, source, code, libelle, active ) values (191, 'project_task', 'external', 'CONTRIBUTOR', 'Intervenant', 1);
ALTER TABLE llx_projet ADD COLUMN description text AFTER title;
ALTER TABLE llx_projet CHANGE note note_private text;
ALTER TABLE llx_projet ADD COLUMN note_public text AFTER note_private;
ALTER TABLE llx_projet MODIFY fk_statut smallint DEFAULT 0 NOT NULL;
ALTER TABLE llx_projet MODIFY fk_user_creat integer NOT NULL;
-- Uniformize code: change tva_taux to tva_tx
ALTER TABLE llx_facturedet CHANGE tva_taux tva_tx real;
ALTER TABLE llx_facture_fourn_det CHANGE tva_taux tva_tx double(6,3);
ALTER TABLE llx_facturedet_rec CHANGE tva_taux tva_tx real DEFAULT 19.6;
-- Create table for entities
create table llx_entity
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
label varchar(255) NOT NULL,
description text,
datec datetime,
fk_user_creat integer,
visible tinyint DEFAULT 1 NOT NULL,
active tinyint DEFAULT 1 NOT NULL
) ENGINE=innodb;
INSERT INTO llx_entity (rowid, label, description, datec, fk_user_creat, visible, active) VALUES (1, 'Default Entity', 'This is the default entity', NOW(), 1, 1, 1);
-- Add constraint
-- V4.1 DELETE FROM llx_fichinterdet WHERE fk_fichinter NOT IN (SELECT rowid from llx_fichinter);
ALTER TABLE llx_fichinterdet ADD INDEX idx_fichinterdet_fk_fichinter (fk_fichinter);
ALTER TABLE llx_fichinterdet ADD CONSTRAINT fk_fichinterdet_fk_fichinter FOREIGN KEY (fk_fichinter) REFERENCES llx_fichinter (rowid);
-- This was created into 2.9.0 but we need them to avoid errors of migration to 2.8 using new classes
alter table llx_facture add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_facture add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_facturedet add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_facturedet add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_facturedet add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_facturedet add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
-- This was created into 3.0.0 but we need them to avoid errors of migration to 2.8 using new classes
ALTER TABLE llx_propaldet ADD COLUMN fk_parent_line integer NULL AFTER fk_propal;
ALTER TABLE llx_commandedet ADD COLUMN fk_parent_line integer NULL AFTER fk_commande;
ALTER TABLE llx_facturedet ADD COLUMN fk_parent_line integer NULL AFTER fk_facture;
ALTER TABLE llx_facturedet_rec ADD COLUMN fk_parent_line integer NULL AFTER fk_facture;

View File

@ -1,329 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 2.8.0 or higher.
--
-- Add unique key
ALTER TABLE llx_product_stock ADD UNIQUE INDEX uk_product_stock (fk_product,fk_entrepot);
ALTER TABLE llx_product_stock drop column location;
-- Add missing table llx_product_association
create table llx_product_association
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_product_pere integer NOT NULL DEFAULT 0,
fk_product_fils integer NOT NULL DEFAULT 0,
qty double NULL
)ENGINE=innodb;
ALTER TABLE llx_product_association ADD UNIQUE INDEX uk_product_association (fk_product_pere, fk_product_fils);
ALTER TABLE llx_product_association ADD INDEX idx_product_association_fils (fk_product_fils);
ALTER TABLE llx_product ADD INDEX idx_product_label (label);
-- V4.1 DELETE FROM llx_projet_task WHERE fk_projet NOT IN (SELECT rowid from llx_projet);
-- V4.1 UPDATE llx_projet_task set fk_user_creat=NULL WHERE fk_user_creat IS NOT NULL AND fk_user_creat NOT IN (SELECT rowid from llx_user);
-- V4.1 UPDATE llx_projet_task set fk_user_valid=NULL WHERE fk_user_valid IS NOT NULL AND fk_user_valid NOT IN (SELECT rowid from llx_user);
ALTER table llx_bank_account ADD COLUMN fk_pays integer DEFAULT 0 NOT NULL after domiciliation;
ALTER TABLE llx_bank_account ADD COLUMN fk_departement integer DEFAULT NULL after domiciliation;
ALTER TABLE llx_socpeople ADD COLUMN fk_departement integer DEFAULT NULL after ville;
ALTER TABLE llx_adherent ADD COLUMN fk_departement integer DEFAULT NULL after ville;
ALTER TABLE llx_entrepot ADD COLUMN fk_departement integer DEFAULT NULL after ville;
ALTER TABLE llx_bookmark ADD COLUMN position integer DEFAULT 0;
-- Rename llx_product_det
ALTER TABLE llx_product_det RENAME TO llx_product_lang;
ALTER TABLE llx_product_lang ADD UNIQUE INDEX uk_product_lang (fk_product, lang);
-- V4.1 DELETE FROM llx_product_lang WHERE fk_product NOT IN (SELECT rowid from llx_product);
ALTER TABLE llx_product_lang ADD CONSTRAINT fk_product_lang_fk_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
ALTER TABLE llx_product ADD COLUMN virtual tinyint DEFAULT 0 NOT NULL AFTER tms;
ALTER TABLE llx_product ADD COLUMN fk_parent integer DEFAULT 0 AFTER virtual;
alter table llx_societe add column default_lang varchar(6) after price_level;
alter table llx_socpeople add column default_lang varchar(6) after note;
alter table llx_mailing add column joined_file1 varchar(255);
alter table llx_mailing add column joined_file2 varchar(255);
alter table llx_mailing add column joined_file3 varchar(255);
alter table llx_mailing add column joined_file4 varchar(255);
update llx_facture_fourn set fk_statut=2 where fk_statut=1 AND paye=1;
alter table llx_facture_fourn add column close_code varchar(16) after remise;
alter table llx_facture_fourn add column close_note varchar(128) after close_code;
-- Add local taxes
alter table llx_facture add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_facture add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_facturedet add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_facturedet add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_facturedet add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_facturedet add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_facture_rec add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_facture_rec add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_facturedet_rec add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_facturedet_rec add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_facturedet_rec add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_facturedet_rec add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_c_tva add column localtax1 double NOT NULL DEFAULT 0 after taux;
alter table llx_c_tva add column localtax2 double NOT NULL DEFAULT 0 after localtax1;
alter table llx_propal add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_propal add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_propaldet add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_propaldet add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_propaldet add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_propaldet add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_commande add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_commande add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_commandedet add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_commandedet add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_commandedet add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_commandedet add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_commande_fournisseur add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_commande_fournisseur add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_commande_fournisseurdet add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_commande_fournisseurdet add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_commande_fournisseurdet add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_commande_fournisseurdet add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_facture_fourn add column localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_facture_fourn add column localtax2 double(24,8) DEFAULT 0 after localtax1;
alter table llx_facture_fourn_det add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_facture_fourn_det add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_facture_fourn_det add column total_localtax1 double(24,8) DEFAULT 0 after tva;
alter table llx_facture_fourn_det add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_product add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_product add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_product_price add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_product_price add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_contratdet add column localtax1_tx double(6,3) DEFAULT 0 after tva_tx;
alter table llx_contratdet add column localtax2_tx double(6,3) DEFAULT 0 after localtax1_tx;
alter table llx_contratdet add column total_localtax1 double(24,8) DEFAULT 0 after total_tva;
alter table llx_contratdet add column total_localtax2 double(24,8) DEFAULT 0 after total_localtax1;
alter table llx_product add column hidden tinyint DEFAULT 0;
alter table llx_product add column length float DEFAULT NULL after weight_units;
alter table llx_product add column length_units tinyint DEFAULT NULL after length;
alter table llx_product add column surface float DEFAULT NULL after length_units;
alter table llx_product add column surface_units tinyint DEFAULT NULL after surface;
alter table llx_product add column accountancy_code_sell varchar(15) after fk_barcode_type;
alter table llx_product add column accountancy_code_buy varchar(15) after accountancy_code_sell;
ALTER TABLE llx_product drop column stock_loc;
ALTER TABLE llx_product_stock add column location varchar(32);
ALTER TABLE llx_expedition DROP FOREIGN KEY fk_expedition_fk_adresse_livraison;
ALTER TABLE llx_expedition DROP INDEX idx_expedition_fk_adresse_livraison;
ALTER TABLE llx_expedition ADD COLUMN ref_customer varchar(30) AFTER entity;
ALTER TABLE llx_expedition ADD COLUMN date_delivery date DEFAULT NULL AFTER date_expedition;
ALTER TABLE llx_expedition CHANGE COLUMN fk_adresse_livraison fk_address integer DEFAULT NULL;
ALTER TABLE llx_livraison DROP FOREIGN KEY fk_livraison_fk_adresse_livraison;
ALTER TABLE llx_livraison DROP INDEX idx_livraison_fk_adresse_livraison;
ALTER TABLE llx_livraison change ref_client ref_customer varchar(30);
ALTER TABLE llx_livraison change date_livraison date_delivery date DEFAULT NULL;
ALTER TABLE llx_livraison CHANGE COLUMN fk_adresse_livraison fk_address integer DEFAULT NULL;
ALTER TABLE llx_c_actioncomm MODIFY libelle varchar(48) NOT NULL;
ALTER TABLE llx_facture MODIFY tva double(24,8) DEFAULT 0;
ALTER TABLE llx_facture MODIFY total double(24,8) DEFAULT 0;
ALTER TABLE llx_facture MODIFY total_ttc double(24,8) DEFAULT 0;
ALTER TABLE llx_facture MODIFY amount double(24,8) DEFAULT 0 NOT NULL;
ALTER TABLE llx_facturedet MODIFY tva_tx double(6,3);
ALTER TABLE llx_facturedet MODIFY subprice double(24,8);
ALTER TABLE llx_facturedet MODIFY price double(24,8);
ALTER TABLE llx_facturedet MODIFY total_ht double(24,8);
ALTER TABLE llx_facturedet MODIFY total_tva double(24,8);
ALTER TABLE llx_facturedet MODIFY total_ttc double(24,8);
ALTER TABLE llx_facture_rec MODIFY tva double(24,8) DEFAULT 0;
ALTER TABLE llx_facture_rec MODIFY total double(24,8) DEFAULT 0;
ALTER TABLE llx_facture_rec MODIFY total_ttc double(24,8) DEFAULT 0;
ALTER TABLE llx_facture_rec MODIFY amount double(24,8) DEFAULT 0 NOT NULL;
ALTER TABLE llx_facturedet_rec MODIFY tva_tx double(6,3);
ALTER TABLE llx_facturedet_rec MODIFY subprice double(24,8);
ALTER TABLE llx_facturedet_rec MODIFY price double(24,8);
ALTER TABLE llx_facturedet_rec MODIFY total_ht double(24,8);
ALTER TABLE llx_facturedet_rec MODIFY total_tva double(24,8);
ALTER TABLE llx_facturedet_rec MODIFY total_ttc double(24,8);
ALTER TABLE llx_adherent ADD COLUMN civilite varchar(6) after entity;
ALTER TABLE llx_deplacement ADD COLUMN fk_projet integer DEFAULT 0 after fk_soc;
-- Custom list
DROP TABLE llx_c_field_list;
create table llx_c_field_list
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
element varchar(64) NOT NULL,
entity integer DEFAULT 1 NOT NULL,
name varchar(32) NOT NULL,
alias varchar(32) NOT NULL,
title varchar(32) NOT NULL,
align varchar(6) DEFAULT 'left',
sort tinyint DEFAULT 1 NOT NULL,
search tinyint DEFAULT 0 NOT NULL,
enabled varchar(255) DEFAULT 1,
rang integer DEFAULT 0
)ENGINE=innodb;
INSERT INTO llx_c_field_list (rowid, element, entity, name, alias, title, align, sort, search, enabled, rang) VALUES
(1, 'product_default', 1, 'p.ref', 'ref', 'Ref', 'left', 1, 1, '1', 1),
(2, 'product_default', 1, 'p.label', 'label', 'Label', 'left', 1, 1, '1', 2),
(3, 'product_default', 1, 'p.barcode', 'barcode', 'BarCode', 'center', 1, 1, '$conf->barcode->enabled', 3),
(4, 'product_default', 1, 'p.tms', 'datem', 'DateModification', 'center', 1, 0, '1', 4),
(5, 'product_default', 1, 'p.price', 'price', 'SellingPriceHT', 'right', 1, 0, '1', 5),
(6, 'product_default', 1, 'p.price_ttc', 'price_ttc', 'SellingPriceTTC', 'right', 1, 0, '1', 6),
(7, 'product_default', 1, 'p.stock', 'stock', 'Stock', 'right', 0, 0, '$conf->stock->enabled', 7),
(8, 'product_default', 1, 'p.envente', 'status', 'Status', 'right', 1, 0, '1', 8);
UPDATE llx_adherent SET pays = null where pays <= '0' and pays != '0';
ALTER table llx_adherent MODIFY pays integer;
-- Drop old tables
DROP TABLE llx_projet_milestone;
ALTER TABLE llx_projet drop column fk_milestone;
ALTER TABLE llx_deplacement ADD COLUMN fk_statut INTEGER DEFAULT 1 NOT NULL after type;
drop table llx_appro;
ALTER TABLE llx_events MODIFY COLUMN user_agent varchar(255) NULL;
create table llx_categorie_member
(
fk_categorie integer NOT NULL,
fk_member integer NOT NULL
)ENGINE=innodb;
ALTER TABLE llx_categorie_member ADD PRIMARY KEY (fk_categorie, fk_member);
ALTER TABLE llx_categorie_member ADD INDEX idx_categorie_member_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_member ADD INDEX idx_categorie_member_fk_member (fk_member);
ALTER TABLE llx_categorie_member ADD CONSTRAINT fk_categorie_member_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_member ADD CONSTRAINT fk_categorie_member_member_rowid FOREIGN KEY (fk_member) REFERENCES llx_adherent (rowid);
ALTER TABLE llx_product ADD COLUMN canvas varchar(32) DEFAULT 'default@product';
ALTER TABLE llx_product MODIFY COLUMN canvas varchar(32) DEFAULT 'default@product';
UPDATE llx_product SET canvas = 'default@product' WHERE fk_product_type = 0 AND (canvas = '' OR canvas = 'default');
UPDATE llx_product SET canvas = 'service@product' WHERE fk_product_type = 1 AND (canvas = '' OR canvas = 'service');
UPDATE llx_product SET canvas = 'livre@droitpret' WHERE canvas = 'livre';
UPDATE llx_product SET canvas = 'livrecontrat@droitpret' WHERE canvas = 'livrecontrat';
UPDATE llx_product SET canvas = 'livrecouverture@droitpret' WHERE canvas = 'livrecouverture';
ALTER TABLE llx_menu DROP INDEX idx_menu_uk_menu;
ALTER TABLE llx_menu ADD UNIQUE INDEX idx_menu_uk_menu (menu_handler, fk_menu, position, url, entity);
UPDATE llx_const SET name = 'MAIN_MODULE_PRODUCT' WHERE name = 'MAIN_MODULE_PRODUIT';
UPDATE llx_expedition set ref_customer = NULL where ref_customer = '';
-- Add more predefined action codes --
insert into llx_c_actioncomm (id, code, type, libelle, module) values (30, 'AC_SUP_ORD', 'system', 'Send supplier order by email' ,'supplier_order');
insert into llx_c_actioncomm (id, code, type, libelle, module) values (31, 'AC_SUP_INV', 'system', 'Send supplier invoice by email' ,'supplier_invoice');
-- Rename llx_societe_adresse_livraison
ALTER TABLE llx_societe_adresse_livraison RENAME TO llx_societe_address;
ALTER TABLE llx_societe_address CHANGE COLUMN nom name varchar(60);
ALTER TABLE llx_societe_address CHANGE COLUMN fk_societe fk_soc integer DEFAULT 0;
-- Add new spanish VAT from July 2010
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 45, 4, '18','0','4','VAT standard rate from July 2010',1);
insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,note,active) values ( 46, 4, '8','0','1','VAT reduced rate from July 2010',1);
-- Add Argentina Data
-- Regions Argentina (id pays=23)
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2301, 23, 2301, '', 0, 'Norte', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2302, 23, 2302, '', 0, 'Litoral', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2303, 23, 2303, '', 0, 'Cuyana', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2304, 23, 2304, '', 0, 'Central', 1);
INSERT INTO llx_c_regions (rowid, fk_pays, code_region, cheflieu, tncc, nom, active) VALUES (2305, 23, 2305, '', 0, 'Patagonia', 1);
-- Provinces Argentina
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2301', 2301, '', 01, 'CATAMARCA', 'Catamarca', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2302', 2301, '', 02, 'YUJUY', 'Yujuy', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2303', 2301, '', 03, 'TUCAMAN', 'Tucamán', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2304', 2301, '', 04, 'SANTIAGO DEL ESTERO', 'Santiago del Estero', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2305', 2301, '', 05, 'SALTA', 'Salta', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2306', 2302, '', 06, 'CHACO', 'Chaco', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2307', 2302, '', 07, 'CORRIENTES', 'Corrientes', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2308', 2302, '', 08, 'ENTRE RIOS', 'Entre Ríos', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2309', 2302, '', 09, 'FORMOSA MISIONES', 'Formosa Misiones', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2310', 2302, '', 10, 'SANTA FE', 'Santa Fe', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2311', 2303, '', 11, 'LA RIOJA', 'La Rioja', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2312', 2303, '', 12, 'MENDOZA', 'Mendoza', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2313', 2303, '', 13, 'SAN JUAN', 'San Juan', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2314', 2303, '', 14, 'SAN LUIS', 'San Luis', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2315', 2304, '', 15, 'CORDOBA', 'Córdoba', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2316', 2304, '', 16, 'BUENOS AIRES', 'Buenos Aires', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2317', 2304, '', 17, 'CABA', 'Caba', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2318', 2305, '', 18, 'LA PAMPA', 'La Pampa', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2319', 2305, '', 19, 'NEUQUEN', 'Neuquén', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2320', 2305, '', 20, 'RIO NEGRO', 'Río Negro', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2321', 2305, '', 21, 'CHUBUT', 'Chubut', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2322', 2305, '', 22, 'SANTA CRUZ', 'Santa Cruz', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2323', 2305, '', 23, 'TIERRA DEL FUEGO', 'Tierra del Fuego', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2324', 2305, '', 24, 'ISLAS MALVINAS', 'Islas Malvinas', 1);
INSERT INTO llx_c_departements ( code_departement, fk_region, cheflieu, tncc, ncc, nom, active) VALUES ('2325', 2305, '', 25, 'ANTARTIDA', 'Antártida', 1);
-- Juridical status Argentina
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2301', 'Monotributista', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2302', 'Sociedad Civil', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2303', 'Sociedades Comerciales', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2304', 'Sociedades de Hecho', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2305', 'Sociedades Irregulares', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2306', 'Sociedad Colectiva', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2307', 'Sociedad en Comandita Simple', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2308', 'Sociedad de Capital e Industria', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2309', 'Sociedad Accidental o en participación', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2310', 'Sociedad de Responsabilidad Limitada', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2311', 'Sociedad Anónima', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2312', 'Sociedad Anónima con Participación Estatal Mayoritaria', 1);
INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (23, '2313', 'Sociedad en Comandita por Acciones (arts. 315 a 324, LSC)', 1);
DELETE from llx_const where name='USER_PASSWORD_GENERATED' and value='default';
ALTER TABLE llx_boxes_def DROP INDEX uk_boxes_def;
ALTER TABLE llx_boxes_def MODIFY file varchar(200) NOT NULL;
ALTER TABLE llx_boxes_def MODIFY note varchar(130);
ALTER TABLE llx_boxes_def ADD UNIQUE INDEX uk_boxes_def (file, entity, note);
-- Fix bad old data
UPDATE llx_bank_url SET type='payment' WHERE type='?' AND label='(payment)' AND url LIKE '%compta/paiement/fiche.php%';
update llx_const set value ='eldy' where name = 'MAIN_THEME' and (value= 'rodolphe' or value='dev' or value='bluelagoon');
update llx_user_param set value ='eldy' where param = 'MAIN_THEME' and (value= 'rodolphe' or value='dev' or value='bluelagoon');
ALTER TABLE llx_tmp_caisse MODIFY fk_article integer NOT NULL;

View File

@ -1,169 +0,0 @@
--
-- Be carefull to requests order.
-- This file must be loaded by calling /install/index.php page
-- when current version is 2.9.0 or higher.
--
-- To add a column: ALTER TABLE llx_table ADD COLUMN newcol varchar(60) NOT NULL DEFAULT '0' AFTER existingcol;
-- To rename a column: ALTER TABLE llx_table CHANGE COLUMN oldname newname varchar(60);
-- To change type of field: ALTER TABLE llx_table MODIFY name varchar(60);
-- To remove a column: ALTER TABLE llx_table DROP COLUMN colname;
ALTER TABLE llx_paiement MODIFY amount double(24,8);
ALTER TABLE llx_paiement_facture MODIFY amount double(24,8);
-- Fix bad old data
UPDATE llx_bank_url SET type='payment' WHERE type='?' AND label='(payment)' AND url LIKE '%compta/paiement/fiche.php%';
-- Add recuperableonly field
ALTER TABLE llx_product add COLUMN recuperableonly integer NOT NULL DEFAULT '0' after tva_tx;
ALTER TABLE llx_product_price add COLUMN recuperableonly integer NOT NULL DEFAULT '0' after tva_tx;
-- Rename envente into tosell and add tobuy
ALTER TABLE llx_product CHANGE COLUMN envente tosell tinyint DEFAULT 1;
ALTER TABLE llx_product add COLUMN tobuy tinyint DEFAULT 1 after tosell;
ALTER TABLE llx_product_price CHANGE COLUMN envente tosell tinyint DEFAULT 1;
ALTER TABLE llx_bank MODIFY COLUMN fk_type varchar(6);
ALTER TABLE llx_boxes_def DROP INDEX uk_boxes_def;
ALTER TABLE llx_boxes_def MODIFY file varchar(200) NOT NULL;
ALTER TABLE llx_boxes_def MODIFY note varchar(130);
ALTER TABLE llx_boxes_def ADD UNIQUE INDEX uk_boxes_def (file, entity, note);
ALTER TABLE llx_notify_def MODIFY fk_contact integer NULL;
ALTER TABLE llx_notify_def ADD COLUMN fk_user integer NULL after fk_contact;
ALTER TABLE llx_notify_def ADD COLUMN type varchar(16) DEFAULT 'email';
ALTER TABLE llx_notify MODIFY fk_contact integer NULL;
ALTER TABLE llx_notify ADD COLUMN fk_user integer NULL after fk_contact;
ALTER TABLE llx_notify ADD COLUMN type varchar(16) DEFAULT 'email';
ALTER TABLE llx_actioncomm MODIFY label varchar(128) NOT NULL;
ALTER TABLE llx_expedition MODIFY date_expedition datetime;
ALTER TABLE llx_expedition MODIFY date_delivery datetime NULL;
ALTER TABLE llx_societe ADD COLUMN canvas varchar(32) NULL AFTER default_lang;
ALTER TABLE llx_societe MODIFY canvas varchar(32) NULL;
ALTER TABLE llx_cond_reglement RENAME TO llx_c_payment_term;
ALTER TABLE llx_expedition_methode RENAME TO llx_c_shipment_mode;
ALTER TABLE llx_facturedet_rec ADD COLUMN special_code integer UNSIGNED DEFAULT 0 AFTER total_ttc;
ALTER TABLE llx_facturedet_rec ADD COLUMN rang integer DEFAULT 0 AFTER special_code;
ALTER TABLE llx_actioncomm ADD COLUMN fk_supplier_order integer;
ALTER TABLE llx_actioncomm ADD COLUMN fk_supplier_invoice integer;
ALTER TABLE llx_propaldet ADD COLUMN fk_parent_line integer NULL AFTER fk_propal;
ALTER TABLE llx_commandedet ADD COLUMN fk_parent_line integer NULL AFTER fk_commande;
ALTER TABLE llx_facturedet ADD COLUMN fk_parent_line integer NULL AFTER fk_facture;
ALTER TABLE llx_facturedet_rec ADD COLUMN fk_parent_line integer NULL AFTER fk_facture;
-- Remove old Spanish TVA
UPDATE llx_c_tva SET taux = '18' WHERE rowid = 41;
UPDATE llx_c_tva SET taux = '8' WHERE rowid = 42;
DELETE FROM llx_c_tva WHERE rowid = 45;
DELETE FROM llx_c_tva WHERE rowid = 46;
ALTER TABLE llx_adherent ADD COLUMN import_key varchar(14);
ALTER TABLE llx_categorie ADD COLUMN import_key varchar(14);
ALTER TABLE llx_product ADD COLUMN customcode varchar(32) after note;
ALTER TABLE llx_product ADD COLUMN fk_country integer after customcode;
ALTER TABLE llx_ecm_directories ADD UNIQUE INDEX idx_ecm_directories (label, fk_parent, entity);
ALTER TABLE llx_ecm_documents ADD UNIQUE INDEX idx_ecm_documents (fullpath_dol);
-- Add modules facture fournisseur
INSERT INTO llx_const (name, value, type, note, visible) values ('INVOICE_SUPPLIER_ADDON_PDF', 'canelle','chaine','',0);
ALTER TABLE llx_facture_fourn ADD COLUMN model_pdf varchar(50) after note_public;
CREATE TABLE llx_c_ziptown
(
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
code varchar(5) DEFAULT NULL,
fk_county integer NOT NULL,
zip varchar(10) NOT NULL,
town varchar(255) NOT NULL,
active tinyint NOT NULL DEFAULT 1
) ENGINE=innodb;
ALTER TABLE llx_c_ziptown ADD INDEX idx_c_ziptown_fk_county (fk_county);
ALTER TABLE llx_c_ziptown ADD CONSTRAINT fk_c_ziptown_fk_county FOREIGN KEY (fk_county) REFERENCES llx_c_departements (rowid);
ALTER TABLE llx_socpeople ADD COLUMN canvas varchar(32) NULL after default_lang;
ALTER TABLE llx_socpeople MODIFY canvas varchar(32) NULL;
UPDATE llx_socpeople SET canvas = 'default' WHERE canvas = 'default@contact';
UPDATE llx_societe SET canvas = 'default' WHERE canvas = 'default@thirdparty';
UPDATE llx_societe SET canvas = 'individual' WHERE canvas = 'individual@thirdparty';
INSERT INTO llx_const (name, value, type, note, visible) values ('MAIN_DELAY_SUPPLIER_ORDERS_TO_PROCESS','7','chaine','Tolérance de retard avant alerte (en jours) sur commandes fournisseurs non traitées',0);
ALTER TABLE llx_actioncomm ADD COLUMN fulldayevent smallint NOT NULL default 0 after priority;
-- Enhance POS module
DROP TABLE llx_tmp_caisse;
CREATE TABLE llx_pos_tmp (
id integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
fk_article integer NOT NULL,
qte real NOT NULL,
fk_tva integer NOT NULL,
remise_percent real NOT NULL,
remise real NOT NULL,
total_ht double(24,8) NOT NULL,
total_tva double(24,8) NOT NULL,
total_ttc double(24,8) NOT NULL
) ENGINE=innodb;
-- Add external ref
ALTER TABLE llx_facture ADD COLUMN ref_ext varchar(30) after entity;
ALTER TABLE llx_commande ADD COLUMN ref_ext varchar(30) after entity;
ALTER TABLE llx_propal ADD COLUMN ref_ext varchar(30) after entity;
ALTER TABLE llx_user ADD COLUMN ref_ext varchar(30) after entity;
ALTER TABLE llx_societe ADD COLUMN ref_ext varchar(60) after entity;
ALTER TABLE llx_product ADD COLUMN ref_ext varchar(30) after entity;
ALTER TABLE llx_mailing_cibles CHANGE COLUMN url source_url integer;
ALTER TABLE llx_mailing_cibles MODIFY source_url varchar(160);
ALTER TABLE llx_mailing_cibles ADD COLUMN source_id integer after source_url;
ALTER TABLE llx_mailing_cibles ADD COLUMN source_type varchar(16) after source_id;
ALTER TABLE llx_facture_rec DROP COLUMN frequency;
ALTER TABLE llx_facture_rec ADD COLUMN frequency integer;
ALTER TABLE llx_facture_rec ADD COLUMN unit_frequency varchar(2) DEFAULT 'd';
ALTER TABLE llx_facture_rec ADD COLUMN date_when datetime DEFAULT NULL;
ALTER TABLE llx_facture_rec ADD COLUMN date_last_gen datetime DEFAULT NULL;
ALTER TABLE llx_facture_rec ADD COLUMN nb_gen_done integer DEFAULT NULL;
ALTER TABLE llx_facture_rec ADD COLUMN nb_gen_max integer DEFAULT NULL;
ALTER TABLE llx_user ADD COLUMN openid varchar(255);
-- Enhance Withdrawal module
INSERT INTO llx_action_def (rowid,code,titre,description,objet_type) values (7,'NOTIFY_TRN_WITHDRAW','Transmit withdraw','Executed when a withdrawal is transmited','withdraw');
INSERT INTO llx_action_def (rowid,code,titre,description,objet_type) values (8,'NOTIFY_CRD_WITHDRAW','Credite withdraw','Executed when a withdrawal is credited','withdraw');
INSERT INTO llx_action_def (rowid,code,titre,description,objet_type) values (9,'NOTIFY_EMT_WITHDRAW','Emit withdraw','Executed when a withdrawal is emited','withdraw');
ALTER TABLE llx_prelevement_notifications MODIFY action varchar(32);
ALTER TABLE llx_c_tva ADD COLUMN accountancy_code varchar(15) DEFAULT NULL;
UPDATE llx_c_actioncomm set module='invoice_supplier' WHERE module='supplier_invoice';
UPDATE llx_c_actioncomm set module='order_supplier' WHERE module='supplier_order';
UPDATE llx_documentmodel set type='invoice_supplier' WHERE type='supplier_invoice';
UPDATE llx_documentmodel set type='order_supplier' WHERE type='supplier_order';
UPDATE llx_c_type_contact set element='invoice_supplier' WHERE element='facture_fourn';
UPDATE llx_c_type_contact set module='invoice_supplier' WHERE module='supplier_invoice';
UPDATE llx_c_type_contact set module='order_supplier' WHERE module='supplier_order';
ALTER TABLE llx_facturedet DROP INDEX uk_fk_remise_except;
ALTER TABLE llx_facturedet ADD UNIQUE INDEX uk_fk_remise_except (fk_remise_except, fk_facture);
ALTER TABLE llx_societe_remise MODIFY remise_client double(6,3) DEFAULT 0 NOT NULL;

View File

@ -19,6 +19,7 @@
-- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup);
ALTER TABLE llx_c_paiement ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER active;
-- Defined only to have specific list for countries that can't use generic list (like argentina that need type A or B)
@ -68,10 +69,17 @@ ALTER TABLE llx_projet_task_time ADD COLUMN task_datehour datetime after task_da
-- Localtaxes by thirds
ALTER TABLE llx_c_tva MODIFY COLUMN localtax1 varchar(10);
ALTER TABLE llx_c_tva MODIFY COLUMN localtax2 varchar(10);
ALTER TABLE llx_localtax ADD COLUMN localtaxtype tinyint(4) after entity;
ALTER TABLE llx_localtax ADD COLUMN localtaxtype tinyint after entity;
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;
-- 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
@ -81,7 +89,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;
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 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
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;
@ -125,6 +133,7 @@ create table llx_accounting_fiscalyear
)ENGINE=innodb;
ALTER TABLE llx_contrat ADD COLUMN ref_ext varchar(30) after ref;
ALTER TABLE llx_contrat ADD COLUMN ref_customer varchar(30) after ref_ext;
ALTER TABLE llx_propal ADD COLUMN fk_shipping_method integer AFTER date_livraison;
ALTER TABLE llx_commande ADD COLUMN fk_shipping_method integer AFTER date_livraison;
@ -939,25 +948,31 @@ create table llx_c_email_templates
position smallint, -- Position
topic text, -- Predefined topic
content text -- Predefined text
)ENGINE=innodb;
) ENGINE=innodb;
UPDATE llx_c_regions SET rowid = 0 where rowid = 1;
DELETE FROM llx_c_departements WHERE fk_region NOT IN (select rowid from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0;
ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_fk_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (rowid);
ALTER TABLE llx_c_departements DROP FOREIGN KEY fk_departements_fk_region;
--UPDATE llx_c_regions SET rowid = 0 where rowid = 1;
ALTER TABLE llx_c_regions ADD UNIQUE INDEX uk_code_region (code_region);
DELETE FROM llx_c_departements WHERE fk_region NOT IN (select code_region from llx_c_regions) AND fk_region IS NOT NULL AND fk_region <> 0;
ALTER TABLE llx_c_departements ADD CONSTRAINT fk_departements_code_region FOREIGN KEY (fk_region) REFERENCES llx_c_regions (code_region);
CREATE TABLE llx_holiday_types (
rowid integer NOT NULL AUTO_INCREMENT PRIMARY KEY,
label varchar(45) NOT NULL,
description varchar(255) NOT NULL,
affect int(1) NOT NULL,
delay int(1) NOT NULL,
affect integer NOT NULL,
delay integer NOT NULL,
insertAt DATETIME NOT NULL,
updateAt DATETIME,
deleteAt DATETIME,
nbCongesDeducted varchar(255) NOT NULL,
nbCongesEveryMonth varchar(255) NOT NULL
<<<<<<< HEAD
);
-- Change on table c_civilite
@ -968,3 +983,17 @@ ALTER TABLE llx_c_civility ADD UNIQUE INDEX uk_c_civility(code);
ALTER TABLE llx_adherent CHANGE civilite civility VARCHAR(6);
ALTER TABLE llx_socpeople CHANGE civilite civility VARCHAR(6);
ALTER TABLE llx_user CHANGE civilite civility VARCHAR(6);
=======
) ENGINE=innodb;
ALTER TABLE llx_c_type_fees CHANGE libelle label VARCHAR(30);
ALTER TABLE llx_c_type_fees ADD COLUMN accountancy_code varchar(32) DEFAULT NULL AFTER label;
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_element (fk_element);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_task (fk_task);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_date (task_date);
ALTER TABLE llx_projet_task_time ADD INDEX idx_projet_task_time_datehour (task_datehour);
>>>>>>> refs/remotes/Upstream/develop

View File

@ -22,3 +22,4 @@ ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_datea (datea);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_soc (fk_soc);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_contact (fk_contact);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_code (code);
ALTER TABLE llx_actioncomm ADD INDEX idx_actioncomm_fk_element (fk_element);

View File

@ -17,6 +17,6 @@
-- ========================================================================
ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code (code);
ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_country_code_iso (code_iso);
ALTER TABLE llx_c_pays ADD UNIQUE INDEX idx_c_pays_libelle (libelle);
ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_code (code);
ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_code_iso (code_iso);
ALTER TABLE llx_c_country ADD UNIQUE INDEX idx_c_country_label (label);

Some files were not shown because too many files have changed in this diff Show More