forked from Wavyzz/dolibarr
Fix: Use better test to show localtax to avoid problem when switching
from different country. Perf: Can return all localtaxes in one call.
This commit is contained in:
@@ -375,23 +375,18 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
$vatrate=(string) $object->lines[$i]->tva_tx;
|
||||
|
||||
// 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];
|
||||
$localtaxtmp_array=getLocalTaxesFromRate($vatrate,0,$mysoc);
|
||||
if (! isset($localtax1_type)) $localtax1_type = $localtaxtmp_array[0];
|
||||
if (! isset($localtax2_type)) $localtax2_type = $localtaxtmp_array[2];
|
||||
//end TODO
|
||||
|
||||
// retrieve global local tax
|
||||
if ($localtax1_type == '7')
|
||||
$localtax1_rate = $localtax1_array[1];
|
||||
if ($localtax2_type == '7')
|
||||
$localtax2_rate = $localtax2_array[1];
|
||||
if ($localtax1_type == '7') $localtax1_rate = $localtaxtmp_array[1];
|
||||
if ($localtax2_type == '7') $localtax2_rate = $localtaxtmp_array[3];
|
||||
|
||||
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.='*';
|
||||
|
||||
Reference in New Issue
Block a user