New: add possibility to hide vat only if null
This commit is contained in:
parent
cc4b2bf69c
commit
293eab7676
@ -627,7 +627,14 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
foreach( $this->tva as $tvakey => $tvaval )
|
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && $this->tva['0.000'] == (float) 0) ? true : false);
|
||||||
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
||||||
|
{
|
||||||
|
// Nothing to do
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey > 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -684,7 +691,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
//Local tax 1
|
//Local tax 1
|
||||||
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 $tvakey => $tvaval )
|
foreach($this->localtax1 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey>0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -712,7 +719,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
//Local tax 2
|
//Local tax 2
|
||||||
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 $tvakey => $tvaval )
|
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey>0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -737,11 +744,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Total TTC
|
// Total TTC
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
|
||||||
{
|
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
@ -751,6 +755,8 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$pdf->SetFont('','', $default_font_size - 1);
|
$pdf->SetFont('','', $default_font_size - 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
|
|||||||
@ -743,7 +743,14 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
foreach( $this->tva as $tvakey => $tvaval )
|
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && $this->tva['0.000'] == (float) 0) ? true : false);
|
||||||
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
||||||
|
{
|
||||||
|
// Nothing to do
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey > 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -798,7 +805,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
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
|
||||||
{
|
{
|
||||||
@ -826,7 +833,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
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
|
||||||
{
|
{
|
||||||
@ -851,11 +858,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Total TTC
|
// Total TTC
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
|
||||||
{
|
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
@ -866,6 +870,8 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($sign * $object->total_ttc), $useborder, 'R', 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
|
||||||
$creditnoteamount=$object->getSumCreditNotesUsed();
|
$creditnoteamount=$object->getSumCreditNotesUsed();
|
||||||
|
|||||||
@ -640,7 +640,14 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$this->atleastoneratenotnull=0;
|
$this->atleastoneratenotnull=0;
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
||||||
{
|
{
|
||||||
foreach( $this->tva as $tvakey => $tvaval )
|
$tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && $this->tva['0.000'] == (float) 0) ? true : false);
|
||||||
|
if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
|
||||||
|
{
|
||||||
|
// Nothing to do
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach($this->tva as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey > 0) // On affiche pas taux 0
|
if ($tvakey > 0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -698,7 +705,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
//Local tax 1
|
//Local tax 1
|
||||||
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 $tvakey => $tvaval )
|
foreach($this->localtax1 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey>0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -726,7 +733,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
//Local tax 2
|
//Local tax 2
|
||||||
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 $tvakey => $tvaval )
|
foreach($this->localtax2 as $tvakey => $tvaval)
|
||||||
{
|
{
|
||||||
if ($tvakey>0) // On affiche pas taux 0
|
if ($tvakey>0) // On affiche pas taux 0
|
||||||
{
|
{
|
||||||
@ -752,13 +759,10 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$useborder=0;
|
$useborder=0;
|
||||||
|
|
||||||
// Total TTC
|
// Total TTC
|
||||||
if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
|
|
||||||
{
|
|
||||||
$index++;
|
$index++;
|
||||||
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
$pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
@ -769,6 +773,7 @@ class pdf_azur extends ModelePDFPropales
|
|||||||
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
|
$pdf->MultiCell($largcol2, $tab2_hl, price($object->total_ttc), $useborder, 'R', 1);
|
||||||
$pdf->SetTextColor(0,0,0);
|
$pdf->SetTextColor(0,0,0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($deja_regle > 0)
|
if ($deja_regle > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user