From d5822b7fbd760f34175ce5106a3900de3bb404cb Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 5 Mar 2013 18:13:27 +0100 Subject: [PATCH 1/4] Fix: Syntax sql error when adding/editing line of contract and when company does not use vat. --- htdocs/contrat/fiche.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 8aaf4a338ce..499f736d64b 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -299,7 +299,7 @@ else if ($action == 'addline' && $user->rights->contrat->creer) { $pu_ht=GETPOST('price_ht'); $price_base_type = 'HT'; - $tva_tx=str_replace('*','',GETPOST('tva_tx')); + $tva_tx=GETPOST('tva_tx')?str_replace('*','',GETPOST('tva_tx')):0; // tva_tx field may be disabled, so we use vat rate 0 $tva_npr=preg_match('/\*/',GETPOST('tva_tx'))?1:0; $desc=GETPOST('dp_desc'); } @@ -396,7 +396,7 @@ else if ($action == 'updateligne' && $user->rights->contrat->creer && ! GETPOST( $objectline->subprice=GETPOST('elprice'); $objectline->qty=GETPOST('elqty'); $objectline->remise_percent=GETPOST('elremise_percent'); - $objectline->tva_tx=GETPOST('eltva_tx'); + $objectline->tva_tx=GETPOST('eltva_tx')?GETPOST('eltva_tx'):0; // Field may be disabled, so we use vat rate 0 $objectline->localtax1_tx=$localtax1_tx; $objectline->localtax2_tx=$localtax2_tx; $objectline->date_ouverture_prevue=$date_start_update; From 617a71478bef981ffafc1ad5ece5ba2176d7a012 Mon Sep 17 00:00:00 2001 From: fhenry Date: Tue, 5 Mar 2013 19:05:12 +0100 Subject: [PATCH 2/4] fix [ bug #749 ] --- htdocs/core/lib/admin.lib.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index 0aa88aeeafa..cf817ae494d 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -1147,19 +1147,21 @@ function showModulesExludedForExternal($modules) $text=$langs->trans("OnlyFollowingModulesAreOpenedToExternalUsers"); $listofmodules=explode(',',$conf->global->MAIN_MODULES_FOR_EXTERNAL); $i=0; - foreach($modules as $module) - { - $moduleconst=$module->const_name; - $modulename=strtolower($module->name); - //print 'modulename='.$modulename; - - //if (empty($conf->global->$moduleconst)) continue; - if (! in_array($modulename,$listofmodules)) continue; - - if ($i > 0) $text.=', '; - else $text.=' '; - $i++; - $text .= $langs->trans('Module'.$module->numero.'Name'); + if (!empty($modules)) { + foreach($modules as $module) + { + $moduleconst=$module->const_name; + $modulename=strtolower($module->name); + //print 'modulename='.$modulename; + + //if (empty($conf->global->$moduleconst)) continue; + if (! in_array($modulename,$listofmodules)) continue; + + if ($i > 0) $text.=', '; + else $text.=' '; + $i++; + $text .= $langs->trans('Module'.$module->numero.'Name'); + } } return img_picto($langs->trans('InfoAdmin'), 'star').' '.$text; } From 9d047d740b8c2e55f3f56743bd23ab6393514d21 Mon Sep 17 00:00:00 2001 From: eldy Date: Wed, 6 Mar 2013 21:26:05 +0100 Subject: [PATCH 3/4] Fix: no null into not null field --- htdocs/contact/class/contact.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index c1eb6426c7b..8afb74a029f 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -253,7 +253,7 @@ class Contact extends CommonObject $sql .= ", priv = '".$this->priv."'"; $sql .= ", fk_user_modif=".($user->id > 0 ? "'".$user->id."'":"null"); $sql .= ", default_lang=".($this->default_lang?"'".$this->default_lang."'":"null"); - $sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"null"); + $sql .= ", no_email=".($this->no_email?"'".$this->no_email."'":"0"); $sql .= " WHERE rowid=".$id; dol_syslog(get_class($this)."::update sql=".$sql,LOG_DEBUG); From a3244a4b4720bac74654ca972b97cd04a131eb44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Mar 2013 11:05:20 +0100 Subject: [PATCH 4/4] Fix: Missing genereic translation --- htdocs/langs/en_US/main.lang | 2 ++ htdocs/langs/fr_FR/main.lang | 2 ++ 2 files changed, 4 insertions(+) diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 98c28b231b2..ce12e10119d 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -281,6 +281,8 @@ AmountTTCShort=Amount (inc. tax) AmountHT=Amount (net of tax) AmountTTC=Amount (inc. tax) AmountVAT=Amount tax +AmountLT1=Amount tax 2 +AmountLT2=Amount tax 3 AmountLT1ES=Amount RE AmountLT2ES=Amount IRPF AmountTotal=Total amount diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 301b97c1e3a..c6a9933aa65 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -283,6 +283,8 @@ AmountTTCShort=Montant TTC AmountHT=Montant HT AmountTTC=Montant TTC AmountVAT=Montant TVA +AmountLT1=Montant Tax 2 +AmountLT2=Montant Tax 3 AmountLT1ES=Montant RE AmountLT2ES=Montant IRPF AmountTotal=Montant total