From 7ed496d7d9e64664fa502dfa8bd6072599665702 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Wed, 12 Nov 2014 17:51:26 +0100 Subject: [PATCH 01/32] FIX: copy extrafields when creating order from propale and creating invoice from order --- htdocs/commande/class/commande.class.php | 12 +++++++++++- htdocs/compta/facture/class/facture.class.php | 10 ++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7a8fd63c8f1..d1a776d3d24 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -972,7 +972,12 @@ class Commande extends CommonOrder $line->marge_tx = $marginInfos[1]; $line->marque_tx = $marginInfos[2]; - $this->lines[$i] = $line; + // get extrafields from original line + $object->lines[$i]->fetch_optionals($object->lines[$i]->rowid); + foreach($object->lines[$i]->array_options as $options_key => $value) + $line->array_options[$options_key] = $value; + + $this->lines[$i] = $line; } $this->socid = $object->socid; @@ -991,6 +996,11 @@ class Commande extends CommonOrder $this->origin = $object->element; $this->origin_id = $object->id; + // get extrafields from original line + $object->fetch_optionals($object->id); + foreach($object->array_options as $options_key => $value) + $this->array_options[$options_key] = $value; + // Possibility to add external linked objects with hooks $this->linked_objects[$this->origin] = $this->origin_id; if (is_array($object->other_linked_objects) && ! empty($object->other_linked_objects)) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 93e245746a0..0d91d7944b8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -701,6 +701,11 @@ class Facture extends CommonInvoice $marginInfos = getMarginInfos($object->lines[$i]->subprice, $object->lines[$i]->remise_percent, $object->lines[$i]->tva_tx, $object->lines[$i]->localtax1_tx, $object->lines[$i]->localtax2_tx, $object->lines[$i]->fk_fournprice, $object->lines[$i]->pa_ht); $line->pa_ht = $marginInfos[0]; + // get extrafields from original line + $object->lines[$i]->fetch_optionals($object->lines[$i]->rowid); + foreach($object->lines[$i]->array_options as $options_key => $value) + $line->array_options[$options_key] = $value; + $this->lines[$i] = $line; } @@ -720,6 +725,11 @@ class Facture extends CommonInvoice $this->origin = $object->element; $this->origin_id = $object->id; + // get extrafields from original line + $object->fetch_optionals($object->id); + foreach($object->array_options as $options_key => $value) + $this->array_options[$options_key] = $value; + // Possibility to add external linked objects with hooks $this->linked_objects[$this->origin] = $this->origin_id; if (! empty($object->other_linked_objects) && is_array($object->other_linked_objects)) From ec20b38adc40a317d6cd9773dd75c20644caa1bc Mon Sep 17 00:00:00 2001 From: Antoine Sirinelli Date: Sun, 16 Nov 2014 23:56:10 +0100 Subject: [PATCH 02/32] Add EIRL in llx_c_forme_juridique MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This a not so new French type of company: Entreprise Individuelle à Responsabilité Limitée (EIRL). Migration script also added. --- htdocs/install/mysql/data/llx_c_forme_juridique.sql | 2 +- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index 513c8b527d2..a0e1e058860 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -84,7 +84,7 @@ insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'56','Soci insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'57','Société par actions simplifiée (SAS)'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'58','Entreprise Unipersonnelle à Responsabilité Limitée (EURL)'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'59','Société par actions simplifiée unipersonnelle (SASU)'); - +insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'60', 'Entreprise Individuelle à Responsabilité Limitée (EIRL)'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'61','Caisse d''épargne et de prévoyance'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'62','Groupement d''intérêt économique (GIE)'); insert into llx_c_forme_juridique (fk_pays, code, libelle) values (1,'63','Société coopérative agricole'); diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index de02887abf8..2986e73cc81 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -18,6 +18,7 @@ -- -- VPGSQL8.2 DELETE FROM llx_usergroup_user WHERE fk_user NOT IN (SELECT rowid from llx_user); -- -- VMYSQL4.1 DELETE FROM llx_usergroup_user WHERE fk_usergroup NOT IN (SELECT rowid from llx_usergroup); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (1, '60', 'Entreprise Individuelle à Responsabilité Limitée (EIRL)', 1); --insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_MODIFY','Intervention modified','Executed when a intervention is modified','ficheinter',19); --insert into llx_c_action_trigger (code,label,description,elementtype,rang) values ('FICHINTER_DELETE','Intervention delete','Executed when a intervention is delete','ficheinter',19); From d0dc792b3cd829c6ef86fa555f880ed8400d3deb Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 17 Nov 2014 11:17:45 +0100 Subject: [PATCH 03/32] check extrafields before inserting in DB --- htdocs/core/class/commonobject.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index e363eda6e4a..5af3f5a93c3 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2195,7 +2195,7 @@ abstract class CommonObject { $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field of attribut - if ($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate + if (isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate $sql.=",".$attributeKey; } $sql .= ") VALUES (".$this->id; @@ -2203,7 +2203,7 @@ abstract class CommonObject { $attributeKey = substr($key,8); // Remove 'options_' prefix // Add field o fattribut - if($extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) + if(isset($extrafields->attribute_type[$attributeKey]) && $extrafields->attribute_type[$attributeKey] != 'separate') // Only for other type of separate) { if ($this->array_options[$key] != '') { From 7a7097a1065e8f78d56ed92f09ac04898fcc6536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Mon, 17 Nov 2014 14:58:48 +0100 Subject: [PATCH 04/32] Work around bug #1643 --- dev/initdata/mysqldump_dolibarr_3.6.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/initdata/mysqldump_dolibarr_3.6.0.sql b/dev/initdata/mysqldump_dolibarr_3.6.0.sql index 77cbbcc511f..b1b8d77aa3c 100644 --- a/dev/initdata/mysqldump_dolibarr_3.6.0.sql +++ b/dev/initdata/mysqldump_dolibarr_3.6.0.sql @@ -4867,7 +4867,7 @@ CREATE TABLE `llx_opensurvey_sondage` ( `mailsonde` tinyint(4) NOT NULL DEFAULT '0', `survey_link_visible` int(11) DEFAULT '1', `origin` varchar(64) DEFAULT NULL, - `tms` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', + `tms` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`id_sondage`), KEY `idx_id_sondage_admin` (`id_sondage_admin`), KEY `idx_date_fin` (`date_fin`) From 079dbf9fbdc800520cb9876ee15daf1ca6f0867c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Mon, 17 Nov 2014 14:59:14 +0100 Subject: [PATCH 05/32] Work around bug #1644 --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index de02887abf8..08b78572c14 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -90,7 +90,6 @@ ALTER TABLE llx_bank_account ADD COLUMN accountancy_journal varchar(3) DEFAULT N ALTER TABLE llx_accountingaccount add column entity integer DEFAULT 1 NOT NULL AFTER rowid; ALTER TABLE llx_accountingaccount add column datec datetime AFTER entity; -ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec; ALTER TABLE llx_accountingaccount add column fk_user_author integer DEFAULT NULL AFTER label; ALTER TABLE llx_accountingaccount add column fk_user_modif integer DEFAULT NULL AFTER fk_user_author; @@ -127,6 +126,7 @@ DROP TABLE llx_compta_compte_generaux; -- Align size for accounting account ALTER TABLE llx_accountingaccount MODIFY COLUMN account_number varchar(32); ALTER TABLE llx_accountingaccount MODIFY COLUMN account_parent varchar(32); +ALTER TABLE llx_accountingaccount add column tms timestamp AFTER datec; ALTER TABLE llx_accountingdebcred MODIFY COLUMN account_number varchar(32); ALTER TABLE llx_bank_account MODIFY COLUMN account_number varchar(32); ALTER TABLE llx_c_chargesociales MODIFY COLUMN accountancy_code varchar(32); From a82953ef70c2848bcc64daad519062ed81d1fe00 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 17 Nov 2014 21:18:26 +0100 Subject: [PATCH 06/32] #1681 Clear sort filter works partially in customers list --- htdocs/comm/list.php | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index ac354d4d08d..ce7eb82f9a1 100644 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -48,13 +48,12 @@ $pagenext = $page + 1; if (! $sortorder) $sortorder="ASC"; if (! $sortfield) $sortfield="s.nom"; -$search_nom=GETPOST("search_nom"); +$search_company=GETPOST("search_company"); $search_zipcode=GETPOST("search_zipcode"); $search_town=GETPOST("search_town"); $search_code=GETPOST("search_code"); $search_compta=GETPOST("search_compta"); $search_status = GETPOST("search_status",'int'); -if ($search_status=='') $search_status=1; // always display activ customer first // Load sale and categ filters $search_sale = GETPOST("search_sale"); @@ -78,21 +77,18 @@ if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'e // Do we click on purge search criteria ? if (GETPOST("button_removefilter_x")) { - $search_categ=''; - $catid=''; - $search_sale=''; - $socname=""; - $search_nom=""; + $search_sale=""; + $search_categ=""; + $catid=""; + $search_company=""; $search_zipcode=""; $search_town=""; - $search_idprof1=''; - $search_idprof2=''; - $search_idprof3=''; - $search_idprof4=''; - $seach_status=1; + $search_code=''; + $search_compta=''; + $search_status=''; } - +if ($search_status=='') $search_status=1; // always display activ customer first /* * view @@ -122,8 +118,8 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid; if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; -if ($search_nom) { - $sql .= natural_search('s.nom', $search_nom); +if ($search_company) { + $sql .= natural_search('s.nom', $search_company); } if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'"; if ($search_town) { @@ -156,7 +152,7 @@ if ($result) { $num = $db->num_rows($result); - $param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town; + $param = "&search_company=".$search_company."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town; if ($search_categ != '') $param.='&search_categ='.$search_categ; if ($search_sale != '') $param.='&search_sale='.$search_sale; if ($search_status != '') $param.='&search_status='.$search_status; @@ -207,7 +203,7 @@ if ($result) print ''; print ''; - print ''; + print ''; print ''; print ''; @@ -235,7 +231,6 @@ if ($result) print ''; print ''; - print '  '; print ''; print ''; From 86e624c3bc1af453e038b98aca0ab15e8cf26392 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 17 Nov 2014 21:31:18 +0100 Subject: [PATCH 07/32] #1684 Clear sort filter works partially in interventions list --- htdocs/fichinter/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php index 524feec13df..a6d3f9720ec 100644 --- a/htdocs/fichinter/list.php +++ b/htdocs/fichinter/list.php @@ -158,7 +158,7 @@ if ($result) } print ''; $liststatus=$interventionstatic->statuts_short; - print $form->selectarray('search_status', $liststatus, GETPOST('search_status'), 1, 0, 0, '', 1); + print $form->selectarray('search_status', $liststatus, $search_status, 1, 0, 0, '', 1); print ''; print ''; print ''; From de7a38417f422c7ac01544f54fb1dfa419ea3f6c Mon Sep 17 00:00:00 2001 From: aspangaro Date: Mon, 17 Nov 2014 21:45:29 +0100 Subject: [PATCH 08/32] #1680 Clear sort filter works partially in prospects list --- htdocs/comm/propal/list.php | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 96d633bd834..876fa30b080 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -56,6 +56,8 @@ $search_societe=GETPOST('search_societe','alpha'); $search_montant_ht=GETPOST('search_montant_ht','alpha'); $search_author=GETPOST('search_author','alpha'); $search_town=GETPOST('search_town','alpha'); +$viewstatut=$db->escape(GETPOST('viewstatut')); +$object_statut=$db->escape(GETPOST('propal_statut')); $sall=GETPOST("sall"); $mesg=(GETPOST("msg") ? GETPOST("msg") : GETPOST("mesg")); @@ -78,6 +80,26 @@ if (! empty($socid)) } $result = restrictedArea($user, $module, $objectid, $dbtable); +if (GETPOST("button_removefilter")) +{ + $search_categ=''; + $search_user=''; + $search_sale=''; + $search_ref=''; + $search_refcustomer=''; + $search_societe=''; + $search_montant_ht=''; + $search_author=''; + $search_town=''; + $year=''; + $month=''; + $viewstatut=''; + $object_statut=''; +} + +if($object_statut != '') +$viewstatut=$object_statut; + // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('propallist')); @@ -93,21 +115,6 @@ $parameters=array('socid'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); -// Do we click on purge search criteria ? -if (GETPOST("button_removefilter_x")) -{ - $search_categ=''; - $search_user=''; - $search_sale=''; - $search_ref=''; - $search_refcustomer=''; - $search_societe=''; - $search_montant_ht=''; - $search_author=''; - $search_town=''; - $year=''; - $month=''; -} /* @@ -132,11 +139,6 @@ $offset = $conf->liste_limit * $page; $pageprev = $page - 1; $pagenext = $page + 1; -$viewstatut=$db->escape(GETPOST('viewstatut')); -$object_statut = $db->escape(GETPOST('propal_statut')); -if($object_statut != '') -$viewstatut=$object_statut; - if (! $sortfield) $sortfield='p.datep'; if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; @@ -322,11 +324,9 @@ if ($result) print ''; $formpropal->selectProposalStatus($viewstatut,1); print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; + print ''; + print ''; + print "\n"; $var=true; $total=0; From 264794ec8ce0c0fc6c18e6dcc15a902b6b11c096 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Nov 2014 23:46:30 +0100 Subject: [PATCH 09/32] #1664 Can't sort by mobile phones in contact list --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 2e28328085a..704971acddd 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -302,7 +302,7 @@ if ($result) print_liste_field_titre($langs->trans("PostOrFunction"),$_SERVER["PHP_SELF"],"p.poste", $begin, $param, '', $sortfield,$sortorder); if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Phone"),$_SERVER["PHP_SELF"],"p.phone", $begin, $param, '', $sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mob", $begin, $param, '', $sortfield,$sortorder); + print_liste_field_titre($langs->trans("PhoneMobile"),$_SERVER["PHP_SELF"],"p.phone_mobile", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("Fax"),$_SERVER["PHP_SELF"],"p.fax", $begin, $param, '', $sortfield,$sortorder); print_liste_field_titre($langs->trans("EMail"),$_SERVER["PHP_SELF"],"p.email", $begin, $param, '', $sortfield,$sortorder); if (! empty($conf->skype->enabled)) { print_liste_field_titre($langs->trans("Skype"),$_SERVER["PHP_SELF"],"p.skype", $begin, $param, '', $sortfield,$sortorder); } From db99b7f09af323836d1cb08afa36c91b88ba5e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Nov 2014 23:49:39 +0100 Subject: [PATCH 10/32] #1665 Can't clear sort filter on contacts list --- htdocs/contact/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 2e28328085a..6c436272504 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -53,7 +53,7 @@ $search_email=GETPOST("search_email"); $search_skype=GETPOST("search_skype"); $search_priv=GETPOST("search_priv"); $search_categ=GETPOST("search_categ",'int'); -$search_statu=GETPOST("search_status",'int'); +$search_status=GETPOST("search_status",'int'); if ($search_status=='') $search_status=1; // always display activ customer first @@ -96,9 +96,9 @@ else if ($type == "o") $urlfiche=""; } -if (GETPOST('button_removefilter')) +if (GETPOST('button_removefilter_x')) { - $search_firstlast_only=""; + $search_firstlast_only=""; $search_lastname=""; $search_firstname=""; $search_societe=""; @@ -356,8 +356,8 @@ if ($result) print $form->selectarray('search_status', array('0'=>$langs->trans('ActivityCeased'),'1'=>$langs->trans('InActivity')),$search_status); print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print ''; From 167cf258e7460a47650f578ffc2f3db865cc7eee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Nov 2014 23:53:01 +0100 Subject: [PATCH 11/32] #1666 Clear sort filter works partially in product/services --- htdocs/product/list.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index a6b09cea8a6..4555b2fd455 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -87,12 +87,14 @@ else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); * Actions */ -if (isset($_POST["button_removefilter_x"])) +if (GETPOST([)"button_removefilter_x")) { $sref=""; $sbarcode=""; $snom=""; $search_categ=0; + $tosell=""; + $tobuy=""; } @@ -379,7 +381,7 @@ else print ''; print ''; - print ''; + print ''; print ''; print ''; From f2eda0629b5815a249a97f9045ac5269fcac8a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Nov 2014 23:54:39 +0100 Subject: [PATCH 12/32] #1682 Date is missing in proposals list --- htdocs/comm/propal/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 96d633bd834..e4cdde4e713 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -391,7 +391,7 @@ if ($result) // Date proposal print ''; - print dol_print_date($db->jdate($obj->dp), 'day'); + print dol_print_date($db->jdate($objp->dp), 'day'); print "\n"; // Date end validity From 5536abecf795d6b7c8da62ca82194a11ed2a07fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 17 Nov 2014 23:57:01 +0100 Subject: [PATCH 13/32] #1683 Can't clear sort filter on proposals list --- htdocs/comm/propal/list.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index 96d633bd834..b2e4555b896 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -323,8 +323,8 @@ if ($result) $formpropal->selectProposalStatus($viewstatut,1); print ''; print ''; - print ''; - print ''; + print ''; + print ''; print ''; print "\n"; From d8192d8223808252d8b0789a145eedaf30f674a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Nov 2014 00:02:53 +0100 Subject: [PATCH 14/32] #1685-1686 Clear sort filter works partially in supplier invoices --- htdocs/fourn/facture/list.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index 616e9690e8a..dabf7d28cd4 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -72,8 +72,9 @@ $search_amount_no_tax = GETPOST("search_amount_no_tax","alpha"); $search_amount_all_tax = GETPOST("search_amount_all_tax","alpha"); $month = GETPOST("month","int"); $year = GETPOST("year","int"); +$filter = GETPOST("filtre"); -if (GETPOST("button_removefilter")) +if (GETPOST("button_removefilter_x")) { $search_ref=""; $search_ref_supplier=""; @@ -83,6 +84,7 @@ if (GETPOST("button_removefilter")) $search_amount_all_tax=""; $year=""; $month=""; + $filter=""; } /* @@ -136,9 +138,9 @@ if ($socid) { $sql .= " AND s.rowid = ".$socid; } -if (GETPOST('filtre') && GETPOST('filtre') != -1) // GETPOST('filtre') may be a string +if ($filter) && $filter != -1) // GETPOST('filtre') may be a string { - $filtrearr = explode(",", GETPOST('filtre')); + $filtrearr = explode(",", $filter); foreach ($filtrearr as $fil) { $filt = explode(":", $fil); @@ -217,7 +219,7 @@ if ($resql) if ($search_company) $param.='&search_company='.urlencode($search_company); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); - if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre")); + if ($filter) && $filter != -1) $param.='&filtre='.urlencode($filter); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print '
'; @@ -269,8 +271,8 @@ if ($resql) print ''; print ''; print ''; - $liststatus=array('paye:0'=>$langs->trans("Unpayed"), 'paye:1'=>$langs->trans("Payed")); - print $form->selectarray('filtre', $liststatus, GETPOST('filtre'), 1); + $liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); + print $form->selectarray('filtre', $liststatus, $filter), 1); print ''; print ''; print ''; From e9966c50da70fcdfaf78f64f8e3ef7db95eb7f35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Nov 2014 00:04:45 +0100 Subject: [PATCH 15/32] #1689 Can't sort supplier invoice payments on amounts --- htdocs/fourn/facture/paiement.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index f467e9235ef..57100bd98f0 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -536,7 +536,7 @@ if (empty($action)) print_liste_field_titre($langs->trans('ThirdParty'),$_SERVER["PHP_SELF"],'s.nom','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Type'),$_SERVER["PHP_SELF"],'c.libelle','',$paramlist,'',$sortfield,$sortorder); print_liste_field_titre($langs->trans('Account'),$_SERVER["PHP_SELF"],'ba.label','',$paramlist,'',$sortfield,$sortorder); - print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'f.amount','',$paramlist,'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans('Amount'),$_SERVER["PHP_SELF"],'p.amount','',$paramlist,'align="right"',$sortfield,$sortorder); //print_liste_field_titre($langs->trans('Invoice'),$_SERVER["PHP_SELF"],'ref_supplier','',$paramlist,'',$sortfield,$sortorder); print ' '; print "\n"; From cd3bafbef7b0661795e2371746577d64c4a8bd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 18 Nov 2014 00:27:53 +0100 Subject: [PATCH 16/32] Update list.php --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 4555b2fd455..67cb7fd5f11 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -87,7 +87,7 @@ else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); * Actions */ -if (GETPOST([)"button_removefilter_x")) +if (GETPOST("button_removefilter_x")) { $sref=""; $sbarcode=""; From 1b077950cd2ffd628be69ed26425800db1ff9f48 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 18 Nov 2014 19:54:48 +0100 Subject: [PATCH 17/32] #1698 Untranslatable strings in donation module admin --- htdocs/langs/en_US/donations.lang | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/htdocs/langs/en_US/donations.lang b/htdocs/langs/en_US/donations.lang index 85dfdd8ff4d..06c29872b17 100644 --- a/htdocs/langs/en_US/donations.lang +++ b/htdocs/langs/en_US/donations.lang @@ -31,3 +31,9 @@ DonationRecipient=Donation recipient ThankYou=Thank You IConfirmDonationReception=The recipient declare reception, as a donation, of the following amount MinimumAmount=Minimum amount is %s +FreeTextOnDonations=Free text on donations +#### French options ##### +FrenchOptions=French options +DONATION_ART200=Activate article 200 from CGI if you are concerned +DONATION_ART238=Activate article 238 from CGI if you are concerned +DONATION_ART885=Activate article 885 from CGI if you are concerned From 621f2b5c77ba00e52658d27cf4de43f4b3806527 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 18 Nov 2014 21:28:12 +0100 Subject: [PATCH 18/32] #1672 VAT accounts by default are lost in migration --- htdocs/install/mysql/migration/3.6.0-3.7.0.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index de02887abf8..60013492187 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -102,6 +102,8 @@ UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_BUY_ACCOUNT' WHERE name = 'COMPT UPDATE llx_const SET name = 'ACCOUNTING_PRODUCT_SOLD_ACCOUNT' WHERE name = 'COMPTA_PRODUCT_SOLD_ACCOUNT'; UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_BUY_ACCOUNT' WHERE name = 'COMPTA_SERVICE_BUY_ACCOUNT'; UPDATE llx_const SET name = 'ACCOUNTING_SERVICE_SOLD_ACCOUNT' WHERE name = 'COMPTA_SERVICE_SOLD_ACCOUNT'; +UPDATE llx_const SET name = 'ACCOUNTING_VAT_ACCOUNT' WHERE name = 'COMPTA_VAT_ACCOUNT'; +UPDATE llx_const SET name = 'ACCOUNTING_VAT_BUY_ACCOUNT' WHERE name = 'COMPTA_VAT_BUY_ACCOUNT'; -- Compatibility with module Accounting Expert UPDATE llx_const SET name = 'ACCOUNTING_SEPARATORCSV' WHERE name = 'ACCOUNTINGEX_SEPARATORCSV'; From e3edc3f690e8489f3b511f20930f95793400fbbd Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 18 Nov 2014 21:55:41 +0100 Subject: [PATCH 19/32] #1688 The ref filter searches on rowid not on ref in unpaid supplier invoices list --- htdocs/fourn/facture/impayees.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php index 3253a79fcd8..2767c792f9e 100644 --- a/htdocs/fourn/facture/impayees.php +++ b/htdocs/fourn/facture/impayees.php @@ -117,7 +117,7 @@ if ($user->rights->fournisseur->facture->lire) if ($search_ref) { - $sql .= " AND f.rowid LIKE '%".$search_ref."%'"; + $sql .= " AND f.ref LIKE '%".$search_ref."%'"; } if ($search_ref_supplier) { @@ -241,7 +241,7 @@ if ($user->rights->fournisseur->facture->lire) print $facturestatic->getNomUrl(1); print "\n"; - print ''.dol_trunc($objp->ref_supplier,12)."\n"; + print ''.dol_trunc($objp->ref_supplier,12).''; print ''.dol_print_date($db->jdate($objp->df),'day')."\n"; print ''.dol_print_date($db->jdate($objp->datelimite),'day'); @@ -258,7 +258,7 @@ if ($user->rights->fournisseur->facture->lire) print "".price($objp->total_ttc).""; print "".price($objp->am).""; - // Affiche statut de la facture + // Show invoice status print ''; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print ''; From 3dacdf4e4a5ff54dc7a57a262d95465fc4580569 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 19 Nov 2014 09:41:21 +0100 Subject: [PATCH 20/32] Fix: Conflicts and remove duplicate code --- htdocs/core/class/commonobject.class.php | 4 +--- htdocs/product/class/product.class.php | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index b5aac7adc74..72eeba4d59f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2012 Christophe Battarel - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel * Copyright (C) 2011-2014 Philippe Grand * Copyright (C) 2012 Marcos García @@ -611,8 +611,6 @@ abstract class CommonObject require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; - $thirdparty = new Societe($this->db); $result=$thirdparty->fetch(isset($this->socid)?$this->socid:$this->fk_soc); $this->client = $thirdparty; // deprecated diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index 1faa192bd0d..2987d0de8fd 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -4,16 +4,10 @@ * Copyright (C) 2005-2013 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2007-2011 Jean Heimburger -<<<<<<< HEAD * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2013-2014 Cedric GROSS - * Copyright (C) 2013 Marcos García - * Copyright (C) 2011-2014 Alexandre Spangaro -======= - * Copyright (C) 2010-2011 Juanjo Menent - * Copyright (C) 2013 Cedric GROSS * Copyright (C) 2013-2014 Marcos García ->>>>>>> refs/remotes/origin/3.5 + * Copyright (C) 2011-2014 Alexandre Spangaro * * 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 From 4d48205e45fa2c01cc334f6aa2ccc61f0dadb88d Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 20 Nov 2014 06:01:08 +0100 Subject: [PATCH 21/32] #1657 Intervention preview date is not displayed --- htdocs/fichinter/apercu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php index 65721bdcce1..0d4d3421538 100644 --- a/htdocs/fichinter/apercu.php +++ b/htdocs/fichinter/apercu.php @@ -155,7 +155,7 @@ if ($id > 0 || ! empty($ref)) // Date print ''.$langs->trans("Date").''; - print "".dol_print_date($object->date,"daytext")."\n"; + print "".dol_print_date($object->datec,"daytext")."\n"; print ''; print ''; From 01a5f22f4a42009c053614af438dc51447726d2a Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 20 Nov 2014 06:34:50 +0100 Subject: [PATCH 22/32] #1704 Untranslatable token in externalsite module admin --- htdocs/externalsite/admin/externalsite.php | 2 +- htdocs/langs/en_US/externalsite.lang | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/externalsite/admin/externalsite.php b/htdocs/externalsite/admin/externalsite.php index 95d0a4397de..93595b2cb9f 100644 --- a/htdocs/externalsite/admin/externalsite.php +++ b/htdocs/externalsite/admin/externalsite.php @@ -99,7 +99,7 @@ $var=!$var; print ""; print ''.$langs->trans("Label").""; print "global->EXTERNALSITE_LABEL) || $conf->global->EXTERNALSITE_LABEL=='ExternalSite')?'':$conf->global->EXTERNALSITE_LABEL)) . "\" size=\"12\">"; -print "My menu entry"; +print "".$langs->trans("ExampleMyMenuEntry").""; print ""; $var=!$var; diff --git a/htdocs/langs/en_US/externalsite.lang b/htdocs/langs/en_US/externalsite.lang index 62da68c045d..afec761f5fe 100644 --- a/htdocs/langs/en_US/externalsite.lang +++ b/htdocs/langs/en_US/externalsite.lang @@ -2,3 +2,4 @@ ExternalSiteSetup=Setup link to external website ExternalSiteURL=External Site URL ExternalSiteModuleNotComplete=Module ExternalSite was not configured properly. +ExampleMyMenuEntry=My menu entry \ No newline at end of file From 4b229dabfd9e84ed0d64aad6931a54b124a606aa Mon Sep 17 00:00:00 2001 From: aspangaro Date: Thu, 20 Nov 2014 06:55:38 +0100 Subject: [PATCH 23/32] #1706 Missing table cell in shipment list header + Search fields doesn't work --- htdocs/expedition/list.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php index 4cd62249545..af1d244e0d0 100644 --- a/htdocs/expedition/list.php +++ b/htdocs/expedition/list.php @@ -36,7 +36,7 @@ $result = restrictedArea($user, 'expedition',$expeditionid,''); $search_ref_exp = GETPOST("search_ref_exp"); $search_ref_liv = GETPOST('search_ref_liv'); -$search_societe = GETPOST("search_societe"); +$search_company = GETPOST("search_company"); $sortfield = GETPOST('sortfield','alpha'); $sortorder = GETPOST('sortorder','alpha'); @@ -51,12 +51,12 @@ if (! $sortfield) $sortfield="e.ref"; if (! $sortorder) $sortorder="DESC"; $limit = $conf->liste_limit; -// Do we click on purge search criteria ? +// Purge search criteria if (GETPOST("button_removefilter_x")) { $search_ref_exp=''; $search_ref_liv=''; - $search_societe=''; + $search_company=''; } /* @@ -92,7 +92,7 @@ if ($socid) } if ($search_ref_exp) $sql .= natural_search('e.ref', $search_ref_exp); if ($search_ref_liv) $sql .= natural_search('l.ref', $search_ref_liv); -if ($search_societe) $sql .= natural_search('s.nom', $search_societe); +if ($search_company) $sql .= natural_search('s.nom', $search_company); $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1,$offset); @@ -107,12 +107,13 @@ if ($resql) $param=""; if ($search_ref_exp) $param.= "&search_ref_exp=".$search_ref_exp; if ($search_ref_liv) $param.= "&search_ref_liv=".$search_ref_liv; - if ($search_societe) $param.= "&search_societe=".$search_societe; + if ($search_company) $param.= "&search_company=".$search_company; print_barre_liste($langs->trans('ListOfSendings'), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num); $i = 0; + print ''."\n"; print ''; print ''; @@ -124,6 +125,7 @@ if ($resql) print_liste_field_titre($langs->trans("DateReceived"),"ship2bill.php","e.date_expedition","",$param, 'align="center"',$sortfield,$sortorder); } print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder); + print ''; print "\n"; // Lignes des champs de filtre @@ -132,7 +134,7 @@ if ($resql) print ''; print ''; print ''; print ''; if($conf->livraison_bon->enabled) { @@ -141,13 +143,9 @@ if ($resql) print ''; print ''; } - print ''; + print ''; print ''; @@ -161,12 +159,15 @@ if ($resql) $objp = $db->fetch_object($resql); $var=!$var; + + // Ref print ""; print "\n"; + // Third party print ''; - // Date delivery planed + + // Date delivery planed print "'; - + print ''; print "\n"; From d7b0aab71ae8c4624f9e249bf422aa04fa6974e3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:52:08 +0100 Subject: [PATCH 30/32] Clear works with all browsers --- htdocs/product/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 67cb7fd5f11..f242121625f 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -87,7 +87,7 @@ else $result=restrictedArea($user,'produit|service','','','','','',$objcanvas); * Actions */ -if (GETPOST("button_removefilter_x")) +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers { $sref=""; $sbarcode=""; From d3e216c19a3386e686bffe1f7dacad1c802034a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:53:37 +0100 Subject: [PATCH 31/32] Clear compatible with all browsers --- htdocs/contact/list.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php index 6c436272504..e18fc0a0a97 100644 --- a/htdocs/contact/list.php +++ b/htdocs/contact/list.php @@ -96,7 +96,7 @@ else if ($type == "o") $urlfiche=""; } -if (GETPOST('button_removefilter_x')) +if (GETPOST('button_removefilter_x') || GETPOST('button_removefilter')) // Both tests are required to be compatible with all browsers { $search_firstlast_only=""; $search_lastname=""; From 667f1bf49794e7ebae7dfd50020d5cd3d2b8df0d Mon Sep 17 00:00:00 2001 From: Andrelec1 Date: Mon, 17 Nov 2014 14:55:22 +0100 Subject: [PATCH 32/32] Fix : more than 1000 holidays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Si il y a plus de 1000 jours de congés, le délimiteur des millier fais bugger les calcule ... --- htdocs/holiday/card.php | 1 - htdocs/holiday/class/holiday.class.php | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/holiday/card.php b/htdocs/holiday/card.php index 31a4e40599f..bbffe26cf9c 100644 --- a/htdocs/holiday/card.php +++ b/htdocs/holiday/card.php @@ -761,7 +761,6 @@ if (empty($id) || $action == 'add' || $action == 'request' || $action == 'create print ''; } else print $form->select_users(GETPOST('userid')?GETPOST('userid'):$user->id,'userid',0,'',0); - //var_dump($cp->getConfCP('nbHolidayDeducted')); $nb_holiday = $cp->getCPforUser($user->id) / $cp->getConfCP('nbHolidayDeducted'); print '   '.$langs->trans('SoldeCPUser', round($nb_holiday,2)).''; print ''; diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php index 5381c99df07..2ecf8edfce3 100644 --- a/htdocs/holiday/class/holiday.class.php +++ b/htdocs/holiday/class/holiday.class.php @@ -1045,7 +1045,8 @@ class Holiday extends CommonObject $result = $this->db->query($sql); if($result) { $obj = $this->db->fetch_object($result); - return number_format($obj->nb_holiday,2); + //return number_format($obj->nb_holiday,2); + return $obj->nb_holiday; } else { return '0'; }
 
