From 3940abe7c19744764df53eeb31f758a2f9e92dc2 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Sat, 7 Feb 2015 10:48:03 +0100 Subject: [PATCH 01/27] FIX: select DISTINCT for natural search on proposal list (in the same way it's done in invoices list) --- htdocs/comm/propal/list.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php index d45718b5daf..33748025edc 100644 --- a/htdocs/comm/propal/list.php +++ b/htdocs/comm/propal/list.php @@ -141,7 +141,9 @@ if (! $sortorder) $sortorder='DESC'; $limit = $conf->liste_limit; -$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client,'; +if (! $sall) $sql = 'SELECT'; +else $sql = 'SELECT DISTINCT'; +$sql.= ' s.rowid, s.nom, s.town, s.client, s.code_client,'; $sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,'; if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,"; $sql.= ' u.login'; From d9ac21ab822ede55f6090c86c40eb85da1bfa2a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 8 Feb 2015 16:54:41 +0100 Subject: [PATCH 02/27] Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL --- ChangeLog | 1 + htdocs/compta/resultat/clientfourn.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..349ac323ff9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php index 26589be3c5d..1e09ea0a8fe 100644 --- a/htdocs/compta/resultat/clientfourn.php +++ b/htdocs/compta/resultat/clientfourn.php @@ -551,7 +551,7 @@ $sql.= " WHERE p.entity = ".$conf->entity; if (! empty($date_start) && ! empty($date_end)) $sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'"; -$sql.= " GROUP BY u.rowid"; +$sql.= " GROUP BY u.rowid, p.label, p.datep, p.fk_user"; $sql.= " ORDER BY u.firstname"; dol_syslog("get payment salaries sql=".$sql); From 5747dbfe9becec1acc8acbcfd0d2d4c4bcd26b61 Mon Sep 17 00:00:00 2001 From: Arnaud Aujon Chevallier Date: Mon, 9 Feb 2015 13:55:43 +0100 Subject: [PATCH 03/27] FIXED : product webservice can now save barcode --- .../webservices/server_productorservice.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/htdocs/webservices/server_productorservice.php b/htdocs/webservices/server_productorservice.php index c2eba3f9d1b..a4430ab7b58 100644 --- a/htdocs/webservices/server_productorservice.php +++ b/htdocs/webservices/server_productorservice.php @@ -452,6 +452,12 @@ function createProductOrService($authentication,$product) $error++; $errorcode='KO'; $errorlabel="You must choose between price or price_net to provide price."; } + if ($product['barcode'] && !$product['barcode_type']) + { + $errror++; $errorcode='KO' ; $errorlabel="You must set a barcode type when setting a barcode."; + } + + if (! $error) { @@ -473,6 +479,12 @@ function createProductOrService($authentication,$product) $newobject->price_base_type=$product['price_base_type']; $newobject->date_creation=$now; + if ($product['barcode']) + { + $newobject->barcode = $product['barcode']; + $newobject->barcode_type = $product['barcode_type']; + } + $newobject->stock_reel=$product['stock_real']; $newobject->pmp=$product['pmp']; $newobject->seuil_stock_alert=$product['stock_alert']; @@ -562,6 +574,11 @@ function updateProductOrService($authentication,$product) } + if ($product['barcode'] && !$product['barcode_type']) + { + $errror++; $errorcode='KO' ; $errorlabel="You must set a barcode type when setting a barcode."; + } + if (! $error) { include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; @@ -584,6 +601,12 @@ function updateProductOrService($authentication,$product) $newobject->price_base_type=$product['price_base_type']; $newobject->date_creation=$now; + if ($product['barcode']) + { + $newobject->barcode = $product['barcode']; + $newobject->barcode_type = $product['barcode_type']; + } + $newobject->stock_reel=$product['stock_real']; $newobject->pmp=$product['pmp']; $newobject->seuil_stock_alert=$product['stock_alert']; From 949f9e40a083cda147619fd5b16bda347eef9f1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Feb 2015 00:20:47 +0100 Subject: [PATCH 04/27] Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object --- ChangeLog | 1 + htdocs/core/lib/functions.lib.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..4c5d250bf9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f6f09dd1567..2f1beda65dc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2952,7 +2952,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; - $sql .= " AND t.taux = ".$tva." AND t.active = 1"; + $sql .= " AND t.taux = ".(int)$tva." AND t.active = 1"; dol_syslog("get_localtax sql=".$sql); $resql=$db->query($sql); @@ -2988,7 +2988,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty) $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'"; - $sql .= " AND t.taux = ".$vatrate." AND t.active = 1"; + $sql .= " AND t.taux = ".(int)$vatrate." AND t.active = 1"; $resql=$db->query($sql); if ($resql) From 58a61e129498aeef2512d27351336772f98b4c7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Feb 2015 00:23:32 +0100 Subject: [PATCH 05/27] Changed int typecast to float --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 2f1beda65dc..121fbc769b7 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2952,7 +2952,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; - $sql .= " AND t.taux = ".(int)$tva." AND t.active = 1"; + $sql .= " AND t.taux = ".(float)$tva." AND t.active = 1"; dol_syslog("get_localtax sql=".$sql); $resql=$db->query($sql); @@ -2988,7 +2988,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty) $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'"; - $sql .= " AND t.taux = ".(int)$vatrate." AND t.active = 1"; + $sql .= " AND t.taux = ".(float)$vatrate." AND t.active = 1"; $resql=$db->query($sql); if ($resql) From a9dc6bb3d7a8797787d2016f0d9413cb2f00172c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Feb 2015 00:55:22 +0100 Subject: [PATCH 06/27] Fix: [ bug #1826 ] Supplier payment types are not translated in fourn/facture/paiement.php --- ChangeLog | 1 + htdocs/fourn/facture/paiement.php | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..eb0736c543d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1826 ] Supplier payment types are not translated in fourn/facture/paiement.php ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index b6a4c5a7925..a8576cff01d 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Marcos García * * 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 @@ -447,7 +448,7 @@ if (empty($action)) $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,'; $sql.= ' s.rowid as socid, s.nom,'; - $sql.= ' c.libelle as paiement_type,'; + $sql.= ' c.code as paiement_type, c.libelle as paiement_libelle,'; $sql.= ' ba.rowid as bid, ba.label,'; if (!$user->rights->societe->client->voir) $sql .= ' sc.fk_soc, sc.fk_user,'; $sql.= ' SUM(f.amount)'; @@ -486,7 +487,7 @@ if (empty($action)) { $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } - $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.libelle, ba.rowid, ba.label"; + $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label"; if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -558,7 +559,9 @@ if (empty($action)) else print ' '; print ''; - print ''.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."\n"; + $payment_type = $langs->trans("PaymentType".$objp->paiement_type)!=("PaymentType".$objp->paiement_type)?$langs->trans("PaymentType".$objp->paiement_type):$objp->paiement_libelle; + + print ''.$payment_type.' '.dol_trunc($objp->num_paiement,32)."\n"; print ''; if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; From f1d5e1ba7b082295c7603b6ff51d2598b50e75ce Mon Sep 17 00:00:00 2001 From: aspangaro Date: Tue, 10 Feb 2015 07:14:55 +0100 Subject: [PATCH 07/27] FIXED Correct typo on Changelog --- ChangeLog | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..df8918b6814 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,13 +4,13 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.6.3 compared to 3.6.2 ***** - Fix: ref_ext was not saved when recording a customer order from web service -- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid. +- Fix: amarok is a bugged theme making dolidroid failed. We switch to eldy automatically with dolidroid. - Fix: [ bug #1788 ] Duplicated doActions hook in product/fournisseurs.php -- Fix: withdrawal create error if in the same month are deleted previus withdrawals. +- Fix: withdrawal create error if in the same month are deleted previous withdrawals. - Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules - Fix: [ bug #1802 ] SQL error when updating a task with PostgreSQL database - Fix: [ bug #1785 ] Start date is lost in Project > Linked objects -- Fix: [ bug #1804 ] SQL error when sending email without addresee +- Fix: [ bug #1804 ] SQL error when sending email without address - Fix: [ bug #1803 ] AJAX company contact input is not aligned - Fix: [ bug #1787 ] Incorrect behaviour of doActions hook - Fix: [ bug #1796 ] Unable to use numeration modules from an external module @@ -18,18 +18,18 @@ English Dolibarr ChangeLog - Fix: [ bug #1717 ] Sorting unpaid invoices by amount received brings due amount - Fix: [ bug #1784 ] MOTD doesn't show up in Amarok theme - Fix: Tracking number not visible on shipment pdf -- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase +- Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL database - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: bug 1588 : relative discount. -- Fix: label of input method not tranlated. -- Fix: box of customer and propsects were not correctly disabled. +- Fix: label of input method not translated. +- Fix: box of customer and prospects were not correctly disabled. - Fix: [ bug #1618 ] PHP Error thrown when saving a barcode - Fix: Civility & birthdate wasn't save into adherent module. -- Fix: webservice Thirdparty parameter lastname for invidual creation is now lastname and not ref +- Fix: webservice Thirdparty parameter lastname for individual creation is now lastname and not ref - Fix: Chars - is no more allowed into value for code for extra fields. - Fix: [ bug #1622 ] Requesting holiday than spans across two years cause high CPU usage by Apache - Fix: [ bug #1595 ] Selected boolean extrafield in intervention creation page, does not save state @@ -56,14 +56,14 @@ For users: - Fix: Iban was used instead of Bic into SEPA file. - Fix: Must unaccent strings into SEPA file. - Fix: Extrafield feature select from table should try to translate multiple column when not needed -- Fix: cents for indian ruppes are calle paisa and paise. +- Fix: cents for indian ruppes are called paisa and paise. - Fix: Invoices payments may be older than invoices. - Fix: Withdrawal total amount is double - Fix: [ bug #1593 ] Spanish Localtax IRPF not being calculated since 3.6.0 in supplier invoices when adding a line - Fix: Web service categorie WDSL declaration is correct - Fix: ErrorBadValueForParamNotAString was displayed in virtual product if no base price defined - Fix: Category creation failed and no message output -- Fix: Lanf for Payment Type +- Fix: Lang for Payment Type - Fix: PHPCheckstyle 1.5.5 ***** ChangeLog for 3.6 compared to 3.5.* ***** @@ -85,12 +85,12 @@ For users: - New: Improved Opensurvey module: Added options to disable comments and disable public votes. Limit dates use calendar popup. - Description of survey use wysiwig editor. + Description of survey use wysiwyg editor. More information shown on result tab. Renamed "survey" into "poll" (better translation). - New: Add filter on text and status into survey list. Can also sort on id, text and date end. - New: The box "balance of bank accounts" show all opened accounts. -- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale represnative into public +- New: Add option MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE to add sale representative into public note of generated documents. - New: Add warning if supplier payment is higher that due amount. - New: Increase length of url into bookmark module. @@ -103,7 +103,7 @@ For users: - New: Add barcode fields into user database. - New: Add manager name (ceo, director, president...) into main company information page. - New: Add field url as product properties. -- New: More options to create a credit note (can be filled autatically according to remain to pay). +- New: More options to create a credit note (can be filled automatically according to remain to pay). - New: Can define custom fields for categories. - New: Prepare generation of SEPA files into module withdrawal. - New: [ task #1164 ] Add "Ref. supplier" search box in supplier orders @@ -120,7 +120,7 @@ For users: - New: [ task #926 ] Add extrafield feature on order lines. - New: [ task #927 ] Add extrafield feature on Proposal lines. - New: [ task #928 ] Add extrafield feature on invoice lines. -- New: Paypal/paybox email sent after backcall of a payment is now a formated and translated +- New: Paypal/paybox email sent after backcall of a payment is now a formatted and translated HTML content. For member subscription renewal, there is also a link to member. - New: When a subscription is recorded with invoice and payment: - the document (PDF) of invoice is also generated. @@ -171,11 +171,11 @@ removed. You must now use the 6 parameters way. See file modMyModule.class.php f So check that return value is 0 to keep default standard behaviour after hook or 1 to disable default standard behaviour. - Properties "civilite_id" were renamed into "civility_id". -- Remove add_photo_web() that is ot used anymore by core code. +- Remove add_photo_web() that is not used anymore by core code. ***** ChangeLog for 3.5.7 compared to 3.5.6 ***** -Fix: Paypal link were broken dur to SSL v3 closed. +Fix: Paypal link were broken due to SSL v3 closed. Fix: [ bug #1769 ] Error when installing to a PostgreSQL DB that contains numbers Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 00H Fix: [ bug #1757 ] Sorting breaks product/service statistics @@ -194,7 +194,7 @@ Fix: Bad days and month reported by function. Fix: Bad margin calculation. ***** ChangeLog for 3.5.5 compared to 3.5.4 ***** -Fix: Holiday module was broken. Initializaion of amount of holidays failed. +Fix: Holiday module was broken. Initialization of amount of holidays failed. Fix: [ bug #1523 ] suite bug #1334 : filtre et ordre de tri conjoints ne s'appliquent pas. Fix: Fusion PDF button on unpaid invoice is no more displayed. Fix: Unpaid invoice launch fusion PDF action even if it is only search (with enter keyboard input instead of lens click). @@ -229,7 +229,7 @@ Fix: When using option MAIN_MAIL_ALLOW_SENDMAIL_F, a mail was sent to sender. Fix: Question about warehouse must not be done when module stock is disabled. Fix: Option STOCK_SUPPORTS_SERVICES was not correctly implemented (missing test at some places). -Fix: Renaming a project with uplaoded files failed. +Fix: Renaming a project with uploaded files failed. Fix: [ bug #1476 ] Invoice creation form loses invoice date when there is a validation error. Fix: [ bug #1431 ] Reception and Send supplier order box has a weird top margin. Fix: [ bug #1428 ] "Nothing" is shown in the middle of the screen in a supplier order. @@ -250,7 +250,7 @@ Fix: [ bug #1449 ] Trigger ORDER_CREATE, LINEORDER_DELETE, LINEORDER_UPDATE and Fix: [ bug #1450 ] Several Customer order's triggers do not report the error from the trigger handler. Fix: [ bug #1451 ] Interrupted order clone through trigger, loads nonexistent order. Fix: [ bug #1454 ] Mention de bas de page erroné -Fix: Do not display dictionnay for non activated module +Fix: Do not display dictionary for non activated module Fix: Link element from element project pages Fix: [ bug #1509 ] Expedition admin free text & watermark submit error Fix: [ bug #1349 ] AJAX contact selector does not work fine in Project card From 6531a5c6c7d54ebce2406b697af95dec17391f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Tue, 10 Feb 2015 09:44:27 +0100 Subject: [PATCH 08/27] Fix: [ bug #1830 ] Salaries payment only allows checking accounts --- ChangeLog | 1 + htdocs/compta/salaries/fiche.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..483fd023b1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1830 ] Salaries payment only allows checking accounts ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/salaries/fiche.php b/htdocs/compta/salaries/fiche.php index c46f83dd6fb..34a2b9b4435 100644 --- a/htdocs/compta/salaries/fiche.php +++ b/htdocs/compta/salaries/fiche.php @@ -248,7 +248,7 @@ if ($action == 'create') if (! empty($conf->banque->enabled)) { print ''.$langs->trans("Account").''; - $form->select_comptes($_POST["accountid"],"accountid",0,"courant=1",1); // Affiche liste des comptes courant + $form->select_comptes($_POST["accountid"],"accountid",0,'',1); print ''; } From 863c1f7a13cd73b4d1ee56a62ddf3bfc1338ff13 Mon Sep 17 00:00:00 2001 From: Arnaud Aujon Chevallier Date: Tue, 10 Feb 2015 13:21:36 +0100 Subject: [PATCH 09/27] fix typo in createOrder --- htdocs/webservices/server_order.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/webservices/server_order.php b/htdocs/webservices/server_order.php index 8cd69b352a7..0c0d7559aec 100644 --- a/htdocs/webservices/server_order.php +++ b/htdocs/webservices/server_order.php @@ -640,7 +640,7 @@ function createOrder($authentication,$order) $newobject->statut=0; // We start with status draft $newobject->facturee=$order['facturee']; $newobject->fk_project=$order['project_id']; - $newObject->fk_delivery_address=$order['fk_delivery_address']; + $newobject->fk_delivery_address=$order['fk_delivery_address']; $newobject->cond_reglement_id=$order['cond_reglement_id']; $newobject->demand_reason_id=$order['demand_reason_id']; $newobject->date_creation=$now; From 2c074a94f39d0f1e3c17499b530134d04a88903b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 15 Feb 2015 15:57:38 +0100 Subject: [PATCH 10/27] Fix: [ bug #1790 ] Sending a test mail from admin page, gives "File already exists" error --- ChangeLog | 1 + htdocs/core/class/html.formmail.class.php | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..0b21f163136 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1790 ] Sending a test mail from admin page, gives "File already exists" error ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 9d80ced54e3..45e0aec2f65 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -2,6 +2,7 @@ /* Copyright (C) 2005-2012 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2015 Marcos García * * 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 @@ -500,6 +501,10 @@ class FormMail $out.= "\n"; } + if ($this->withform == 1 || $this->withform == -1) { + $out .= ''; + } + // Attached files if (! empty($this->withfile)) { From 5db4bb68a43d25dbbe92223d41d3e56fb770da54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Sun, 15 Feb 2015 16:00:07 +0100 Subject: [PATCH 11/27] Updated bug name --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b21f163136..cf3e84bed2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,7 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes -- Fix: [ bug #1790 ] Sending a test mail from admin page, gives "File already exists" error +- Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. From 0a81fe667f42219a66201a2e4440a8b8c8336987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 16 Feb 2015 10:44:10 +0100 Subject: [PATCH 12/27] Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work --- ChangeLog | 1 + htdocs/core/lib/agenda.lib.php | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5870e55152d..afeeb932e9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1812 ] SQL Error message while sending emailing with PostgreSQL datatabase - Fix: [ bug #1819 ] SQL error when searching for an invoice payment - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes +- Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index e730a1ed45b..c9773372e93 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -144,12 +144,19 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh foreach ($showextcals as $val) { $htmlname = dol_string_nospecial($val['name']); + print ''; print '' . "\n"; From 6f08893016977a6a4b767bde1bb4259df72af562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 16 Feb 2015 12:26:20 +0100 Subject: [PATCH 13/27] Fix: [ bug #1846 ] Browser IE11 not detected --- ChangeLog | 1 + htdocs/core/lib/functions.lib.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 29fadcba4fc..31e0bad5a16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,7 @@ Fix: [ bug #1752 ] Date filter of margins module, filters since 12H instead of 0 Fix: [ bug #1757 ] Sorting breaks product/service statistics Fix: [ bug #1797 ] Tulip supplier invoice module takes creation date instead of invoice date Fix: [ bug #1792 ] Users are not allowed to see margins module index page when no product view permission is enabled +Fix: [ bug #1846 ] Browser IE11 not detected ***** ChangeLog for 3.5.6 compared to 3.5.5 ***** Fix: Avoid missing class error for fetch_thirdparty method #1973 diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b5bac3b0ab0..85e4b68f519 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10,6 +10,7 @@ * Copyright (C) 2010-2011 Juanjo Menent * Copyright (C) 2013 Cédric Salvador * Copyright (C) 2013 Alexandre Spangaro + * Copyright (C) 2014-2015 Marcos García * * 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 @@ -146,7 +147,7 @@ function getBrowserInfo() elseif (preg_match('/epiphany/i',$_SERVER["HTTP_USER_AGENT"])) { $name='epiphany'; $version=$reg[2]; } elseif ((empty($phone) || preg_match('/iphone/i',$_SERVER["HTTP_USER_AGENT"])) && preg_match('/safari(\/|\s)([\d\.]*)/i',$_SERVER["HTTP_USER_AGENT"], $reg)) { $name='safari'; $version=$reg[2]; } // Safari is often present in string for mobile but its not. elseif (preg_match('/opera(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='opera'; $version=$reg[2]; } - elseif (preg_match('/msie(\/|\s)([\d\.]*)/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version=$reg[2]; } // MS products at end + elseif (preg_match('/(MSIE\s([0-9]+\.[0-9]))|.*(Trident\/[0-9]+.[0-9];\srv:([0-9]+\.[0-9]+))/i', $_SERVER["HTTP_USER_AGENT"], $reg)) { $name='ie'; $version= end($reg); } // MS products at end // Other $firefox=0; if (in_array($name,array('firefox','iceweasel'))) $firefox=1; From 3efb737cbf685501752a6c69131b8d79cf07bbde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 16 Feb 2015 12:30:10 +0100 Subject: [PATCH 14/27] Fix: [ bug #1845 ] Undefined "$conf->browser->ie" var in "functions.lib.php" --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 85e4b68f519..687c8d3d855 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2516,7 +2516,7 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath $return=''; if ($picto == 'setup') $picto='title.png'; - if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif'; + if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif'; $return.= "\n"; $return.= ''; @@ -2554,7 +2554,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so global $conf,$langs; if ($picto == 'setup') $picto='title.png'; - if (!empty($conf->browser->ie) && $picto=='title.png') $picto='title.gif'; + if (($conf->browser->name == 'ie') && $picto=='title.png') $picto='title.gif'; if (($num > $conf->liste_limit) || ($num == -1)) { From ca64763440fe211117bc546eb27cf50ffdd41f13 Mon Sep 17 00:00:00 2001 From: braito4 Date: Tue, 17 Feb 2015 18:09:16 +0100 Subject: [PATCH 15/27] Update note.php Error in the security check --- htdocs/contact/note.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/note.php b/htdocs/contact/note.php index 73b0f513db9..173a1018547 100644 --- a/htdocs/contact/note.php +++ b/htdocs/contact/note.php @@ -36,7 +36,7 @@ $langs->load("companies"); // Security check $id = GETPOST('id','int'); if ($user->societe_id) $id=$user->societe_id; -$result = restrictedArea($user, 'societe', $id, '&societe'); +$result = restrictedArea($user, 'contact', $id, 'socpeople&societe'); $object = new Contact($db); if ($id > 0) $object->fetch($id); From fc415fc3c918b83c8cdb256506ace18a1dd6cc12 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 Feb 2015 22:44:42 +0100 Subject: [PATCH 16/27] Fix: [ bug #1826 ] Supplier payment types are not translated in fourn/facture/paiement.php --- ChangeLog | 1 + htdocs/fourn/facture/paiement.php | 9 ++++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16073f9658c..51dd2ff268a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,6 +23,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1827 ] Tax reports gives incorrect amounts when using external modules that create lines with special codes - Fix: [ bug #1822 ] SQL error in clientfourn.php report with PostgreSQL - Fix: [ bug #1832 ] SQL error when adding a product with no price defined to an object +- Fix: [ bug #1826 ] Supplier payment types are not translated in fourn/facture/paiement.php ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index b6a4c5a7925..a8576cff01d 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -5,6 +5,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2015 Marcos García * * 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 @@ -447,7 +448,7 @@ if (empty($action)) $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,'; $sql.= ' s.rowid as socid, s.nom,'; - $sql.= ' c.libelle as paiement_type,'; + $sql.= ' c.code as paiement_type, c.libelle as paiement_libelle,'; $sql.= ' ba.rowid as bid, ba.label,'; if (!$user->rights->societe->client->voir) $sql .= ' sc.fk_soc, sc.fk_user,'; $sql.= ' SUM(f.amount)'; @@ -486,7 +487,7 @@ if (empty($action)) { $sql .= " AND s.nom LIKE '%".$db->escape($search_company)."%'"; } - $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.libelle, ba.rowid, ba.label"; + $sql.= " GROUP BY p.rowid, p.datep, p.amount, p.num_paiement, s.rowid, s.nom, c.code, c.libelle, ba.rowid, ba.label"; if (!$user->rights->societe->client->voir) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit+1, $offset); @@ -558,7 +559,9 @@ if (empty($action)) else print ' '; print ''; - print '\n"; + $payment_type = $langs->trans("PaymentType".$objp->paiement_type)!=("PaymentType".$objp->paiement_type)?$langs->trans("PaymentType".$objp->paiement_type):$objp->paiement_libelle; + + print '\n"; print ''; + print ''; foreach ($showextcals as $val) { $htmlname = dol_string_nospecial($val['name']); print ''; } From d46c76311c9c869219351c1dc941ac40a3ce78d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Feb 2015 10:23:17 +0100 Subject: [PATCH 20/27] Correction --- htdocs/core/class/html.formmail.class.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 45e0aec2f65..7ffd535f0ec 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -255,6 +255,7 @@ class FormMail if ($this->withform == 1) { $out.= '
'."\n"; + $out.= ''; $out.= ''; } foreach ($this->param as $key=>$value) @@ -501,10 +502,6 @@ class FormMail $out.= "\n"; } - if ($this->withform == 1 || $this->withform == -1) { - $out .= ''; - } - // Attached files if (! empty($this->withfile)) { From bd6b465ee10aa20bc45072f67ddfdc07aff06ea4 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 20 Feb 2015 20:16:15 +0100 Subject: [PATCH 21/27] Add phpunit for ie11 and ie10 --- test/phpunit/FunctionsLibTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/phpunit/FunctionsLibTest.php b/test/phpunit/FunctionsLibTest.php index 78c2278ba69..73af66e3cbc 100755 --- a/test/phpunit/FunctionsLibTest.php +++ b/test/phpunit/FunctionsLibTest.php @@ -128,22 +128,37 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase $tmp=getBrowserInfo(); $this->assertEquals('ie',$tmp['browsername']); $this->assertEquals('5.0',$tmp['browserversion']); + $_SERVER['HTTP_USER_AGENT']='Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5a) Gecko/20030728 Mozilla Firefox/0.9.1'; // Firefox 0.9.1 $tmp=getBrowserInfo(); $this->assertEquals('firefox',$tmp['browsername']); $this->assertEquals('0.9.1',$tmp['browserversion']); + + $_SERVER['HTTP_USER_AGENT']='Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)'; // IE 10 + $tmp=getBrowserInfo(); + $this->assertEquals('ie',$tmp['browsername']); + $this->assertEquals('10.0',$tmp['browserversion']); + + $_SERVER['HTTP_USER_AGENT']='Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko'; // IE 11 + $tmp=getBrowserInfo(); + $this->assertEquals('ie',$tmp['browsername']); + $this->assertEquals('11.0',$tmp['browserversion']); + $_SERVER['HTTP_USER_AGENT']='Mozilla/3.0 (Windows 98; U) Opera 6.03 [en]'; $tmp=getBrowserInfo(); $this->assertEquals('opera',$tmp['browsername']); $this->assertEquals('6.03',$tmp['browserversion']); + $_SERVER['HTTP_USER_AGENT']='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.21 (KHTML, like Gecko) Chrome/19.0.1042.0 Safari/535.21'; $tmp=getBrowserInfo(); $this->assertEquals('chrome',$tmp['browsername']); $this->assertEquals('19.0.1042.0',$tmp['browserversion']); + $_SERVER['HTTP_USER_AGENT']='chrome (Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.56 Safari/535.11)'; $tmp=getBrowserInfo(); $this->assertEquals('chrome',$tmp['browsername']); $this->assertEquals('17.0.963.56',$tmp['browserversion']); + $_SERVER['HTTP_USER_AGENT']='Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_8; de-at) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1'; $tmp=getBrowserInfo(); $this->assertEquals('safari',$tmp['browsername']); From bfe9bf7a478c4eefe66af7c10d1e5c63c79183c3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Feb 2015 17:55:15 +0100 Subject: [PATCH 22/27] Fix: Bad SEPA xml file creation --- ChangeLog | 1 + .../class/bonprelevement.class.php | 41 +++++++++++++------ 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index c50c42acb21..927ed0e7a24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ English Dolibarr ChangeLog - Fix: [ bug #1830 ] Salaries payment only allows checking accounts - Fix: [ bug #1825 ] External agenda: hide/show checkbox doesn't work - Fix: [ bug #1790 ] Email form behaves in an unexpected way when pressing Enter key +- Fix: Bad SEPA xml file creation ***** ChangeLog for 3.6.2 compared to 3.6.1 ***** - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 7f0b693391e..0a9884bbcd3 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1326,12 +1326,26 @@ class BonPrelevement extends CommonObject $dateTime_ECMA = dol_print_date($date_actu, '%Y-%m-%dT%H:%M:%S'); $fileDebiteurSection = ''; $fileEmetteurSection = ''; - $i = 0; + $i = $j = 0; $this->total = 0; /* * section Debiteur (sepa Debiteurs bloc lines) */ + + $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_pays as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; + $resql=$this->db->query($sql); + if ($resql) + { + $num = $this->db->num_rows($resql); + while ($j < $num) + { + $objfac = $this->db->fetch_object($resql); + $ListOfFactures = $ListOfFactures . $objfac->fac . ","; + $j++; + } + } + $sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, p.code as country_code,"; $sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,"; $sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum"; @@ -1357,7 +1371,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures , $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $this->total = $this->total + $obj->somme; $i++; } @@ -1394,13 +1408,14 @@ class BonPrelevement extends CommonObject fputs($this->file, ' '.$this->total.''.$CrLf); fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$this->raison_sociale.''.$CrLf); -/* fputs($this->file, ' '.$CrLf); - fputs($this->file, ' '.$CrLf); - fputs($this->file, ' 0533883248'.$CrLf); - fputs($this->file, ' KBO-BCE'.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$conf->global->PRELEVEMENT_ICS.''.$CrLf); + fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); -*/ fputs($this->file, ' '.$CrLf); + fputs($this->file, ' '.$CrLf); fputs($this->file, ' '.$CrLf); // SEPA File Emetteur if ($result != -2) @@ -1583,6 +1598,7 @@ class BonPrelevement extends CommonObject $CrLf = "\n"; $Rowing = sprintf("%06d", $row_idfac); $Date_Rum = strtotime($row_datec); + $DtOfSgntr = dol_print_date($row_datec, '%Y-%m-%d'); $pre = ($date_Rum > 1359673200) ? 'Rum' : '++R'; $Rum = $pre.$row_code_client.$row_drum.'-0'.date('U', $Date_Rum); $XML_DEBITOR =''; @@ -1590,11 +1606,11 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.('AS-'.$row_facnumber.'-'.$Rowing).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; + $XML_DEBITOR .=' '.round($row_somme, 2).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$Rum.''.$CrLf; - $XML_DEBITOR .=' '.$row_datec.''.$CrLf; + $XML_DEBITOR .=' '.$DtOfSgntr.''.$CrLf; $XML_DEBITOR .=' false'.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; @@ -1607,17 +1623,18 @@ class BonPrelevement extends CommonObject $XML_DEBITOR .=' '.strtoupper(dol_string_unaccent($row_nom)).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$row_country_code.''.$CrLf; - $XML_DEBITOR .=' '.strtr($row_adr, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; + $XML_DEBITOR .=' '.strtr($row_address, array(CHR(13) => ", ", CHR(10) => "")).''.$CrLf; $XML_DEBITOR .=' '.dol_string_unaccent($row_zip.' '.$row_town).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.$row_iban.''.$CrLf; + $XML_DEBITOR .=' '.preg_replace('/\s/', '', $row_iban).''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; - $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; + // $XML_DEBITOR .=' '.($row_facnumber.'/'.$Rowing.'/'.$Rum).''.$CrLf; + $XML_DEBITOR .=' '.$row_facnumber.''.$CrLf; $XML_DEBITOR .=' '.$CrLf; $XML_DEBITOR .=' '.$CrLf; return $XML_DEBITOR; From 7ca8fdb20cd833d11ed1b693cadd36ffe521bca3 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Fri, 27 Feb 2015 17:58:19 +0100 Subject: [PATCH 23/27] PHP norms --- htdocs/compta/prelevement/class/bonprelevement.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index 0a9884bbcd3..b90b0dc6c25 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -1326,7 +1326,8 @@ class BonPrelevement extends CommonObject $dateTime_ECMA = dol_print_date($date_actu, '%Y-%m-%dT%H:%M:%S'); $fileDebiteurSection = ''; $fileEmetteurSection = ''; - $i = $j = 0; + $i = 0; + $j = 0; $this->total = 0; /* From a421564b8453b5b5fa6e80b247943bf179aa53b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 Mar 2015 13:52:58 +0100 Subject: [PATCH 24/27] Fix phpcs --- .../prelevement/class/bonprelevement.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php index b90b0dc6c25..25236ee3ebb 100644 --- a/htdocs/compta/prelevement/class/bonprelevement.class.php +++ b/htdocs/compta/prelevement/class/bonprelevement.class.php @@ -891,13 +891,13 @@ class BonPrelevement extends CommonObject if (!$error) { $ref = substr($year,-2).$month; - + $sql = "SELECT substring(ref from char_length(ref) - 1)"; $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons"; $sql.= " WHERE ref LIKE '%".$ref."%'"; $sql.= " AND entity = ".$conf->entity; $sql.= " ORDER BY ref DESC LIMIT 1"; - + dol_syslog(get_class($this)."::Create sql=".$sql, LOG_DEBUG); $resql = $this->db->query($sql); @@ -914,7 +914,7 @@ class BonPrelevement extends CommonObject $ref = "T".$ref.str_pad(dol_substr("00".intval($row[0])+1),2,"0",STR_PAD_LEFT); $filebonprev = $ref; - + // Create withdraw receipt in database $sql = "INSERT INTO ".MAIN_DB_PREFIX."prelevement_bons ("; $sql.= " ref, entity, datec"; @@ -1326,7 +1326,7 @@ class BonPrelevement extends CommonObject $dateTime_ECMA = dol_print_date($date_actu, '%Y-%m-%dT%H:%M:%S'); $fileDebiteurSection = ''; $fileEmetteurSection = ''; - $i = 0; + $i = 0; $j = 0; $this->total = 0; @@ -1337,7 +1337,7 @@ class BonPrelevement extends CommonObject $sql = "SELECT f.facnumber as fac FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."prelevement_facture as pf, ".MAIN_DB_PREFIX."societe as soc, ".MAIN_DB_PREFIX."c_pays as p, ".MAIN_DB_PREFIX."societe_rib as rib WHERE pl.fk_prelevement_bons = ".$this->id." AND pl.rowid = pf.fk_prelevement_lignes AND pf.fk_facture = f.rowid AND soc.fk_pays = p.rowid AND soc.rowid = f.fk_soc AND rib.fk_soc = f.fk_soc AND rib.default_rib = 1"; $resql=$this->db->query($sql); if ($resql) - { + { $num = $this->db->num_rows($resql); while ($j < $num) { @@ -1372,7 +1372,7 @@ class BonPrelevement extends CommonObject while ($i < $num) { $obj = $this->db->fetch_object($resql); - $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures , $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); + $fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $ListOfFactures, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum); $this->total = $this->total + $obj->somme; $i++; } From 787623882312d836daa11a499bc9b8efbaf44151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Mon, 2 Mar 2015 01:36:27 +0100 Subject: [PATCH 25/27] Fixed bug with hide/show checkboxes reported by Ruben Almeida (aruben) When an external calendar was called "mytasks", Dolibarr events were also hidden too. --- htdocs/comm/action/index.php | 2 +- htdocs/core/lib/agenda.lib.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index 38e8ab24bb1..82e6818a250 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -1038,7 +1038,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $numicals[dol_string_nospecial($event->icalname)]++; } $color=$event->icalcolor; - $cssclass=(! empty($event->icalname)?'family_'.dol_string_nospecial($event->icalname):'family_other'); + $cssclass=(! empty($event->icalname)?'family_ext'.dol_string_nospecial($event->icalname):'family_other'); } else if ($event->type_code == 'BIRTHDAY') { $numbirthday++; $colorindex=2; $cssclass='family_birthday'; } else { $numother++; $cssclass='family_other'; } diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 5bd0bc5ee95..219b69015a0 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -130,7 +130,6 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh print '
'; foreach ($showextcals as $val) { - $htmlname = dol_string_nospecial($val['name']); + $htmlname = md5($val['name']); print '
'.dol_trunc($objp->paiement_type.' '.$objp->num_paiement,32)."'.$payment_type.' '.dol_trunc($objp->num_paiement,32)."'; if ($objp->bid) print ''.img_object($langs->trans("ShowAccount"),'account').' '.dol_trunc($objp->label,24).''; From d1a4b6c2c5a7cfab1b21731de2ef790130d55d17 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Feb 2015 00:04:35 +0100 Subject: [PATCH 17/27] phpcs --- htdocs/core/lib/functions.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 121fbc769b7..3bded45bc9f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1054,11 +1054,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1) $default_timezone=@date_default_timezone_get(); } } - + if (empty($localtz)) { $localtz = new DateTimeZone('UTC'); } - + $dt = new DateTime(null,$localtz); $dt->setDate($year,$month,$day); $dt->setTime((int) $hour, (int) $minute, (int) $second); @@ -2952,7 +2952,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") $sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; - $sql .= " AND t.taux = ".(float)$tva." AND t.active = 1"; + $sql .= " AND t.taux = ".((float) $tva)." AND t.active = 1"; dol_syslog("get_localtax sql=".$sql); $resql=$db->query($sql); @@ -2988,7 +2988,7 @@ function getLocalTaxesFromRate($vatrate, $local, $thirdparty) $sql = "SELECT t.localtax1, t.localtax1_type, t.localtax2, t.localtax2_type, t.accountancy_code_sell, t.accountancy_code_buy"; $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty->country_code."'"; - $sql .= " AND t.taux = ".(float)$vatrate." AND t.active = 1"; + $sql .= " AND t.taux = ".((float) $vatrate)." AND t.active = 1"; $resql=$db->query($sql); if ($resql) From ec56667f5ea8969536ffc83bcfd1ec9fd387c0e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 19 Feb 2015 09:44:22 +0100 Subject: [PATCH 18/27] Fix: [ bug #1849 ] Broken flag image when a contact does not have a country set --- htdocs/core/lib/functions.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 3bded45bc9f..0c24e5fba72 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4305,6 +4305,8 @@ function picto_from_langcode($codelang) { global $langs; + if (empty($codelang)) return ''; + if ($codelang == 'auto') { return img_picto_common($langs->trans('AutoDetectLang'), 'flags/int.png'); From fd18aa8717920b4e657fe6f2da630c7309586139 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a=20de=20La=20Fuente?= Date: Fri, 20 Feb 2015 10:17:02 +0100 Subject: [PATCH 19/27] Better fix for Bug #1825 --- htdocs/core/lib/agenda.lib.php | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index c9773372e93..5bd0bc5ee95 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -140,26 +140,28 @@ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $sh { if (count($showextcals) > 0) { - print '
' . $langs->trans("LocalAgenda") . '
'; + //jQuery Learning "How do I select an element by an ID that has characters used in CSS notation?" + //http://learn.jquery.com/using-jquery-core/faq/how-do-i-select-an-element-by-an-id-that-has-characters-used-in-css-notation/ + print ''; + print ' ' . $langs->trans("LocalAgenda") . '
'; - print '' . "\n"; print ' ' . $val ['name']; print '
'; print ''; print ' ' . $langs->trans("LocalAgenda") . '
'; print ' ' . $val ['name'];