From 6ffdc039a23e3286d71d351eb7599305b7b7a321 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 22 Nov 2013 13:18:01 +0100 Subject: [PATCH] Fix: When option is not set, it must not appears as set. --- htdocs/admin/company.php | 11 ++++++----- htdocs/societe/class/societe.class.php | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 5580249c141..ad77a9ba8c7 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -561,9 +561,9 @@ if ($action == 'edit' || $action == 'updateedit') print ' '; print "\n"; $var=true; - $var=!$var; - print ""; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; print ''; print ""; print ""; @@ -595,7 +595,8 @@ if ($action == 'edit' || $action == 'updateedit') $var=true; $var=!$var; - print ""; + // Note: When option is not set, it must not appears as set on on, because there is no default value for this option + print ""; print '
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
'; print ""; print ""; @@ -941,7 +942,7 @@ else $var=true; $var=!$var; - print ""; + print ""; print '
".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."
'; print ""; print ""; @@ -974,7 +975,7 @@ else $var=true; $var=!$var; - print ""; + print ""; print '
".$langs->transcountry("LocalTax1IsUsedDesc",$mysoc->country_code)."
'; print ""; print ""; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 66d40e480ba..4e50a081079 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2552,8 +2552,8 @@ class Societe extends CommonObject $this->tva_assuj=((isset($conf->global->FACTURE_TVAOPTION) && $conf->global->FACTURE_TVAOPTION=='franchise')?0:1); // Define if company use local taxes - $this->localtax1_assuj=((isset($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')?1:0); - $this->localtax2_assuj=((isset($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')?1:0); + $this->localtax1_assuj=((isset($conf->global->FACTURE_LOCAL_TAX1_OPTION) && ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on'))?1:0); + $this->localtax2_assuj=((isset($conf->global->FACTURE_LOCAL_TAX2_OPTION) && ($conf->global->FACTURE_LOCAL_TAX2_OPTION=='1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on'))?1:0); } /**
".$langs->transcountry("LocalTax2IsUsedDesc",$mysoc->country_code)."