'; - print ''; + print ''; print '  '; - // Développé dans la 3.7 - //print img_search(); - //print img_searchclear(); - print ''; + print ''; print ''; - print ''; print ''.$langs->trans("All").' / '.$langs->trans("None").''; print '
"; $shipment->id=$objp->rowid; $shipment->ref=$objp->ref; print $shipment->getNomUrl(1); print "'; $companystatic->id=$objp->socid; @@ -174,7 +175,8 @@ if ($resql) $companystatic->name=$objp->socname; print $companystatic->getNomUrl(1); print '"; print dol_print_date($db->jdate($objp->date_expedition),"day"); /*$now = time(); From d6f47227fe3b01bf4b00bf981dd8cd091bfe669b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:09:54 +0100 Subject: [PATCH 24/32] Fixed: [ bug #1646 ] Can't list unpaid invoices --- htdocs/compta/facture/impayees.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php index 320d86f3377..c762aac5702 100644 --- a/htdocs/compta/facture/impayees.php +++ b/htdocs/compta/facture/impayees.php @@ -429,7 +429,8 @@ if ($search_paymentmode) $sql .= " AND f.fk_mode_reglement = ".$search_payme 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'))."%'"; -$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type "; +$sql.= " GROUP BY s.nom, s.rowid, s.email, f.rowid, f.facnumber, f.ref_client, f.increment, f.total, f.tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp,"; +$sql.= " f.datef, f.date_lim_reglement, f.paye, f.fk_statut, f.type, fk_mode_reglement"; if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user "; $sql.= " ORDER BY "; $listfield=explode(',',$sortfield); From 43f3e28fd630a1b95a7ca8a78b7497e8cccf5446 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:12:36 +0100 Subject: [PATCH 25/32] Fixed: [ bug #1645 ] Can't list contracts --- htdocs/contrat/list.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php index cf57e97933b..b1b28192395 100644 --- a/htdocs/contrat/list.php +++ b/htdocs/contrat/list.php @@ -79,14 +79,13 @@ $now=dol_now(); llxHeader(); $sql = 'SELECT'; +$sql.= " c.rowid as cid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier,"; +$sql.= " s.nom as name, s.rowid as socid,"; $sql.= ' SUM('.$db->ifsql("cd.statut=0",1,0).') as nb_initial,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')",1,0).') as nb_running,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,'; $sql.= ' SUM('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,'; -$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 as name, s.rowid as socid"; -$sql.= " ,c.ref_supplier"; +$sql.= ' SUM('.$db->ifsql("cd.statut=5",1,0).') as nb_closed'; $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"; @@ -107,7 +106,7 @@ if (!empty($search_ref_supplier)) { if ($sall) { $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall); } -$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, s.nom, s.rowid"; +$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, c.ref_supplier, s.nom, s.rowid"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($conf->liste_limit + 1, $offset); From eaa4b6cb56a9de31d37352e6540adb698b0e9e58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:37:18 +0100 Subject: [PATCH 26/32] Add PR manually because of conflict "#1678 & #1677 Untranslatable token" --- htdocs/compta/paiement/cheque/index.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index 27782259333..362493b7f19 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php'; $langs->load("banks"); $langs->load("categories"); +$langs->load("compta"); +$langs->load("bills"); // Security check if ($user->societe_id) $socid=$user->societe_id; From 730bf1c25cf77b48f60b3b18114e83f8a78561d9 Mon Sep 17 00:00:00 2001 From: BENKE Charles Date: Wed, 19 Nov 2014 09:28:11 +0100 Subject: [PATCH 27/32] Update html.formcontract.class.php bad filtering on contract list (same sql rule as project) --- htdocs/core/class/html.formcontract.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index e0d550b4205..0eb2d4d4b26 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -65,7 +65,7 @@ class FormContract $sql.= " WHERE c.entity = ".$conf->entity; //if ($contratListId) $sql.= " AND c.rowid IN (".$contratListId.")"; if ($socid == 0) $sql.= " AND (c.fk_soc = 0 OR c.fk_soc IS NULL)"; - else $sql.= " AND c.fk_soc = ".$socid; + if ($socid > 0) $sql.= " AND (c.fk_soc=".$socid." OR c.fk_soc IS NULL)"; dol_syslog(get_class($this)."::select_contract", LOG_DEBUG); $resql=$db->query($sql); From 8c440dea4aeabdc38d8463f8f1571f76da1a1538 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:47:14 +0100 Subject: [PATCH 28/32] Fxied: Syntax error --- htdocs/product/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/card.php b/htdocs/product/card.php index 5f9d42cdd44..92d588d19fe 100644 --- a/htdocs/product/card.php +++ b/htdocs/product/card.php @@ -124,7 +124,7 @@ if (empty($reshook)) // Barcode value if ($action == 'setbarcode' && $createbarcode) { - $result=$object->check_barcode(GETPOST('barcode'),GETPOT('barcode_type_code')); + $result=$object->check_barcode(GETPOST('barcode'),GETPOST('barcode_type_code')); if ($result >= 0) { From e4804f99ff62d5a385450444359fdec31653b9fc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 22 Nov 2014 15:50:16 +0100 Subject: [PATCH 29/32] Merge pull request #2047 from frederic34/patch-6 #1685-1686 Clear sort filter works partially in supplier invoices --- htdocs/fourn/facture/list.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php index dabf7d28cd4..357df92a4eb 100644 --- a/htdocs/fourn/facture/list.php +++ b/htdocs/fourn/facture/list.php @@ -74,7 +74,7 @@ $month = GETPOST("month","int"); $year = GETPOST("year","int"); $filter = GETPOST("filtre"); -if (GETPOST("button_removefilter_x")) +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test must be present to be compatible with all browsers { $search_ref=""; $search_ref_supplier=""; @@ -138,7 +138,7 @@ if ($socid) { $sql .= " AND s.rowid = ".$socid; } -if ($filter) && $filter != -1) // GETPOST('filtre') may be a string +if ($filter && $filter != -1) // GETPOST('filtre') may be a string { $filtrearr = explode(",", $filter); foreach ($filtrearr as $fil) @@ -219,7 +219,7 @@ if ($resql) if ($search_company) $param.='&search_company='.urlencode($search_company); if ($search_amount_no_tax) $param.='&search_amount_no_tax='.urlencode($search_amount_no_tax); if ($search_amount_all_tax) $param.='&search_amount_all_tax='.urlencode($search_amount_all_tax); - if ($filter) && $filter != -1) $param.='&filtre='.urlencode($filter); + if ($filter && $filter != -1) $param.='&filtre='.urlencode($filter); print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords); print ''; @@ -272,7 +272,7 @@ if ($resql) print ''; print ''; $liststatus=array('paye:0'=>$langs->trans("Unpaid"), 'paye:1'=>$langs->trans("Paid")); - print $form->selectarray('filtre', $liststatus, $filter), 1); + print $form->selectarray('filtre', $liststatus, $filter, 1); print ''; print ''; print ''; @@ -331,7 +331,7 @@ if ($resql) //print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$objp->am); print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5); print '