';
print '| ';
@@ -1558,7 +1578,8 @@ else
* List mode
*/
$sql = "SELECT s.nom as name, s.rowid as socid, f.rowid as facid, f.titre, f.total, f.tva as total_vat, f.total_ttc, f.frequency,";
- $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when";
+ $sql.= " f.nb_gen_done, f.nb_gen_max, f.date_last_gen, f.date_when,";
+ $sql.= " f.datec, f.tms";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
if (! $user->rights->societe->client->voir && ! $socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -1570,10 +1591,10 @@ else
}
if ($search_ref) $sql .= natural_search('f.titre', $search_ref);
if ($search_societe) $sql .= natural_search('s.nom', $search_societe);
- if ($search_frequency) $sql .= natural_search('f.frequency', $search_frequency);
if ($search_montant_ht != '') $sql.= natural_search('f.total', $search_montant_ht, 1);
if ($search_montant_vat != '') $sql.= natural_search('f.tva', $search_montant_vat, 1);
if ($search_montant_ttc != '') $sql.= natural_search('f.total_ttc', $search_montant_ttc, 1);
+ if ($search_frequency > 0) $sql.= natural_search('f.frequency', $search_frequency);
if ($search_frequency == '1') $sql.= ' AND f.frequency > 0';
if ($search_frequency == '0') $sql.= ' AND (f.frequency IS NULL or f.frequency = 0)';
@@ -1605,23 +1626,24 @@ else
}
$nbtotalofrecords = '';
- if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
- {
- $result = $db->query($sql);
- $nbtotalofrecords = $db->num_rows($result);
- }
+ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
+ {
+ $result = $db->query($sql);
+ $nbtotalofrecords = $db->num_rows($result);
+ }
- $sql.= $db->order($sortfield, $sortorder);
- $sql.= $db->plimit($limit+1,$offset);
+ $sql.= $db->order($sortfield, $sortorder);
+ $sql.= $db->plimit($limit+1,$offset);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
- $param='&socid='.$socid;
- if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
+ $param='';
+ if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit;
+ if ($socid) $param.='&socid='.$socid;
if ($day) $param.='&day='.$day;
if ($month) $param.='&month='.$month;
if ($year) $param.='&year=' .$year;
@@ -1631,9 +1653,9 @@ else
if ($search_ref) $param.='&search_ref=' .$search_ref;
if ($search_societe) $param.='&search_societe=' .$search_societe;
if ($search_montant_ht != '') $param.='&search_montant_ht='.$search_montant_ht;
- if ($search_montant_vat != '') $param.='&search_montant_vat='.$search_montant_vat;
+ if ($search_montant_vat != '') $param.='&search_montant_vat='.$search_montant_vat;
if ($search_montant_ttc != '') $param.='&search_montant_ttc='.$search_montant_ttc;
- if ($search_frequency) $param.='&search_frequency=' .$search_frequency;
+ if ($search_frequency > 0) $param.='&search_frequency=' .$search_frequency;
if ($option) $param.="&option=".$option;
if ($optioncss != '') $param.='&optioncss='.$optioncss;
// Add $param from extra fields
@@ -1646,14 +1668,20 @@ else
$massactionbutton=$form->selectMassAction('', $massaction == 'presend' ? array() : array('presend'=>$langs->trans("SendByMail"), 'builddoc'=>$langs->trans("PDFMerge")));
- print ' | ';
print " \n";
+
print '';
- print_liste_field_titre($langs->trans("Ref"),$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("ThirdParty"),$_SERVER['PHP_SELF'],"s.nom","",$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("AmountVAT"),$_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);
- print_liste_field_titre($langs->trans("RecurringInvoiceTemplate"),$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
- if (! empty($arrayfields['f.nb_gen_done']['checked']))
- {
- print_liste_field_titre($langs->trans("NbOfGenerationDone"),$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder);
- }
- print_liste_field_titre($langs->trans("DateLastGeneration"),$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("NextDateToExecution"),$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
- print_liste_field_titre(''); // Field may contains ling text
+ if (! empty($arrayfields['f.titre']['checked'])) print_liste_field_titre($arrayfields['f.titre']['label'],$_SERVER['PHP_SELF'],"f.titre","",$param,"",$sortfield,$sortorder);
+ if (! empty($arrayfields['s.nom']['checked'])) print_liste_field_titre($arrayfields['s.nom']['label'],$_SERVER['PHP_SELF'],"s.nom","",$param,"",$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total']['checked'])) print_liste_field_titre($arrayfields['f.total']['label'],$_SERVER['PHP_SELF'],"f.total","",$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.tva']['checked'])) print_liste_field_titre($arrayfields['f.tva']['label'],$_SERVER['PHP_SELF'],"f.tva","",$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],"f.total_ttc","",$param,'align="right"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.frequency']['checked'])) print_liste_field_titre($arrayfields['f.frequency']['label'],$_SERVER['PHP_SELF'],"f.frequency","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.nb_gen_done']['checked'])) print_liste_field_titre($arrayfields['f.nb_gen_done']['label'],$_SERVER['PHP_SELF'],"f.nb_gen_done","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.date_last_gen']['checked'])) print_liste_field_titre($arrayfields['f.date_last_gen']['label'],$_SERVER['PHP_SELF'],"f.date_last_gen","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.date_when']['checked'])) print_liste_field_titre($arrayfields['f.date_when']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.datec']['checked'])) print_liste_field_titre($arrayfields['f.datec']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
+ if (! empty($arrayfields['f.tms']['checked'])) print_liste_field_titre($arrayfields['f.tms']['label'],$_SERVER['PHP_SELF'],"f.date_when","",$param,'align="center"',$sortfield,$sortorder);
+ print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"],"",'','','align="center"',$sortfield,$sortorder,'maxwidthsearch ')."\n";
print " \n";
-
-
+
+
if ($num > 0)
{
$var=true;
@@ -1800,26 +1828,67 @@ else
{
$objp = $db->fetch_object($resql);
- print '';
-
- print '| '.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
- print " | \n";
-
$companystatic->id=$objp->socid;
$companystatic->name=$objp->name;
- print ''.$companystatic->getNomUrl(1,'customer').' | ';
- print ''.price($objp->total).' | '."\n";
- print ''.price($objp->total_vat).' | '."\n";
- print ''.price($objp->total_ttc).' | '."\n";
- print ''.yn($objp->frequency?1:0).' | ';
+ print ' ';
+
+ if (! empty($arrayfields['f.titre']['checked']))
+ {
+ print '| '.img_object($langs->trans("ShowBill"),"bill").' '.$objp->titre;
+ print " | \n";
+ }
+ if (! empty($arrayfields['s.nom']['checked']))
+ {
+ print ''.$companystatic->getNomUrl(1,'customer').' | ';
+ }
+ if (! empty($arrayfields['f.total']['checked']))
+ {
+ print ''.price($objp->total).' | '."\n";
+ }
+ if (! empty($arrayfields['f.tva']['checked']))
+ {
+ print ''.price($objp->total_vat).' | '."\n";
+ }
+ if (! empty($arrayfields['f.total_ttc']['checked']))
+ {
+ print ''.price($objp->total_ttc).' | '."\n";
+ }
+ if (! empty($arrayfields['f.frequency']['checked']))
+ {
+ print ''.yn($objp->frequency?1:0).' | ';
+ }
if (! empty($arrayfields['f.nb_gen_done']['checked']))
{
- print ''.($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : '').' | ';
+ print '';
+ print ($objp->frequency ? $objp->nb_gen_done.($objp->nb_gen_max>0?' / '. $objp->nb_gen_max:'') : ''.$langs->trans('NA').'');
+ print ' | ';
}
- print ''.($objp->frequency ? dol_print_date($objp->date_last_gen,'day') : '').' | ';
- print ''.($objp->frequency ? dol_print_date($objp->date_when,'day') : '').' | ';
-
+ if (! empty($arrayfields['f.date_last_gen']['checked']))
+ {
+ print '';
+ print ($objp->frequency ? dol_print_date($db->jdate($objp->date_last_gen),'day') : ''.$langs->trans('NA').'');
+ print ' | ';
+ }
+ if (! empty($arrayfields['f.date_when']['checked']))
+ {
+ print '';
+ print ($objp->frequency ? dol_print_date($db->jdate($objp->date_when),'day') : ''.$langs->trans('NA').'');
+ print ' | ';
+ }
+ if (! empty($arrayfields['f.datec']['checked']))
+ {
+ print '';
+ print dol_print_date($db->jdate($objp->datec),'dayhour');
+ print ' | ';
+ }
+ if (! empty($arrayfields['f.tms']['checked']))
+ {
+ print '';
+ print dol_print_date($db->jdate($objp->tms),'dayhour');
+ print ' | ';
+ }
+ // Action column
print '';
if ($user->rights->facture->creer)
{
@@ -1842,7 +1911,12 @@ else
$i++;
}
}
- else print ' | | '.$langs->trans("NoneF").' | ';
+ else
+ {
+ $colspan=1;
+ foreach($arrayfields as $key => $val) { if (! empty($val['checked'])) $colspan++; }
+ print '| '.$langs->trans("NoRecordFound").' | ';
+ }
print " ";
print "";
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 5ab62bf5337..72ea7e1a647 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -191,7 +191,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Do we click on purge search criteria ?
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All tests are required to be compatible with all browsers
{
$search_user='';
$search_sale='';
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index aeed72d93d1..3e2b43b7f34 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -68,7 +68,7 @@ $accountstatic=new Account($db);
*/
// If click on purge search criteria ?
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref='';
$search_amount='';
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index ec2bbc78fc6..4a7a2e3c81a 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -77,7 +77,7 @@ $extrafields = new ExtraFields($db);
* Actions
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
{
$search_ref="";
$search_account="";
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index 9a5585c2513..6fcbb62b5d9 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -57,7 +57,7 @@ $search_ref = GETPOST('search_ref','alpha');
* Actions
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref="";
}
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 208be88aeae..6251a6f6521 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -65,7 +65,7 @@ $ligne=new LignePrelevement($db,$user);
* Actions
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_line="";
$search_bon="";
diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php
index baf99182993..b25df5a71ac 100644
--- a/htdocs/compta/salaries/index.php
+++ b/htdocs/compta/salaries/index.php
@@ -79,7 +79,7 @@ else
* Actions
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_ref="";
$search_label="";
diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php
index 2ab2cb1c172..50dd4d430ed 100644
--- a/htdocs/compta/sociales/index.php
+++ b/htdocs/compta/sociales/index.php
@@ -71,7 +71,7 @@ else
$typeid=$_REQUEST['typeid'];
}
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_ref="";
$search_label="";
diff --git a/htdocs/compta/tva/reglement.php b/htdocs/compta/tva/reglement.php
index 44c45a65dc7..c75730d2f8e 100644
--- a/htdocs/compta/tva/reglement.php
+++ b/htdocs/compta/tva/reglement.php
@@ -74,7 +74,7 @@ else
$typeid=$_REQUEST['typeid'];
}
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
{
$search_ref="";
$search_label="";
diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php
index 74ec89bf5d1..7f35c71cd11 100644
--- a/htdocs/contact/agenda.php
+++ b/htdocs/contact/agenda.php
@@ -122,7 +122,7 @@ if (empty($reshook))
}
// Purge search criteria
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$actioncode='';
$search_agenda_label='';
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index b80a300431a..3b7ce848731 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -108,7 +108,7 @@ class Contact extends CommonObject
$this->db = $db;
$this->statut = 1; // By default, status is enabled
}
-
+
/**
* Load indicators into this->nb for board
*
@@ -117,10 +117,10 @@ class Contact extends CommonObject
function load_state_board()
{
global $user;
-
+
$this->nb=array();
$clause = "WHERE";
-
+
$sql = "SELECT count(sp.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
if (!$user->rights->societe->client->voir && !$user->societe_id)
@@ -133,7 +133,7 @@ class Contact extends CommonObject
$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
$sql.= " AND (sp.priv='0' OR (sp.priv='1' AND sp.fk_user_creat=".$user->id."))";
if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
-
+
$resql=$this->db->query($sql);
if ($resql)
{
@@ -410,7 +410,9 @@ class Contact extends CommonObject
{
global $conf,$langs;
- // Object classes
+ $info = array();
+
+ // Object classes
$info["objectclass"]=explode(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS);
$this->fullname=$this->getFullName($langs);
@@ -486,7 +488,7 @@ class Contact extends CommonObject
$result=false;
$this->db->begin();
-
+
// Mis a jour contact
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET";
$sql.= " birthday=".($this->birthday ? "'".$this->db->idate($this->birthday)."'" : "null");
@@ -544,7 +546,7 @@ class Contact extends CommonObject
if ($result < 0) { $error++; }
// End call triggers
}
-
+
if (! $error)
{
$this->db->commit();
@@ -659,7 +661,7 @@ class Contact extends CommonObject
$this->canvas = $obj->canvas;
$this->import_key = $obj->import_key;
-
+
// Define gender according to civility
$this->setGenderFromCivility();
@@ -735,7 +737,7 @@ class Contact extends CommonObject
/**
* Set property ->gender from property ->civility_id
- *
+ *
* @return void
*/
function setGenderFromCivility()
@@ -746,8 +748,8 @@ class Contact extends CommonObject
} else if(in_array($this->civility_id, array('MME','MLE'))) {
$this->gender = 'woman';
}
- }
-
+ }
+
/**
* Load number of elements the contact is used as a link for
* ref_facturation
@@ -1007,13 +1009,13 @@ class Contact extends CommonObject
if ($this->phone_perso) $phonelist[]=$this->phone_perso;
$label.= ' ' . $langs->trans("Phone") . ': '.join(', ',$phonelist);
$label.= ' ' . $langs->trans("Address") . ': '.dol_format_address($this, 1, ' ', $langs);
-
+
$link = 'global->MAIN_OPTIMIZEFORTEXTBROWSER))
+ if (! empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER))
{
$label=$langs->trans("ShowContact");
- $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
+ $linkclose.=' alt="'.dol_escape_htmltag($label, 1).'"';
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.= ' class="classfortooltip">';
@@ -1029,15 +1031,15 @@ class Contact extends CommonObject
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
$link.=$linkclose;
-
+
$linkend='';
-
+
if ($option == 'xxx')
{
$link = '';
$linkend='';
}
-
+
if ($withpicto) $result.=($link.img_object($label, 'contact', 'class="classfortooltip"').$linkend.' ');
$result.=$link.($maxlen?dol_trunc($this->getFullName($langs),$maxlen):$this->getFullName($langs)).$linkend;
return $result;
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index a526a9bd78c..4b638dcfef6 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -146,7 +146,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$day='';
$month='';
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index aea03a73df5..2fdec21f735 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -152,7 +152,7 @@ if (empty($reshook))
// Selection of new fields
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$search_name="";
$search_contract="";
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 7917234158e..ddfb2780f3f 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -4169,6 +4169,9 @@ abstract class CommonObject
$optionsArray = $extrafields->attributes[$this->table_element]['label'];
}
+ $table_element = $this->table_element;
+ if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
+
// Request to get complementary values
if (count($optionsArray) > 0)
{
@@ -4180,7 +4183,7 @@ abstract class CommonObject
$sql.= ", ".$name;
}
}
- $sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields";
+ $sql.= " FROM ".MAIN_DB_PREFIX.$table_element."_extrafields";
$sql.= " WHERE fk_object = ".$rowid;
dol_syslog(get_class($this)."::fetch_optionals get extrafields data for ".$this->table_element, LOG_DEBUG);
@@ -4226,7 +4229,10 @@ abstract class CommonObject
{
$this->db->begin();
- $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
+ $table_element = $this->table_element;
+ if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
+
+ $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id;
dol_syslog(get_class($this)."::deleteExtraFields delete", LOG_DEBUG);
$resql=$this->db->query($sql_del);
if (! $resql)
@@ -4332,11 +4338,14 @@ abstract class CommonObject
}
$this->db->begin();
- $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id;
+ $table_element = $this->table_element;
+ if ($table_element == 'categorie') $table_element = 'categories'; // For compatibility
+
+ $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$table_element."_extrafields WHERE fk_object = ".$this->id;
dol_syslog(get_class($this)."::insertExtraFields delete", LOG_DEBUG);
$this->db->query($sql_del);
- $sql = "INSERT INTO ".MAIN_DB_PREFIX.$this->table_element."_extrafields (fk_object";
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX.$table_element."_extrafields (fk_object";
foreach($new_array_options as $key => $value)
{
$attributeKey = substr($key,8); // Remove 'options_' prefix
@@ -4646,18 +4655,17 @@ abstract class CommonObject
/**
* Get buy price to use for margin calculation. This function is called when buy price is unknown.
- * set buy price = sell price if ForceBuyingPriceIfNull configured,
+ * Set buy price = sell price if ForceBuyingPriceIfNull configured,
* else if calculation MARGIN_TYPE = 'costprice' and costprice is defined, use costprice as buyprice
* else if calculation MARGIN_TYPE = 'pmp' and pmp is calculated, use pmp as buyprice
* else set min buy price as buy price
*
- * @param float $unitPrice product unit price
- * @param float $discountPercent line discount percent
- * @param int $fk_product product id
- *
- * @return float <0 if ko, buyprice if ok
+ * @param float $unitPrice Product unit price
+ * @param float $discountPercent Line discount percent
+ * @param int $fk_product Product id
+ * @return float <0 if KO, buyprice if OK
*/
- public function defineBuyPrice($unitPrice = 0, $discountPercent = 0, $fk_product = 0)
+ public function defineBuyPrice($unitPrice = 0.0, $discountPercent = 0.0, $fk_product = 0)
{
global $conf;
@@ -4964,6 +4972,8 @@ abstract class CommonObject
$fields = array_merge(array('datec'=>$this->db->idate(dol_now())), $this->set_save_query());
+ $keys=array();
+ $values = array();
foreach ($fields as $k => $v) {
$keys[] = $k;
$values[] = $this->quote($v);
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 4b5f151ec72..e44fa8a5aec 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -197,6 +197,7 @@ class ExtraFields
if ($elementtype == 'contact') $elementtype='socpeople';
$table=$elementtype.'_extrafields';
+ if ($elementtype == 'categorie') $table='categories_extrafields';
if (! empty($attrname) && preg_match("/^\w[a-zA-Z0-9_]*$/",$attrname) && ! is_numeric($attrname))
{
@@ -350,6 +351,7 @@ class ExtraFields
if ($elementtype == 'contact') $elementtype='socpeople';
$table=$elementtype.'_extrafields';
+ if ($elementtype == 'categorie') $table='categories_extrafields';
$error=0;
@@ -460,6 +462,7 @@ class ExtraFields
if ($elementtype == 'contact') $elementtype='socpeople';
$table=$elementtype.'_extrafields';
+ if ($elementtype == 'categorie') $table='categories_extrafields';
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
{
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index ab64fad57dc..0f16a25c43f 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -4,7 +4,7 @@
* Copyright (C) 2004 Benoit Mortier
* Copyright (C) 2004 Sebastien Di Cintio
* Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2005-2014 Regis Houssin
+ * Copyright (C) 2005-2017 Regis Houssin
* Copyright (C) 2006 Andre Cianfarani
* Copyright (C) 2006 Marc Barilley/Ocebo
* Copyright (C) 2007 Franky Van Liedekerke
@@ -5845,11 +5845,11 @@ class Form
* @param string $morehtmlright More html code to show after ref.
* @return string Portion HTML with ref + navigation buttons
*/
- function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
- {
- global $langs,$conf,$hookmanager;
+ function showrefnav($object,$paramid,$morehtml='',$shownav=1,$fieldid='rowid',$fieldref='ref',$morehtmlref='',$moreparam='',$nodbprefix=0,$morehtmlleft='',$morehtmlstatus='',$morehtmlright='')
+ {
+ global $langs,$conf,$hookmanager;
- $ret='';
+ $ret='';
if (empty($fieldid)) $fieldid='rowid';
if (empty($fieldref)) $fieldref='ref';
@@ -5880,10 +5880,10 @@ class Form
// Right part of banner
if ($morehtmlright) $ret.=''.$morehtmlright.' ';
- if ($previous_ref || $next_ref || $morehtml)
- {
- $ret.=' | ';
print '
';
-
+
$i++;
}
}
diff --git a/htdocs/don/list.php b/htdocs/don/list.php
index 24ee68eb0f7..2eab3557797 100644
--- a/htdocs/don/list.php
+++ b/htdocs/don/list.php
@@ -52,7 +52,7 @@ $optioncss = GETPOST('optioncss','alpha');
if (!$user->rights->don->lire) accessforbidden();
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
{
$search_all="";
$search_ref="";
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 22e11e6fd1e..e936e0f73bd 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -127,7 +127,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref_exp='';
$search_ref_liv='';
diff --git a/htdocs/expensereport/list.php b/htdocs/expensereport/list.php
index 34f1cfebf38..e0a9df80b3f 100644
--- a/htdocs/expensereport/list.php
+++ b/htdocs/expensereport/list.php
@@ -140,7 +140,7 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // Both test must be present to be compatible with all browsers
{
$search_ref="";
$search_user="";
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 78fd59ecb22..3acef343aa9 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -141,7 +141,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref="";
$search_company="";
diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php
index bbc688264b8..25dc8932049 100644
--- a/htdocs/fourn/commande/info.php
+++ b/htdocs/fourn/commande/info.php
@@ -68,7 +68,7 @@ $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action);
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
// Purge search criteria
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All test are required to be compatible with all browsers
{
$actioncode='';
$search_agenda_label='';
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 3e3fe658155..41c9988e903 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -185,7 +185,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$ordermonth='';
$orderyear='';
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 7cfe9697891..cb562edf9ec 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -64,7 +64,7 @@ $pagenext = $page + 1;
if (! $sortfield) $sortfield="f.date_lim_reglement";
if (! $sortorder) $sortorder="ASC";
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha')) // Both test are required to be compatible with all browsers
{
$search_ref="";
$search_ref_supplier="";
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 056a1961b4c..3b3f7d98ab2 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -194,7 +194,7 @@ if (empty($reshook))
{
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter") || GETPOST("button_removefilter.x")) // All test must be present to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter','alpha') || GETPOST('button_removefilter.x','alpha')) // All test must be present to be compatible with all browsers
{
$search_all="";
$search_user='';
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index fcf7dc92ebf..26db12ac047 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -95,7 +95,7 @@ $arrayfields=array();
* Actions
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref="";
$search_account="";
diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php
index 00e2dbf939d..33659b87639 100644
--- a/htdocs/fourn/product/list.php
+++ b/htdocs/fourn/product/list.php
@@ -82,7 +82,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$sref = '';
$sRefSupplier = '';
diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php
index 88f3438dcaf..92f1d4cafc6 100644
--- a/htdocs/holiday/define_holiday.php
+++ b/htdocs/holiday/define_holiday.php
@@ -84,7 +84,7 @@ if (empty($reshook))
include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
// Purge search criteria
- if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") ||GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_name='';
$toselect='';
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index ec881f04c57..9048ed9a8b8 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -81,7 +81,7 @@ $fieldstosearchall = array(
* Actions
*/
-if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All tests are required to be compatible with all browsers
+if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') || GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers
{
$search_ref="";
$month_create="";
diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
index 0137353f714..89b4f9cd00c 100644
--- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
+++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql
@@ -28,6 +28,7 @@
ALTER TABLE llx_supplier_proposaldet CHANGE COLUMN fk_askpricesupplier fk_supplier_proposal integer NOT NULL;
-- VMYSQL4.1 SET sql_mode = 'ALLOW_INVALID_DATES';
+-- -- VMYSQL4.1 ALTER TABLE llx_adherent MODIFY COLUMN datefin datetime DEFAULT '2001-01-01 00:00:00';
-- VMYSQL4.1 update llx_adherent set datefin = NULL where DATE(STR_TO_DATE(datefin, '%Y-%m-%d')) IS NULL;
-- VMYSQL4.1 SET sql_mode = 'NO_ZERO_DATE';
-- VMYSQL4.1 update llx_adherent set datefin = NULL where DATE(STR_TO_DATE(datefin, '%Y-%m-%d')) IS NULL;
@@ -74,7 +75,7 @@ ALTER TABLE llx_holiday ADD COLUMN ref varchar(30) NULL;
ALTER TABLE llx_holiday ADD COLUMN ref_ext varchar(255);
-create table llx_notify_def_object
+CREATE TABLE llx_notify_def_object
(
id integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
@@ -129,14 +130,15 @@ ALTER TABLE llx_bank_account ADD COLUMN extraparams varchar(255);
-- VMYSQL4.1 ALTER TABLE llx_adherent MODIFY COLUMN country integer DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_adherent MODIFY COLUMN country integer USING country::integer;
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PRODUCT_CREATE','Product or service created','Executed when a product or sevice is created','product',30);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PRODUCT_MODIFY','Product or service modified','Executed when a product or sevice is modified','product',30);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('PRODUCT_DELETE','Product or service deleted','Executed when a product or sevice is deleted','product',30);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expense_report',202);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expense_report',203);
-insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expense_report',204);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_CREATE','Expense report created','Executed when an expense report is created','expense_report',201);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_VALIDATE','Expense report validated','Executed when an expense report is validated','expense_report',202);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_APPROVE','Expense report approved','Executed when an expense report is approved','expense_report',203);
+INSERT INTO llx_c_action_trigger (code,label,description,elementtype,rang) VALUES ('EXPENSE_REPORT_PAYED','Expense report billed','Executed when an expense report is set as billed','expense_report',204);
ALTER TABLE llx_c_email_templates ADD COLUMN content_lines text;
@@ -156,6 +158,8 @@ ALTER TABLE llx_product_price_by_qty ADD COLUMN import_key varchar(14);
ALTER TABLE llx_user ADD COLUMN import_key varchar(14);
+ALTER TABLE llx_facture_rec ADD COLUMN tms timestamp;
+UPDATE llx_facture_rec SET tms = datec where tms < '2000-01-01';
CREATE TABLE llx_product_attribute
(
@@ -196,7 +200,7 @@ CREATE TABLE llx_product_attribute_combination
);
-ALTER TABLE llx_bank_account drop foreign key bank_fk_accountancy_journal;
+ALTER TABLE llx_bank_account DROP FOREIGN KEY bank_fk_accountancy_journal;
-- Fix missing entity column after init demo
ALTER TABLE llx_accounting_journal ADD COLUMN entity integer DEFAULT 1;
@@ -209,18 +213,18 @@ INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (5,'AN', 'Has new journal', 9, 1);
INSERT INTO llx_accounting_journal (rowid, code, label, nature, active) VALUES (6,'ER', 'Expense report journal', 5, 1);
-- Fix old entries
-UPDATE llx_accounting_journal SET nature = 1 where code = 'OD' and nature = 0;
-UPDATE llx_accounting_journal SET nature = 2 where code = 'VT' and nature = 1;
-UPDATE llx_accounting_journal SET nature = 3 where code = 'AC' and nature = 2;
-UPDATE llx_accounting_journal SET nature = 4 where (code = 'BK' or code = 'BQ') and nature = 3;
+UPDATE llx_accounting_journal SET nature = 1 WHERE code = 'OD' AND nature = 0;
+UPDATE llx_accounting_journal SET nature = 2 WHERE code = 'VT' AND nature = 1;
+UPDATE llx_accounting_journal SET nature = 3 WHERE code = 'AC' AND nature = 2;
+UPDATE llx_accounting_journal SET nature = 4 WHERE (code = 'BK' OR code = 'BQ') AND nature = 3;
-UPDATE llx_bank_account as ba set accountancy_journal = 'BQ' where accountancy_journal = 'BK';
-UPDATE llx_bank_account as ba set accountancy_journal = 'OD' where accountancy_journal IS NULL;
+UPDATE llx_bank_account SET accountancy_journal = 'BQ' WHERE accountancy_journal = 'BK';
+UPDATE llx_bank_account SET accountancy_journal = 'OD' WHERE accountancy_journal IS NULL;
ALTER TABLE llx_bank_account ADD COLUMN fk_accountancy_journal integer;
ALTER TABLE llx_bank_account ADD INDEX idx_fk_accountancy_journal (fk_accountancy_journal);
-UPDATE llx_bank_account as ba set fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal as aj where ba.accountancy_journal = aj.code) where accountancy_journal not in ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
+UPDATE llx_bank_account AS ba SET fk_accountancy_journal = (SELECT rowid FROM llx_accounting_journal AS aj WHERE ba.accountancy_journal = aj.code) WHERE accountancy_journal NOT IN ('1', '2', '3', '4', '5', '6', '5', '8', '9', '10', '11', '12', '13', '14', '15');
ALTER TABLE llx_bank_account ADD CONSTRAINT fk_bank_account_accountancy_journal FOREIGN KEY (fk_accountancy_journal) REFERENCES llx_accounting_journal (rowid);
--Update general ledger for FEC format & harmonization
@@ -233,7 +237,7 @@ ALTER TABLE llx_accounting_bookkeeping ADD COLUMN subledger_account varchar(32);
ALTER TABLE llx_accounting_bookkeeping CHANGE COLUMN thirdparty_label subledger_label varchar(255); -- If field was already created, rename it
ALTER TABLE llx_accounting_bookkeeping ADD COLUMN subledger_label varchar(255) AFTER subledger_account; -- If field dod not exists yet
-update llx_accounting_bookkeeping set subledger_account = numero_compte where subledger_account IS NULL;
+UPDATE llx_accounting_bookkeeping SET subledger_account = numero_compte WHERE subledger_account IS NULL;
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN label_compte varchar(255);
ALTER TABLE llx_accounting_bookkeeping MODIFY COLUMN code_journal varchar(32);
@@ -358,9 +362,9 @@ ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_tx d
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price double(24,8) DEFAULT NULL;
ALTER TABLE llx_product_fournisseur_price_log ADD COLUMN multicurrency_price_ttc double(24,8) DEFAULT NULL;
-UPDATE llx_contrat set ref = rowid where ref is null or ref = '';
+UPDATE llx_contrat SET ref = rowid WHERE ref IS NULL OR ref = '';
-create table llx_payment_various
+CREATE TABLE llx_payment_various
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
tms timestamp,
@@ -381,7 +385,7 @@ create table llx_payment_various
)ENGINE=innodb;
-create table llx_default_values
+CREATE TABLE llx_default_values
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id
@@ -441,27 +445,27 @@ ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_tms (tms);
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_datec (datec);
ALTER TABLE llx_inventorydet ADD INDEX idx_inventorydet_fk_inventory (fk_inventory);
-insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
-insert into llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) values (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
-insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) values (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
-insert into llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) values (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
+INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) VALUES (1, '8.5', '85', '0','VAT standard rate (DOM sauf Guyane et Saint-Martin)',0);
+INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,note,active) VALUES (1, '8.5', '85NPR', '1','VAT standard rate (DOM sauf Guyane et Saint-Martin), non perçu par le vendeur mais récupérable par acheteur',0);
+INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,note,active) VALUES (1, '8.5', '85NPROM', '1', 2, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer',0);
+INSERT INTO llx_c_tva(fk_pays,taux,code,recuperableonly,localtax1,localtax1_type,localtax2,localtax2_type,note,active) VALUES (1, '8.5', '85NPROMOMR', '1', 2, 3, 2.5, 3, 'VAT standard rate (DOM sauf Guyane et Saint-Martin), NPR, Octroi de Mer et Octroi de Mer Regional',0);
ALTER TABLE llx_events MODIFY COLUMN ip varchar(250);
ALTER TABLE llx_facture ADD COLUMN fk_fac_rec_source integer;
-DELETE from llx_c_actioncomm where code in ('AC_PROP','AC_COM','AC_FAC','AC_SHIP','AC_SUP_ORD','AC_SUP_INV') AND id NOT IN (SELECT DISTINCT fk_action FROM llx_actioncomm);
+DELETE FROM llx_c_actioncomm WHERE code IN ('AC_PROP','AC_COM','AC_FAC','AC_SHIP','AC_SUP_ORD','AC_SUP_INV') AND id NOT IN (SELECT DISTINCT fk_action FROM llx_actioncomm);
-- Fix: delete orphelin category.
-delete from llx_categorie_product where fk_categorie not in (select rowid from llx_categorie where type = 0);
-delete from llx_categorie_societe where fk_categorie not in (select rowid from llx_categorie where type in (1, 2));
-delete from llx_categorie_member where fk_categorie not in (select rowid from llx_categorie where type = 3);
-delete from llx_categorie_contact where fk_categorie not in (select rowid from llx_categorie where type = 4);
-delete from llx_categorie_project where fk_categorie not in (select rowid from llx_categorie where type = 5);
+DELETE FROM llx_categorie_product WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 0);
+DELETE FROM llx_categorie_societe WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type IN (1, 2));
+DELETE FROM llx_categorie_member WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 3);
+DELETE FROM llx_categorie_contact WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 4);
+DELETE FROM llx_categorie_project WHERE fk_categorie NOT IN (SELECT rowid FROM llx_categorie WHERE type = 5);
ALTER TABLE llx_inventory ADD COLUMN ref varchar(48);
-create table llx_loan_schedule
+CREATE TABLE llx_loan_schedule
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_loan integer,
@@ -518,6 +522,9 @@ ALTER TABLE llx_website_page ADD UNIQUE INDEX uk_website_page_url (fk_website,pa
ALTER TABLE llx_website_page ADD CONSTRAINT fk_website_page_website FOREIGN KEY (fk_website) REFERENCES llx_website (rowid);
+UPDATE llx_extrafields set elementtype='categorie' where elementtype='categories';
+
+
-- For new module blockedlog
CREATE TABLE llx_blockedlog
@@ -559,3 +566,6 @@ ALTER TABLE llx_blockedlog_authority ADD INDEX signature (signature);
UPDATE llx_bank SET label= '(SupplierInvoicePayment)' WHERE label= 'Règlement fournisseur';
UPDATE llx_bank SET label= '(CustomerInvoicePayment)' WHERE label= 'Règlement client';
+UPDATE llx_bank SET label= '(payment_salary)' WHERE label LIKE 'Règlement salaire';
+
+ALTER TABLE llx_mailing_cibles MODIFY COLUMN source_url varchar(255);
diff --git a/htdocs/install/mysql/tables/llx_facture_rec.sql b/htdocs/install/mysql/tables/llx_facture_rec.sql
index 0e25100386b..e9764e1e575 100644
--- a/htdocs/install/mysql/tables/llx_facture_rec.sql
+++ b/htdocs/install/mysql/tables/llx_facture_rec.sql
@@ -25,7 +25,8 @@ create table llx_facture_rec
titre varchar(50) NOT NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
fk_soc integer NOT NULL,
- datec datetime, -- date de creation
+ datec datetime, -- date de creation
+ tms timestamp, -- date creation/modification
amount double(24,8) DEFAULT 0 NOT NULL,
remise real DEFAULT 0,
diff --git a/htdocs/install/mysql/tables/llx_mailing_cibles.sql b/htdocs/install/mysql/tables/llx_mailing_cibles.sql
index f3031069220..c533eb0ff8a 100644
--- a/htdocs/install/mysql/tables/llx_mailing_cibles.sql
+++ b/htdocs/install/mysql/tables/llx_mailing_cibles.sql
@@ -30,7 +30,7 @@ create table llx_mailing_cibles
other varchar(255) NULL,
tag varchar(128) NULL,
statut smallint NOT NULL DEFAULT 0, -- -1 = error, 0 = not sent, ...
- source_url varchar(160),
+ source_url varchar(255),
source_id integer,
source_type varchar(16),
date_envoi datetime,
diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql
index 1b2d184de0f..2e4125e39e4 100644
--- a/htdocs/install/pgsql/functions/functions.sql
+++ b/htdocs/install/pgsql/functions/functions.sql
@@ -102,6 +102,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expedition FOR EACH
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_expensereport FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
+CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_rec FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_fourn FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_facture_fourn_det_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms();
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index a4e7d72bc2c..34e352205b0 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -194,7 +194,7 @@ ValidateHistory=Bind Automatically
AutomaticBindingDone=Automatic binding done
ErrorAccountancyCodeIsAlreadyUse=Error, you cannot delete this accounting account because it is used
-MvtNotCorrectlyBalanced=Mouvement not correctly balanced. Credit = %s. Debit = %s
+MvtNotCorrectlyBalanced=Movement not correctly balanced. Credit = %s. Debit = %s
FicheVentilation=Binding card
GeneralLedgerIsWritten=Transactions are written in the Ledger
GeneralLedgerSomeRecordWasNotRecorded=Some of the transactions could not be dispatched. If there is no other error message, this is probably because they were already dispatched.
diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang
index 1f384015839..cd3aa50c439 100644
--- a/htdocs/langs/en_US/admin.lang
+++ b/htdocs/langs/en_US/admin.lang
@@ -147,6 +147,7 @@ PurgeDeleteAllFilesInDocumentsDir=Delete all files in directory