Fix: Works with IRPF/RE

This commit is contained in:
Laurent Destailleur 2010-07-20 18:07:38 +00:00
parent c1d61485e3
commit a830ef94f2
2 changed files with 88 additions and 76 deletions

View File

@ -607,7 +607,7 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
// Total LocalTax1 // Total LocalTax1
if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0) if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
@ -617,7 +617,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
// Total LocalTax2 // Total LocalTax2
if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax2on' && $object->total_localtax2>0) if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
@ -629,6 +629,8 @@ class pdf_einstein extends ModelePDFCommandes
else else
{ {
//Local tax 1 //Local tax 1
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
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
@ -652,8 +654,11 @@ class pdf_einstein extends ModelePDFCommandes
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
}
//Local tax 2 //Local tax 2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
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
@ -678,6 +683,7 @@ class pdf_einstein extends ModelePDFCommandes
} }
} }
} }
}
$useborder=0; $useborder=0;

View File

@ -635,7 +635,7 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_tva), 0, 'R', 1);
// Total LocalTax1 // Total LocalTax1
if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0) if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
@ -645,7 +645,7 @@ class pdf_propale_azur extends ModelePDFPropales
} }
// Total LocalTax2 // Total LocalTax2
if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax2on' && $object->total_localtax2>0) if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
{ {
$index++; $index++;
$pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index);
@ -657,6 +657,8 @@ class pdf_propale_azur extends ModelePDFPropales
else else
{ {
//Local tax 1 //Local tax 1
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
{
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
@ -680,8 +682,11 @@ class pdf_propale_azur extends ModelePDFPropales
$pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
} }
} }
}
//Local tax 2 //Local tax 2
if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
{
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
@ -708,6 +713,7 @@ class pdf_propale_azur extends ModelePDFPropales
} }
} }
} }
}
$useborder=0; $useborder=0;