From 7413e33599fd3e76990269409636ce3403206af9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 29 May 2013 22:41:57 +0200 Subject: [PATCH 01/22] Fix: Bad page code --- htdocs/societe/checkvat/checkVatPopup.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/societe/checkvat/checkVatPopup.php b/htdocs/societe/checkvat/checkVatPopup.php index 245601d8737..61c01b00f2a 100644 --- a/htdocs/societe/checkvat/checkVatPopup.php +++ b/htdocs/societe/checkvat/checkVatPopup.php @@ -66,6 +66,9 @@ else //ini_set('default_socket_timeout', $params['response_timeout']); //$soapclient = new SoapClient($WS_DOL_URL_WSDL,$params); $soapclient = new nusoap_client($WS_DOL_URL_WSDL,true,$params['proxy_host'],$params['proxy_port'],$params['proxy_login'],$params['proxy_password'],$params['connection_timeout'],$params['response_timeout']); + $soapclient->soap_defencoding = 'utf-8'; + $soapclient->xml_encoding = 'utf-8'; + $soapclient->decode_utf8 = false; // Check for an error $err = $soapclient->getError(); From f6057bd7943e46722513795f63f33448b4ab836a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Thu, 30 May 2013 16:48:04 +0200 Subject: [PATCH 02/22] Reverting PR #1002 Incorrect translation that shouldn't have been accepted --- htdocs/langs/es_MX/banks.lang | 2 -- htdocs/langs/es_MX/bills.lang | 2 -- 2 files changed, 4 deletions(-) diff --git a/htdocs/langs/es_MX/banks.lang b/htdocs/langs/es_MX/banks.lang index 4e7fd2d1080..58ef3a65d00 100644 --- a/htdocs/langs/es_MX/banks.lang +++ b/htdocs/langs/es_MX/banks.lang @@ -1,5 +1,3 @@ # Dolibarr language file - es_MX - banks CHARSET=UTF-8 -IBAN=CLAVE Interbancaria -BIC=Sucursal BankAccountDomiciliation=Tarjeta \ No newline at end of file diff --git a/htdocs/langs/es_MX/bills.lang b/htdocs/langs/es_MX/bills.lang index 26c1a6583d1..e5ae5cc1336 100644 --- a/htdocs/langs/es_MX/bills.lang +++ b/htdocs/langs/es_MX/bills.lang @@ -23,6 +23,4 @@ TerreNumRefModelDesc1=Devuelve el número bajo el formato %syymm-nnnn para las f AddCreditNote=Crear nota de crédito BillTo=Receptor Residence=Tarjeta -IBANNumber=CLAVE Interbancaria -BICNumber=Sucursal PaymentByTransferOnThisBankAccount=Cuenta para depositos y transferencias \ No newline at end of file From 5fa2598a6ff73193532300793f51549d6d4c3f6c Mon Sep 17 00:00:00 2001 From: simnandez Date: Thu, 30 May 2013 17:58:48 +0200 Subject: [PATCH 03/22] Fix: [ bug #916 ] Same for Thirds and Members --- htdocs/core/modules/modAdherent.class.php | 3 ++- htdocs/core/modules/modSociete.class.php | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index adefcea2d42..baf52d30d1a 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2013 Juanjo Menent * * 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 @@ -209,7 +210,7 @@ class modAdherent extends DolibarrModules $this->import_tables_creator_array[$r]=array('a'=>'fk_user_author'); // Fields to store import user id $this->import_fields_array[$r]=array('a.civilite'=>"UserTitle",'a.lastname'=>"Lastname*",'a.firstname'=>"Firstname",'a.login'=>"Login*","a.pass"=>"Password","a.fk_adherent_type"=>"MemberType*",'a.morphy'=>'Nature*','a.societe'=>'Company','a.address'=>"Address",'a.zip'=>"Zip",'a.town'=>"Town",'a.country'=>"Country",'a.phone'=>"PhonePro",'a.phone_perso'=>"PhonePerso",'a.phone_mobile'=>"PhoneMobile",'a.email'=>"Email",'a.birth'=>"Birthday",'a.statut'=>"Status*",'a.photo'=>"Photo",'a.note'=>"Note",'a.datec'=>'DateCreation','a.datefin'=>'DateEndSubscription'); // Add extra fields - $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'"; + $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member' AND entity = ".$conf->entity; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { diff --git a/htdocs/core/modules/modSociete.class.php b/htdocs/core/modules/modSociete.class.php index 6bb15f60a38..93700ec55b2 100644 --- a/htdocs/core/modules/modSociete.class.php +++ b/htdocs/core/modules/modSociete.class.php @@ -4,7 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2013 Regis Houssin - * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012-2013 Juanjo Menent * * 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 @@ -254,7 +254,7 @@ class modSociete extends DolibarrModules $this->export_TypeFields_array[$r]=array('s.nom'=>"Text",'s.status'=>"Number",'s.client'=>"Boolean",'s.fournisseur'=>"Boolean",'s.datec'=>"Date",'s.tms'=>"Date",'s.code_client'=>"Text",'s.code_fournisseur'=>"Text",'s.code_compta'=>"Text",'s.code_compta_fournisseur'=>"Text",'s.address'=>"Text",'s.zip'=>"Text",'s.town'=>"Text",'p.libelle'=>"List:c_pays:libelle:rowid",'p.code'=>"Text",'s.phone'=>"Text",'s.fax'=>"Text",'s.url'=>"Text",'s.email'=>"Text",'s.default_lang'=>"Text",'s.siret'=>"Text",'s.siren'=>"Text",'s.ape'=>"Text",'s.idprof4'=>"Text",'s.idprof5'=>"Text",'s.idprof6'=>"Text",'s.tva_intra'=>"Text",'s.capital'=>"Number",'s.note_private'=>"Text",'s.note_public'=>"Text",'t.libelle'=>"Text",'ce.code'=>"List:c_effectif:libelle:code","cfj.libelle"=>"Text",'s.fk_prospectlevel'=>'List:c_prospectlevel:label:code','s.fk_stcomm'=>'List:c_stcomm:libelle:code','d.nom'=>'Text'); $this->export_entities_array[$r]=array(); // We define here only fields that use another picto // Add extra fields - $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'"; + $sql="SELECT name, label, type FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'"; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { @@ -345,7 +345,7 @@ class modSociete extends DolibarrModules $this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'societe','extra'=>MAIN_DB_PREFIX.'societe_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r]=array('s.nom'=>"Name*",'s.status'=>"Status",'s.client'=>"Customer*",'s.fournisseur'=>"Supplier*",'s.code_client'=>"CustomerCode",'s.code_fournisseur'=>"SupplierCode",'s.code_compta'=>"CustomerAccountancyCode",'s.code_compta_fournisseur'=>"SupplierAccountancyCode",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.phone'=>"Phone",'s.fax'=>"Fax",'s.url'=>"Url",'s.email'=>"Email",'s.siret'=>"ProfId1",'s.siren'=>"ProfId2",'s.ape'=>"ProfId3",'s.idprof4'=>"ProfId4",'s.tva_intra'=>"VATIntraShort",'s.capital'=>"Capital",'s.note_private'=>"NotePrivate",'s.note_public'=>"NotePublic",'s.fk_typent'=>"ThirdPartyType",'s.fk_effectif'=>"Staff","s.fk_forme_juridique"=>"JuridicalStatus",'s.fk_prospectlevel'=>'ProspectLevel','s.fk_stcomm'=>'ProspectStatus','s.default_lang'=>'DefaultLanguage','s.barcode'=>'BarCode','s.datec'=>"DateCreation"); // Add extra fields - $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company'"; + $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'company' AND entity = ".$conf->entity; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { @@ -380,7 +380,7 @@ class modSociete extends DolibarrModules $this->import_tables_array[$r]=array('s'=>MAIN_DB_PREFIX.'socpeople','extra'=>MAIN_DB_PREFIX.'socpeople_extrafields'); // List of tables to insert into (insert done in same order) $this->import_fields_array[$r]=array('s.fk_soc'=>'ThirdPartyName*','s.civilite'=>'UserTitle','s.lastname'=>"Name*",'s.firstname'=>"Firstname",'s.address'=>"Address",'s.zip'=>"Zip",'s.town'=>"Town",'s.fk_pays'=>"CountryCode",'s.birthday'=>"BirthdayDate",'s.poste'=>"Role",'s.phone'=>"Phone",'s.phone_perso'=>"PhonePerso",'s.phone_mobile'=>"PhoneMobile",'s.fax'=>"Fax",'s.email'=>"Email",'s.note_private'=>"Note",'s.note_public'=>"Note",'s.datec'=>"DateCreation"); // Add extra fields - $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact'"; + $sql="SELECT name, label, fieldrequired FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'contact' AND entity = ".$conf->entity; $resql=$this->db->query($sql); if ($resql) // This can fail when class is used on old database (during migration for example) { From 361e291d2d01400b5c34acc2bb2fc24669b0f3c8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 May 2013 19:36:00 +0200 Subject: [PATCH 04/22] Fix: Lang not loaded --- htdocs/adherents/stats/byproperties.php | 1 + htdocs/adherents/stats/geo.php | 1 + htdocs/adherents/stats/index.php | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/adherents/stats/byproperties.php b/htdocs/adherents/stats/byproperties.php index fb014977352..675ad501a5e 100755 --- a/htdocs/adherents/stats/byproperties.php +++ b/htdocs/adherents/stats/byproperties.php @@ -44,6 +44,7 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; +$langs->load("members"); /* diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index dbb964cfd47..c1a73569e57 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -44,6 +44,7 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; +$langs->load("members"); /* diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php index 40d7bd8d77c..fff9167a790 100644 --- a/htdocs/adherents/stats/index.php +++ b/htdocs/adherents/stats/index.php @@ -46,6 +46,8 @@ $year = strftime("%Y", time()); $startyear=$year-2; $endyear=$year; +$langs->load("members"); + /* * View @@ -53,8 +55,6 @@ $endyear=$year; $form=new Form($db); -$langs->load("propal"); - llxHeader(); print_fiche_titre($langs->trans("SubscriptionsStatistics"), $mesg); From 9c049e73af7f414156db4c23b91fde4c8e125018 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 30 May 2013 19:29:08 +0200 Subject: [PATCH 05/22] Fix: Support pages were not independants. --- htdocs/support/default.css | 1 - htdocs/support/inc.php | 13 +------------ htdocs/support/index.php | 2 +- 3 files changed, 2 insertions(+), 14 deletions(-) diff --git a/htdocs/support/default.css b/htdocs/support/default.css index e63759ba19b..07ca0f8ebd0 100644 --- a/htdocs/support/default.css +++ b/htdocs/support/default.css @@ -13,7 +13,6 @@ * * You should have received a copy of the GNU General Public License * along with this program. If not, see . - * */ body { diff --git a/htdocs/support/inc.php b/htdocs/support/inc.php index 42a4d65ce27..f7d3f2be1e9 100644 --- a/htdocs/support/inc.php +++ b/htdocs/support/inc.php @@ -24,24 +24,13 @@ * \brief File that define environment for support pages */ -// Just to define version DOL_VERSION -if (! defined('DOL_INC_FOR_VERSION_ERROR')) define('DOL_INC_FOR_VERSION_ERROR','1'); -require_once '../filefunc.inc.php'; - -// Define DOL_DOCUMENT_ROOT and ADODB_PATH used for install/upgrade process +// Define DOL_DOCUMENT_ROOT if (! defined('DOL_DOCUMENT_ROOT')) define('DOL_DOCUMENT_ROOT', '..'); -if (! defined('ADODB_PATH')) -{ - $foundpath=DOL_DOCUMENT_ROOT .'/includes/adodbtime/'; - if (! is_dir($foundpath)) $foundpath='/usr/share/php/adodb/'; - define('ADODB_PATH', $foundpath); -} require_once DOL_DOCUMENT_ROOT.'/core/class/translate.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; -require_once ADODB_PATH.'adodb-time.inc.php'; // Avoid warnings with strict mode E_STRICT $conf = new stdClass(); // instantiate $conf explicitely diff --git a/htdocs/support/index.php b/htdocs/support/index.php index b56393dcbac..6b555672631 100644 --- a/htdocs/support/index.php +++ b/htdocs/support/index.php @@ -41,7 +41,7 @@ $langs->load("help"); * View */ -pHeader($langs->trans("DolibarrHelpCenter").' '.DOL_VERSION, $_SERVER["PHP_SELF"]); +pHeader($langs->trans("DolibarrHelpCenter"), $_SERVER["PHP_SELF"]); print $langs->trans("HelpCenterDesc1")."
\n"; print $langs->trans("HelpCenterDesc2")."
\n"; From 5254f102ba5575c211ea2d1f3850058b8a687971 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 May 2013 10:56:48 +0200 Subject: [PATCH 06/22] Fix: Solve duplicate js and solve jmobile problem of cache. --- htdocs/core/get_menudiv.php | 2 -- htdocs/main.inc.php | 23 ++++++++++++++++------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/htdocs/core/get_menudiv.php b/htdocs/core/get_menudiv.php index f320b7cc8eb..59ab4c9ecf3 100644 --- a/htdocs/core/get_menudiv.php +++ b/htdocs/core/get_menudiv.php @@ -50,8 +50,6 @@ $title=$langs->trans("Menu"); // URL http://mydolibarr/core/get_menudiv.php?dol_use_jmobile=1 can be used for tests $arrayofjs=array(); $arrayofcss=array(); -$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); -$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); print ''."\n"; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index d27bb64e6d0..f3f85d53949 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -983,9 +983,7 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs // jQuery jMobile if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || ! empty($conf->dol_use_jmobile)) { - print ''."\n"; - //$arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); - print ''."\n"; + print ''."\n"; } } @@ -1149,11 +1147,22 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs } // jQuery jMobile if (! empty($conf->global->MAIN_USE_JQUERY_JMOBILE) || defined('REQUIRE_JQUERY_JMOBILE') || (! empty($conf->dol_use_jmobile) && $conf->dol_use_jmobile > 0)) - { + { + // We must force not using ajax because cache of jquery does not load js of other pages. + // This also increase seriously speed onto mobile device where complex js code is very slow and memory very low. + if (empty($conf->dol_use_jmobile) || $conf->dol_use_jmobile != 2) + { + print ''; + } print ''."\n"; - //$arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); - print ''."\n"; - print ''."\n"; } } From a5962a410e3ec1fafa73a5f2e95cb9f1c4d17ac5 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 May 2013 13:21:01 +0200 Subject: [PATCH 07/22] Fix: Bad param used --- htdocs/core/modules/DolibarrModules.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/modules/DolibarrModules.class.php b/htdocs/core/modules/DolibarrModules.class.php index 794ebda1428..ca709ba4e32 100644 --- a/htdocs/core/modules/DolibarrModules.class.php +++ b/htdocs/core/modules/DolibarrModules.class.php @@ -606,9 +606,11 @@ abstract class DolibarrModules foreach ($this->boxes as $key => $value) { //$titre = $this->boxes[$key][0]; - $file = $this->boxes[$key][1]; + $file = $this->boxes[$key]['file']; //$note = $this->boxes[$key][2]; + if (empty($file)) $file = isset($this->boxes[$key][1])?$this->boxes[$key][1]:''; // For backward compatibility + $sql = "DELETE FROM ".MAIN_DB_PREFIX."boxes"; $sql.= " USING ".MAIN_DB_PREFIX."boxes, ".MAIN_DB_PREFIX."boxes_def"; $sql.= " WHERE ".MAIN_DB_PREFIX."boxes.box_id = ".MAIN_DB_PREFIX."boxes_def.rowid"; From da73a8d84c4cd47cff1d67d603ce69773d2c64a6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 May 2013 13:30:24 +0200 Subject: [PATCH 08/22] Fix: syntax error Fix: Bad field param --- htdocs/core/modules/modAdherent.class.php | 4 +++- htdocs/core/modules/modExternalRss.class.php | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index baf52d30d1a..74fd21da47f 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -42,6 +42,8 @@ class modAdherent extends DolibarrModules */ function __construct($db) { + global $conf; + $this->db = $db; $this->numero = 310; @@ -177,7 +179,7 @@ class modAdherent extends DolibarrModules $this->export_TypeFields_array[$r]=array('a.civilite'=>"Text",'a.lastname'=>"Text",'a.firstname'=>"Text",'a.login'=>"Text",'a.morphy'=>'Text','a.societe'=>'Text','a.address'=>"Text",'a.zip'=>"Text",'a.town'=>"Text",'a.country'=>"Text",'a.phone'=>"Text",'a.phone_perso'=>"Text",'a.phone_mobile'=>"Text",'a.email'=>"Text",'a.birth'=>"Date",'a.statut'=>"Status",'a.note'=>"Text",'a.datec'=>'Date','a.datevalid'=>'Date','a.tms'=>'Date','a.datefin'=>'Date','ta.rowid'=>'List:fk_adherent_type:libelle','ta.libelle'=>'Text','c.dateadh'=>'Date','c.cotisation'=>'Number'); $this->export_entities_array[$r]=array('a.rowid'=>'member','a.civilite'=>"member",'a.lastname'=>"member",'a.firstname'=>"member",'a.login'=>"member",'a.morphy'=>'member','a.societe'=>'member','a.address'=>"member",'a.zip'=>"member",'a.town'=>"member",'a.country'=>"member",'a.phone'=>"member",'a.phone_perso'=>"member",'a.phone_mobile'=>"member",'a.email'=>"member",'a.birth'=>"member",'a.statut'=>"member",'a.photo'=>"member",'a.note'=>"member",'a.datec'=>'member','a.datevalid'=>'member','a.tms'=>'member','a.datefin'=>'member','ta.rowid'=>'member_type','ta.libelle'=>'member_type','c.rowid'=>'subscription','c.dateadh'=>'subscription','c.cotisation'=>'subscription'); // Add extra fields - $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member'"; + $sql="SELECT name, label FROM ".MAIN_DB_PREFIX."extrafields WHERE elementtype = 'member' AND entity = ".$conf->entity; $resql=$this->db->query($sql); while ($obj=$this->db->fetch_object($resql)) { diff --git a/htdocs/core/modules/modExternalRss.class.php b/htdocs/core/modules/modExternalRss.class.php index fc94dd8c405..5e7de7abea5 100644 --- a/htdocs/core/modules/modExternalRss.class.php +++ b/htdocs/core/modules/modExternalRss.class.php @@ -105,9 +105,9 @@ class modExternalRss extends DolibarrModules if (preg_match('/EXTERNAL_RSS_TITLE_([0-9]+)/i',$obj->name,$reg)) { // Definie la boite si on a trouvee une ancienne configuration - $this->boxes[$reg[1]][0] = "(ExternalRSSInformations)"; - $this->boxes[$reg[1]][1] = "box_external_rss.php"; - $this->boxes[$reg[1]][2] = $reg[1]." (".$obj->value.")"; + //$this->boxes[$reg[1]][0] = "(ExternalRSSInformations)"; + $this->boxes[$reg[1]]['file'] = "box_external_rss.php"; + $this->boxes[$reg[1]]['note'] = $reg[1]." (".$obj->value.")"; } } $this->db->free($result); @@ -131,7 +131,7 @@ class modExternalRss extends DolibarrModules $sql = array(); // Delete old declarations of RSS box - $this->boxes[0][1] = "box_external_rss.php"; + $this->boxes[0]['file'] = "box_external_rss.php"; return $this->_remove($sql,$options); } From 743da5a2140f26454725e72125c62aa2bf65e9fe Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 31 May 2013 21:33:48 +0200 Subject: [PATCH 09/22] Fix: function to get localtax1 or 2 value from vat rate return bad value when countries differs. Conflicts: htdocs/langs/fr_CA/main.lang --- htdocs/core/lib/functions.lib.php | 12 +++++++----- htdocs/core/lib/price.lib.php | 6 ++++-- htdocs/langs/fr_CA/admin.lang | 18 ++++++++++++++++++ htdocs/langs/fr_CA/companies.lang | 7 +++++++ htdocs/langs/fr_CA/main.lang | 11 ++++++++++- 5 files changed, 46 insertions(+), 8 deletions(-) create mode 100644 htdocs/langs/fr_CA/admin.lang create mode 100644 htdocs/langs/fr_CA/companies.lang diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 531fb2f52fa..2b461206f2d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2793,7 +2793,7 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") if (empty($thirdparty_seller) || ! is_object($thirdparty_seller)) $thirdparty_seller=$mysoc; - dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller id=".$thirdparty_seller->id); + dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')."/country_code=".(is_object($thirdparty_buyer)?$thirdparty_buyer->country_code:'')." thirdparty_seller id=".$thirdparty_seller->id."/country_code=".$thirdparty_seller->country_code." thirdparty_seller localtax1_assuj=".$thirdparty_seller->localtax1_assuj." thirdparty_seller localtax2_assuj=".$thirdparty_seller->localtax2_assuj); // Some test to guess with no need to make database access if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe @@ -2819,16 +2819,18 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") } //if ($local == 0 && ! $thirdparty_seller->localtax1_assuj && ! $thirdparty_seller->localtax2_assuj) return array('localtax1'=>0,'localtax2'=>0); - $code_country=$thirdparty_seller->country_code; + // Do not enabled this. We want localtax that match the vat rate. + // If we forced a vat, we must also force local tax + /* if (is_object($thirdparty_buyer)) { - if ($code_country != $thirdparty_buyer->country_code) return 0; - } + if ($thirdparty_seller->country_code != $thirdparty_buyer->country_code) return 0; + }*/ // Search local taxes $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 = '".$code_country."'"; + $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$thirdparty_seller->country_code."'"; $sql .= " AND t.taux = ".$tva." AND t.active = 1"; dol_syslog("get_localtax sql=".$sql); diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php index c3af3e2e973..5b4fbee52ff 100644 --- a/htdocs/core/lib/price.lib.php +++ b/htdocs/core/lib/price.lib.php @@ -79,7 +79,9 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $seller=$mysoc; // If sell is done to a customer, $seller is not provided, we use $mysoc //var_dump($seller->country_id);exit; } - + // Too verbose. Enable for debug only + //dol_syslog("calcul_price_total qty=".$qty." pu=".$pu." remiserpercent_ligne=".$remise_percent_ligne." txtva=".$txtva." uselocaltax1_rate=".$uselocaltax1_rate." uselocaltax2_rate=".$uselocaltax2_rate); + $countryid=$seller->country_id; if ($uselocaltax1_rate < 0) $uselocaltax1_rate=$seller->localtax1_assuj; if ($uselocaltax2_rate < 0) $uselocaltax2_rate=$seller->localtax2_assuj; @@ -91,7 +93,7 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $uselocalt $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as cv"; $sql.= " WHERE cv.taux = ".$txtva; $sql.= " AND cv.fk_pays = ".$countryid; - dol_syslog("search vat information sql=".$sql); + dol_syslog("calcul_price_total search vat information sql=".$sql); $resql = $db->query($sql); if ($resql) { diff --git a/htdocs/langs/fr_CA/admin.lang b/htdocs/langs/fr_CA/admin.lang new file mode 100644 index 00000000000..69e2630bc9c --- /dev/null +++ b/htdocs/langs/fr_CA/admin.lang @@ -0,0 +1,18 @@ +# Dolibarr language file - Source file is en_US - admin +CHARSET=UTF-8 +VATManagement=Gestion TPS +VATIsUsedDesc=Le taux de TPS proposé par défaut lors de la création de proposition commerciale, facture, commande, etc... répond à la règle standard suivante :
Si vendeur non assujetti à TPS, TPS par défaut=0. Fin de règle.
Si le (pays vendeur= pays acheteur) alors TPS par défaut=TPS du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et bien vendu= moyen de transport neuf (auto, bateau, avion), TPS par défaut=0 (La TPS doit être payée par acheteur au centre d'impôts de son pays et non au vendeur). Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= particulier alors TPS par défaut=TPS du produit vendu. Fin de règle.
Si vendeur et acheteur dans Communauté européenne et acheteur= entreprise alors TPS par défaut=0. Fin de règle.
Sinon TPS proposée par défaut=0. Fin de règle.
+VATIsNotUsedDesc=Le taux de TPS proposé par défaut est 0. C'est le cas d'associations, particuliers ou certaines petites sociétés. +VATIsUsedExampleFR=En France, il s'agit des sociétés ou organismes ayant choisi un régime fiscale réel (Réel simplifié ou Réel normal), régime dans lequel la TVA est déclarée. +VATIsNotUsedExampleFR=En France, il s'agit des associations ne déclarant pas de TVA ou sociétés, organismes ou professions libérales ayant choisi le régime fiscal micro entreprise (TVA en franchise) et payant une TVA en franchise sans faire de déclaration de TVA. Ce choix fait de plus apparaître la mention "TVA non applicable - art-293B du CGI" sur les factures. +##### Local Taxes ##### +LocalTax1IsUsed=Assujeti +LocalTax1IsNotUsed=Non assujeti +LocalTax1IsUsedDesc=Utilisation de 2ème type taxe (TVQ) +LocalTax1IsNotUsedDesc=Pas d'utilisation de 2ème type taxe (TVQ) +LocalTax1Management=Gestion TVQ +LocalTax1ManagementCA= Gestion TVQ +LocalTax1IsUsedDescCA= +LocalTax1IsNotUsedDescCA= +LocalTax1IsUsedExampleCA= +LocalTax1IsNotUsedExampleCA= diff --git a/htdocs/langs/fr_CA/companies.lang b/htdocs/langs/fr_CA/companies.lang new file mode 100644 index 00000000000..b3028ccfe5a --- /dev/null +++ b/htdocs/langs/fr_CA/companies.lang @@ -0,0 +1,7 @@ +# Dolibarr language file - en_US - companies +CHARSET=UTF-8 +VATIsUsed=Assujetti à la TPS +VATIsNotUsed=Non assujetti à la TPS +##### Local Taxes ##### +LocalTax1IsUsedES= Assujetti à TVQ +LocalTax1IsNotUsedES= Non assujetti à TVQ \ No newline at end of file diff --git a/htdocs/langs/fr_CA/main.lang b/htdocs/langs/fr_CA/main.lang index ca4b13b8480..cb3893d45fc 100644 --- a/htdocs/langs/fr_CA/main.lang +++ b/htdocs/langs/fr_CA/main.lang @@ -13,4 +13,13 @@ FormatDateTextShort=%d %b %Y FormatDateText=%d %B %Y FormatDateHourShort=%d.%m.%Y %H:%M FormatDateHourTextShort=%d %b %Y %H:%M -FormatDateHourText=%d %B %Y %H:%M \ No newline at end of file +FormatDateHourText=%d %B %Y %H:%M +AmountVAT=Montant TPS +AmountLT1=Montant TVQ +TotalVAT=Total TPS +TotalLT1=Total TVQ +IncludedVAT=Dont TPS +VAT=TPS +LT1CA=TVQ +VATRate=Taux TPS +ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux de taxe défini pour le pays '%s'. \ No newline at end of file From 9f1eb0676b9f5a8bce5ac5c635428851ee4fc392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Doursenaud?= Date: Thu, 30 May 2013 16:31:27 +0200 Subject: [PATCH 10/22] Fix install with PostgreSQL The language should be lowercase and unquoted --- htdocs/install/pgsql/functions/functions.sql | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/install/pgsql/functions/functions.sql b/htdocs/install/pgsql/functions/functions.sql index 697fef486e2..a8114e26c5b 100644 --- a/htdocs/install/pgsql/functions/functions.sql +++ b/htdocs/install/pgsql/functions/functions.sql @@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION UNIX_TIMESTAMP(TIMESTAMP WITHOUT TIME ZONE) RETURNS B CREATE OR REPLACE FUNCTION UNIX_TIMESTAMP(TIMESTAMP WITH TIME ZONE) RETURNS BIGINT LANGUAGE SQL IMMUTABLE STRICT AS 'SELECT EXTRACT(EPOCH FROM $1)::bigint;'; -CREATE OR REPLACE FUNCTION date_format(timestamp without time zone, text) RETURNS text AS $$ DECLARE i int := 1; temp text := ''; c text; n text; res text; BEGIN WHILE i <= pg_catalog.length($2) LOOP c := SUBSTRING ($2 FROM i FOR 1); IF c = '%' AND i != pg_catalog.length($2) THEN n := SUBSTRING ($2 FROM (i + 1) FOR 1); SELECT INTO res CASE WHEN n = 'a' THEN pg_catalog.to_char($1, 'Dy') WHEN n = 'b' THEN pg_catalog.to_char($1, 'Mon') WHEN n = 'c' THEN pg_catalog.to_char($1, 'FMMM') WHEN n = 'D' THEN pg_catalog.to_char($1, 'FMDDth') WHEN n = 'd' THEN pg_catalog.to_char($1, 'DD') WHEN n = 'e' THEN pg_catalog.to_char($1, 'FMDD') WHEN n = 'f' THEN pg_catalog.to_char($1, 'US') WHEN n = 'H' THEN pg_catalog.to_char($1, 'HH24') WHEN n = 'h' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'I' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'i' THEN pg_catalog.to_char($1, 'MI') WHEN n = 'j' THEN pg_catalog.to_char($1, 'DDD') WHEN n = 'k' THEN pg_catalog.to_char($1, 'FMHH24') WHEN n = 'l' THEN pg_catalog.to_char($1, 'FMHH12') WHEN n = 'M' THEN pg_catalog.to_char($1, 'FMMonth') WHEN n = 'm' THEN pg_catalog.to_char($1, 'MM') WHEN n = 'p' THEN pg_catalog.to_char($1, 'AM') WHEN n = 'r' THEN pg_catalog.to_char($1, 'HH12:MI:SS AM') WHEN n = 'S' THEN pg_catalog.to_char($1, 'SS') WHEN n = 's' THEN pg_catalog.to_char($1, 'SS') WHEN n = 'T' THEN pg_catalog.to_char($1, 'HH24:MI:SS') WHEN n = 'U' THEN pg_catalog.to_char($1, '?') WHEN n = 'u' THEN pg_catalog.to_char($1, '?') WHEN n = 'V' THEN pg_catalog.to_char($1, '?') WHEN n = 'v' THEN pg_catalog.to_char($1, '?') WHEN n = 'W' THEN pg_catalog.to_char($1, 'FMDay') WHEN n = 'w' THEN EXTRACT(DOW FROM $1)::text WHEN n = 'X' THEN pg_catalog.to_char($1, '?') WHEN n = 'x' THEN pg_catalog.to_char($1, '?') WHEN n = 'Y' THEN pg_catalog.to_char($1, 'YYYY') WHEN n = 'y' THEN pg_catalog.to_char($1, 'YY') WHEN n = '%' THEN pg_catalog.to_char($1, '%') ELSE NULL END; temp := temp operator(pg_catalog.||) res; i := i + 2; ELSE temp = temp operator(pg_catalog.||) c; i := i + 1; END IF; END LOOP; RETURN temp; END $$ IMMUTABLE STRICT LANGUAGE 'PLPGSQL'; +CREATE OR REPLACE FUNCTION date_format(timestamp without time zone, text) RETURNS text AS $$ DECLARE i int := 1; temp text := ''; c text; n text; res text; BEGIN WHILE i <= pg_catalog.length($2) LOOP c := SUBSTRING ($2 FROM i FOR 1); IF c = '%' AND i != pg_catalog.length($2) THEN n := SUBSTRING ($2 FROM (i + 1) FOR 1); SELECT INTO res CASE WHEN n = 'a' THEN pg_catalog.to_char($1, 'Dy') WHEN n = 'b' THEN pg_catalog.to_char($1, 'Mon') WHEN n = 'c' THEN pg_catalog.to_char($1, 'FMMM') WHEN n = 'D' THEN pg_catalog.to_char($1, 'FMDDth') WHEN n = 'd' THEN pg_catalog.to_char($1, 'DD') WHEN n = 'e' THEN pg_catalog.to_char($1, 'FMDD') WHEN n = 'f' THEN pg_catalog.to_char($1, 'US') WHEN n = 'H' THEN pg_catalog.to_char($1, 'HH24') WHEN n = 'h' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'I' THEN pg_catalog.to_char($1, 'HH12') WHEN n = 'i' THEN pg_catalog.to_char($1, 'MI') WHEN n = 'j' THEN pg_catalog.to_char($1, 'DDD') WHEN n = 'k' THEN pg_catalog.to_char($1, 'FMHH24') WHEN n = 'l' THEN pg_catalog.to_char($1, 'FMHH12') WHEN n = 'M' THEN pg_catalog.to_char($1, 'FMMonth') WHEN n = 'm' THEN pg_catalog.to_char($1, 'MM') WHEN n = 'p' THEN pg_catalog.to_char($1, 'AM') WHEN n = 'r' THEN pg_catalog.to_char($1, 'HH12:MI:SS AM') WHEN n = 'S' THEN pg_catalog.to_char($1, 'SS') WHEN n = 's' THEN pg_catalog.to_char($1, 'SS') WHEN n = 'T' THEN pg_catalog.to_char($1, 'HH24:MI:SS') WHEN n = 'U' THEN pg_catalog.to_char($1, '?') WHEN n = 'u' THEN pg_catalog.to_char($1, '?') WHEN n = 'V' THEN pg_catalog.to_char($1, '?') WHEN n = 'v' THEN pg_catalog.to_char($1, '?') WHEN n = 'W' THEN pg_catalog.to_char($1, 'FMDay') WHEN n = 'w' THEN EXTRACT(DOW FROM $1)::text WHEN n = 'X' THEN pg_catalog.to_char($1, '?') WHEN n = 'x' THEN pg_catalog.to_char($1, '?') WHEN n = 'Y' THEN pg_catalog.to_char($1, 'YYYY') WHEN n = 'y' THEN pg_catalog.to_char($1, 'YY') WHEN n = '%' THEN pg_catalog.to_char($1, '%') ELSE NULL END; temp := temp operator(pg_catalog.||) res; i := i + 2; ELSE temp = temp operator(pg_catalog.||) c; i := i + 1; END IF; END LOOP; RETURN temp; END $$ IMMUTABLE STRICT LANGUAGE plpgsql; CREATE OR REPLACE FUNCTION YEAR(TIMESTAMP without TIME ZONE) RETURNS INTEGER AS $$ SELECT EXTRACT(YEAR FROM $1)::INTEGER; $$ LANGUAGE SQL IMMUTABLE; @@ -47,13 +47,13 @@ CREATE OR REPLACE FUNCTION DAY(TIMESTAMP WITH TIME ZONE) RETURNS INTEGER AS $$ S CREATE OR REPLACE FUNCTION DAY(DATE) RETURNS INTEGER AS $$ SELECT EXTRACT(DAY FROM $1)::INTEGER; $$ LANGUAGE SQL IMMUTABLE; -CREATE OR REPLACE FUNCTION dol_util_rebuild_sequences() RETURNS integer as $body$ DECLARE sequencedefs RECORD; c integer ; BEGIN FOR sequencedefs IN SELECT DISTINCT constraint_column_usage.table_name as tablename, constraint_column_usage.table_name as tablename, constraint_column_usage.column_name as columnname, replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','') as sequencename from information_schema.constraint_column_usage, information_schema.columns, information_schema.sequences where constraint_column_usage.table_schema ='public' AND columns.table_schema = 'public' AND columns.table_name=constraint_column_usage.table_name AND constraint_column_usage.column_name IN ('rowid','id') AND constraint_column_usage.column_name = columns.column_name AND columns.column_default is not null AND replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','')=sequence_name LOOP EXECUTE 'select max('||sequencedefs.columnname||') from ' || sequencedefs.tablename INTO c; IF c is null THEN c = 0; END IF; IF c is not null THEN c = c+ 1; END IF; EXECUTE 'alter sequence ' || sequencedefs.sequencename ||' restart with ' || c; END LOOP; RETURN 1; END; $body$ LANGUAGE 'PLPGSQL'; +CREATE OR REPLACE FUNCTION dol_util_rebuild_sequences() RETURNS integer as $body$ DECLARE sequencedefs RECORD; c integer ; BEGIN FOR sequencedefs IN SELECT DISTINCT constraint_column_usage.table_name as tablename, constraint_column_usage.table_name as tablename, constraint_column_usage.column_name as columnname, replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','') as sequencename from information_schema.constraint_column_usage, information_schema.columns, information_schema.sequences where constraint_column_usage.table_schema ='public' AND columns.table_schema = 'public' AND columns.table_name=constraint_column_usage.table_name AND constraint_column_usage.column_name IN ('rowid','id') AND constraint_column_usage.column_name = columns.column_name AND columns.column_default is not null AND replace(replace(columns.column_default,'''::regclass)',''),'nextval(''','')=sequence_name LOOP EXECUTE 'select max('||sequencedefs.columnname||') from ' || sequencedefs.tablename INTO c; IF c is null THEN c = 0; END IF; IF c is not null THEN c = c+ 1; END IF; EXECUTE 'alter sequence ' || sequencedefs.sequencename ||' restart with ' || c; END LOOP; RETURN 1; END; $body$ LANGUAGE plpgsql; -CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer AS $BODY$ DECLARE mytables RECORD; BEGIN FOR mytables IN SELECT relname FROM pg_class WHERE relhastriggers IS TRUE AND relkind = 'r' AND NOT relname LIKE 'pg_%' LOOP IF DoEnable THEN EXECUTE 'ALTER TABLE ' || mytables.relname || ' ENABLE TRIGGER ALL'; ELSE EXECUTE 'ALTER TABLE ' || mytables.relname || ' DISABLE TRIGGER ALL'; END IF; END LOOP; RETURN 1; END; $BODY$ LANGUAGE 'PLPGSQL'; +CREATE OR REPLACE FUNCTION dol_util_triggerall(DoEnable boolean) RETURNS integer AS $BODY$ DECLARE mytables RECORD; BEGIN FOR mytables IN SELECT relname FROM pg_class WHERE relhastriggers IS TRUE AND relkind = 'r' AND NOT relname LIKE 'pg_%' LOOP IF DoEnable THEN EXECUTE 'ALTER TABLE ' || mytables.relname || ' ENABLE TRIGGER ALL'; ELSE EXECUTE 'ALTER TABLE ' || mytables.relname || ' DISABLE TRIGGER ALL'; END IF; END LOOP; RETURN 1; END; $BODY$ LANGUAGE plpgsql; -- Add triggers for timestamp fields -CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE 'PLPGSQL'; +CREATE OR REPLACE FUNCTION update_modified_column_tms() RETURNS TRIGGER AS $$ BEGIN NEW.tms = now(); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_accountingtransaction FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_actioncomm FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_adherent FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -75,7 +75,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_contratdet_log FOR E CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_cotisation FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_deplacement FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_don FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE OR REPLACE FUNCTION update_modified_column_date_m() RETURNS TRIGGER AS $$ BEGIN NEW.date_m = now(); RETURN NEW; END; $$ LANGUAGE 'PLPGSQL'; +CREATE OR REPLACE FUNCTION update_modified_column_date_m() RETURNS TRIGGER AS $$ BEGIN NEW.date_m = now(); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_ecm_directories FOR EACH ROW EXECUTE PROCEDURE update_modified_column_date_m(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_entrepot FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_events FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); @@ -96,7 +96,7 @@ CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product FOR EACH ROW CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_extrafields FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_fournisseur_price FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_price FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); -CREATE OR REPLACE FUNCTION update_modified_column_date_price() RETURNS TRIGGER AS $$ BEGIN NEW.date_price = now(); RETURN NEW; END; $$ LANGUAGE 'PLPGSQL'; +CREATE OR REPLACE FUNCTION update_modified_column_date_price() RETURNS TRIGGER AS $$ BEGIN NEW.date_price = now(); RETURN NEW; END; $$ LANGUAGE plpgsql; CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_price_by_qty FOR EACH ROW EXECUTE PROCEDURE update_modified_column_date_price(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_product_stock FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); CREATE TRIGGER update_customer_modtime BEFORE UPDATE ON llx_projet FOR EACH ROW EXECUTE PROCEDURE update_modified_column_tms(); From 4b0b6fdd55e1a996178f1bc3b0e8fe289c562a69 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jun 2013 00:24:13 +0200 Subject: [PATCH 11/22] Fix: Avoid pb with jmobile --- htdocs/adherents/stats/geo.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php index c1a73569e57..083d323520d 100755 --- a/htdocs/adherents/stats/geo.php +++ b/htdocs/adherents/stats/geo.php @@ -51,8 +51,9 @@ $langs->load("members"); * View */ - -llxHeader('','','','',0,0,array('http://www.google.com/jsapi')); +$arrayjs=array('http://www.google.com/jsapi'); +if (! empty($conf->dol_use_jmobile)) $arrayjs=array(); +llxHeader('','','','',0,0,$arrayjs); $title=$langs->trans("Statistics"); if ($mode == 'memberbycountry') $title=$langs->trans("MembersStatisticsByCountries"); @@ -196,7 +197,7 @@ else // Show graphics -if ($mode == 'memberbycountry') +if (count($arrayjs) && $mode == 'memberbycountry') { $color_file = DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/graph-color.php'; if (is_readable($color_file)) include_once $color_file; From b3b80701fd4825b1ddd6ccb18b207aed413adb8a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jun 2013 02:03:19 +0200 Subject: [PATCH 12/22] Fix: Bug with jmobile --- htdocs/comm/action/fiche.php | 6 +++--- htdocs/core/lib/agenda.lib.php | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 3a74a2881bf..4b438786d56 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -888,7 +888,7 @@ if ($id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; print ''."\n"; print '
'; print ''; @@ -897,7 +897,7 @@ if ($id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewCal"),'object_calendarweek','class="hideonsmartphone"').' '; print '
'."\n"; print '
'; print ''; @@ -906,7 +906,7 @@ if ($id > 0) print ''; print ''; //print ''; - print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewCal"),'object_calendarday','class="hideonsmartphone"').' '; print '
'."\n"; print ''; print ''; diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 433b0fc82e6..dda971668de 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -115,13 +115,13 @@ function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirt // Buttons print ''; - print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewCal"),'object_calendar','class="hideonsmartphone"').' '; print '
'; - print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewWeek"),'object_calendarweek','class="hideonsmartphone"').' '; print '
'; - print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewDay"),'object_calendarday','class="hideonsmartphone"').' '; print '
'; - print img_picto($langs->trans("ViewList"),'object_list','class="hideonsmartphone"').' '; + print img_picto($langs->trans("ViewList"),'object_list','class="hideonsmartphone"').' '; print ''; // Legend From 0b3a52395d5d0a3f046e24833d76c80c4c14a07a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jun 2013 02:21:39 +0200 Subject: [PATCH 13/22] Fix: Missing mayotte --- htdocs/install/mysql/data/llx_20_c_departements.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/install/mysql/data/llx_20_c_departements.sql b/htdocs/install/mysql/data/llx_20_c_departements.sql index 4d13d502a4d..97281cdc9c3 100644 --- a/htdocs/install/mysql/data/llx_20_c_departements.sql +++ b/htdocs/install/mysql/data/llx_20_c_departements.sql @@ -135,6 +135,8 @@ insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,no insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 2,'972','97209',3,'MARTINIQUE','Martinique'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 3,'973','97302',3,'GUYANE','Guyane'); insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 4,'974','97411',3,'REUNION','Réunion'); +insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values ( 6,'976','97601',3,'MAYOTTE','Mayotte'); + -- Provinces Belgium (id country=2) insert into llx_c_departements (fk_region, code_departement,cheflieu,tncc,ncc,nom) values (201,'01','',1,'ANVERS','Anvers'); From 9b96e38a3580978eb8d9b6411a8e204818a18379 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jun 2013 02:49:44 +0200 Subject: [PATCH 14/22] Fix: Update vat rates for canada Conflicts: htdocs/langs/fr_CA/main.lang --- htdocs/install/mysql/data/llx_c_tva.sql | 2 ++ htdocs/langs/fr_CA/main.lang | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/install/mysql/data/llx_c_tva.sql b/htdocs/install/mysql/data/llx_c_tva.sql index 86adc112413..b198db78fe2 100644 --- a/htdocs/install/mysql/data/llx_c_tva.sql +++ b/htdocs/install/mysql/data/llx_c_tva.sql @@ -66,6 +66,8 @@ insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values ( 2 -- CANADA (id country=14) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (141, 14, '7','0','VAT standard rate',1); insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (142, 14, '0','0','VAT Rate 0',1); +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','TPS and TVQ rate',1); + -- CAMEROUN (id country=24) insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,note,active) values (241, 24, '19.25','0','VAT standard rate',1); diff --git a/htdocs/langs/fr_CA/main.lang b/htdocs/langs/fr_CA/main.lang index cb3893d45fc..834235f7573 100644 --- a/htdocs/langs/fr_CA/main.lang +++ b/htdocs/langs/fr_CA/main.lang @@ -22,4 +22,4 @@ IncludedVAT=Dont TPS VAT=TPS LT1CA=TVQ VATRate=Taux TPS -ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux de taxe défini pour le pays '%s'. \ No newline at end of file +ErrorNoVATRateDefinedForSellerCountry=Erreur, aucun taux de taxe défini pour le pays '%s'. From 520101bdfb6f82ca078c326820053ddef9507133 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Jun 2013 02:52:25 +0200 Subject: [PATCH 15/22] Fix: Missing vat rate --- htdocs/install/mysql/migration/3.3.0-3.4.0.sql | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql index eee29dbd594..a98ecd1e922 100755 --- a/htdocs/install/mysql/migration/3.3.0-3.4.0.sql +++ b/htdocs/install/mysql/migration/3.3.0-3.4.0.sql @@ -382,3 +382,6 @@ ALTER TABLE llx_user_clicktodial ADD COLUMN url varchar(255) AFTER fk_user; ALTER TABLE llx_fichinterdet ADD COLUMN fk_parent_line integer NULL AFTER fk_fichinter; ALTER TABLE llx_societe_address CHANGE COLUMN tel phone varchar(20); + +insert into llx_c_tva(rowid,fk_pays,taux,recuperableonly,localtax1,localtax1_type,note,active) values (143, 14,'5','0','9.975','1','TPS and TVQ rate',1); + From 8ae0939ae57e18e29cdcec59106bbeb3d6a78dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Garci=CC=81a?= Date: Sat, 1 Jun 2013 15:39:45 +0200 Subject: [PATCH 16/22] Fixed bug #903: Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php --- ChangeLog | 3 +++ htdocs/commande/liste.php | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9f8e4697296..ddafb08d110 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,9 @@ English Dolibarr ChangeLog -------------------------------------------------------------- +***** ChangeLog for 3.3.3 compared to 3.3.2 ***** +- Fix: [ bug #903 ] Fatal error: Call to undefined function dol_get_first_day() in htdocs/commande/liste.php ***** ChangeLog for 3.3.2 compared to 3.3.1 ***** @@ -34,6 +36,7 @@ English Dolibarr ChangeLog - Fix: [ bug #788 ] Date of linked interventions are not shown - Fix: external users should not see costprice and margin infos - Fix: [ bug #806 ] Tasks are ordered alphabetically instead of chronological order + ***** ChangeLog for 3.3.1 compared to 3.3 ***** - Fix: [ bug #733 ] Mass emailing tools do not support