Fix: Use better test to show localtax to avoid problem when switching

from different country.
This commit is contained in:
Laurent Destailleur 2013-03-15 17:06:42 +01:00
parent ed85869394
commit 1a62cdfbe8
3 changed files with 12 additions and 18 deletions

View File

@ -378,10 +378,8 @@ class pdf_einstein extends ModelePDFCommandes
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc);
$localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc);
if (empty($localtax1_type))
$localtax1_type = $localtax1_array[0];
if (empty($localtax2_type))
$localtax2_type = $localtax2_array[0];
if (! isset($localtax1_type)) $localtax1_type = $localtax1_array[0];
if (! isset($localtax2_type)) $localtax2_type = $localtax2_array[0];
//end TODO
// retrieve global local tax
@ -390,9 +388,9 @@ class pdf_einstein extends ModelePDFCommandes
if ($localtax2_type == '7')
$localtax2_rate = $localtax2_array[1];
if ($localtax1ligne != 0 || $localtax1_type == '7')
if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7'))
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2ligne != 0 || $localtax2_type == '7')
if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7'))
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';

View File

@ -380,10 +380,8 @@ class pdf_crabe extends ModelePDFFactures
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc);
$localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc);
if (empty($localtax1_type))
$localtax1_type = $localtax1_array[0];
if (empty($localtax2_type))
$localtax2_type = $localtax2_array[0];
if (! isset($localtax1_type)) $localtax1_type = $localtax1_array[0];
if (! isset($localtax2_type)) $localtax2_type = $localtax2_array[0];
//end TODO
// retrieve global local tax
@ -392,9 +390,9 @@ class pdf_crabe extends ModelePDFFactures
if ($localtax2_type == '7')
$localtax2_rate = $localtax2_array[1];
if ($localtax1ligne != 0 || $localtax1_type == '7')
if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7'))
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2ligne != 0 || $localtax2_type == '7')
if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7'))
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';

View File

@ -375,10 +375,8 @@ class pdf_azur extends ModelePDFPropales
// TODO : store local taxes types into object lines and remove this
$localtax1_array=getLocalTaxesFromRate($vatrate,1,$mysoc);
$localtax2_array=getLocalTaxesFromRate($vatrate,2,$mysoc);
if (empty($localtax1_type))
$localtax1_type = $localtax1_array[0];
if (empty($localtax2_type))
$localtax2_type = $localtax2_array[0];
if (! isset($localtax1_type)) $localtax1_type = $localtax1_array[0];
if (! isset($localtax2_type)) $localtax2_type = $localtax2_array[0];
//end TODO
// retrieve global local tax
@ -387,9 +385,9 @@ class pdf_azur extends ModelePDFPropales
if ($localtax2_type == '7')
$localtax2_rate = $localtax2_array[1];
if ($localtax1ligne != 0 || $localtax1_type == '7')
if ($localtax1_type && ($localtax1ligne != 0 || $localtax1_type == '7'))
$this->localtax1[$localtax1_type][$localtax1_rate]+=$localtax1ligne;
if ($localtax2ligne != 0 || $localtax2_type == '7')
if ($localtax2_type && ($localtax2ligne != 0 || $localtax2_type == '7'))
$this->localtax2[$localtax2_type][$localtax2_rate]+=$localtax2ligne;
if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';