Fix: Several problem with localtax into PDF generation

Conflicts:
	htdocs/core/modules/commande/doc/pdf_einstein.modules.php
	htdocs/core/modules/facture/doc/pdf_crabe.modules.php
	htdocs/core/modules/propale/doc/pdf_azur.modules.php
	htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
This commit is contained in:
Laurent Destailleur 2013-03-07 19:13:50 +01:00
parent 668249a195
commit e97ca67c4a
5 changed files with 100 additions and 106 deletions

View File

@ -720,12 +720,11 @@ class pdf_einstein extends ModelePDFCommandes
else else
{ {
//Local tax 1 before VAT //Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey!=0) // On affiche pas taux 0
@ -741,8 +740,8 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -750,14 +749,13 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
//Local tax 2 before VAT //Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey!=0) // On affiche pas taux 0 if ($tvakey!=0) // On affiche pas taux 0
@ -775,8 +773,8 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -785,7 +783,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
// VAT // VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
@ -812,15 +810,15 @@ class pdf_einstein extends ModelePDFCommandes
} }
//Local tax 1 after VAT //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -833,7 +831,7 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -842,7 +840,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
@ -850,17 +848,17 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
//Local tax 2 after VAT //Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -873,7 +871,7 @@ class pdf_einstein extends ModelePDFCommandes
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -882,7 +880,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -891,7 +889,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
} //}
// Total TTC // Total TTC
$index++; $index++;

View File

@ -850,12 +850,11 @@ class pdf_crabe extends ModelePDFFactures
else else
{ {
//Local tax 1 before VAT //Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -872,8 +871,8 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -881,14 +880,13 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
//Local tax 2 before VAT //Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -907,8 +905,8 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -917,7 +915,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
// VAT // VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
@ -944,15 +942,15 @@ class pdf_crabe extends ModelePDFFactures
} }
//Local tax 1 after VAT //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -965,7 +963,7 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -974,7 +972,7 @@ class pdf_crabe extends ModelePDFFactures
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
@ -982,10 +980,10 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
//Local tax 2 after VAT //Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
@ -993,7 +991,7 @@ class pdf_crabe extends ModelePDFFactures
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
// retrieve global local tax // retrieve global local tax
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -1006,7 +1004,7 @@ class pdf_crabe extends ModelePDFFactures
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -1015,7 +1013,7 @@ class pdf_crabe extends ModelePDFFactures
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -1023,7 +1021,7 @@ class pdf_crabe extends ModelePDFFactures
} }
} }
} }
} //}
} }
// Total TTC // Total TTC

View File

@ -753,12 +753,11 @@ class pdf_azur extends ModelePDFPropales
else else
{ {
//Local tax 1 before VAT //Local tax 1 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -775,8 +774,8 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -784,14 +783,13 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
//Local tax 2 before VAT //Local tax 2 before VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
// TODO: Place into a function to control showing by country or study better option if (in_array((string) $localtax_type, array('1','3','5','7'))) continue;
if (in_array((string) $localtax_type, array('1','3','5','7')) && $mysoc->country_code != 'ES') continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
@ -810,8 +808,8 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2".$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -820,7 +818,7 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
// VAT // VAT
foreach($this->tva as $tvakey => $tvaval) foreach($this->tva as $tvakey => $tvaval)
{ {
@ -847,15 +845,15 @@ class pdf_azur extends ModelePDFPropales
} }
//Local tax 1 after VAT //Local tax 1 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) foreach( $this->localtax1 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -868,7 +866,7 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT1".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -877,7 +875,7 @@ class pdf_azur extends ModelePDFPropales
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
@ -885,17 +883,17 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
//Local tax 2 after VAT //Local tax 2 after VAT
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) foreach( $this->localtax2 as $localtax_type => $localtax_rate )
{ {
if (in_array((string) $localtax_type, array('2','4','6'))) continue; if (in_array((string) $localtax_type, array('2','4','6'))) continue;
foreach( $localtax_rate as $tvakey => $tvaval ) foreach( $localtax_rate as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -908,7 +906,7 @@ class pdf_azur extends ModelePDFPropales
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat = $outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat = $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
if ($localtax_type == '7') { // amount on order if ($localtax_type == '7') { // amount on order
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
@ -917,7 +915,7 @@ class pdf_azur extends ModelePDFPropales
} }
else else
{ {
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
@ -926,7 +924,7 @@ class pdf_azur extends ModelePDFPropales
} }
} }
} }
} //}
// Total TTC // Total TTC
$index++; $index++;

View File

@ -529,7 +529,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), 0, 'R', 1);
} }
@ -539,19 +539,19 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), 0, 'R', 1);
} }
} }
else else
{ {
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
//Local tax 1 //Local tax 1
foreach( $this->localtax1 as $tvakey => $tvaval ) foreach( $this->localtax1 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -564,22 +564,22 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat =$outputlangs->transnoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
//Local tax 2 //Local tax 2
foreach( $this->localtax2 as $tvakey => $tvaval ) foreach( $this->localtax2 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -592,15 +592,15 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->pays_code).' '; $totalvat =$outputlangs->transnoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
} }
$useborder=0; $useborder=0;

View File

@ -697,7 +697,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
} }
@ -707,19 +707,19 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
{ {
$index++; $index++;
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code), 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
} }
} }
else else
{ {
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on') //if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{ //{
//Local tax 1 //Local tax 1
foreach( $this->localtax1 as $tvakey => $tvaval ) foreach( $this->localtax1 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -732,22 +732,22 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' '; $totalvat =$outputlangs->transcountrynoentities("TotalLT1",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on') //if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{ //{
//Local tax 2 //Local tax 2
foreach( $this->localtax2 as $tvakey => $tvaval ) foreach( $this->localtax2 as $tvakey => $tvaval )
{ {
if ($tvakey>0) // On affiche pas taux 0 if ($tvakey != 0) // On affiche pas taux 0
{ {
//$this->atleastoneratenotnull++; //$this->atleastoneratenotnull++;
@ -760,15 +760,15 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$tvakey=str_replace('*','',$tvakey); $tvakey=str_replace('*','',$tvakey);
$tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")"; $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
} }
$totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' '; $totalvat =$outputlangs->transcountrynoentities("TotalLT2",$mysoc->country_code).' ';
$totalvat.=vatrate($tvakey,1).$tvacompl; $totalvat.=vatrate(abs($tvakey),1).$tvacompl;
$pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index); $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
} //}
} }
// Total TTC // Total TTC