Fix: An easier to understand fix. Remove also not recommanded "continue
2" instructions.
This commit is contained in:
parent
1555bb681c
commit
f3df7a2fec
@ -722,20 +722,10 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
//Local tax 1 before VAT
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
case '7':
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->country_code!='ES')
|
||||
{
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
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')) && $mysoc->country_code != 'ES') continue;
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
@ -761,23 +751,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')
|
||||
{
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
case '7':
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->country_code!='ES')
|
||||
{
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
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')) && $mysoc->country_code != 'ES') continue;
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
@ -834,14 +814,10 @@ class pdf_einstein extends ModelePDFCommandes
|
||||
//Local tax 1 after VAT
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '2':
|
||||
case '4':
|
||||
case '6':
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
|
||||
{
|
||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
@ -875,17 +851,13 @@ 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')
|
||||
{
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '2':
|
||||
case '4':
|
||||
case '6':
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
|
||||
{
|
||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
|
||||
@ -852,19 +852,11 @@ class pdf_crabe extends ModelePDFFactures
|
||||
//Local tax 1 before VAT
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
case '7':
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->country_code!='ES')
|
||||
{
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
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')) && $mysoc->country_code != 'ES') continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
@ -889,23 +881,15 @@ 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')
|
||||
{
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
case '7':
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->country_code!='ES')
|
||||
{
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
}
|
||||
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')) && $mysoc->country_code != 'ES') continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
@ -962,14 +946,10 @@ class pdf_crabe extends ModelePDFFactures
|
||||
//Local tax 1 after VAT
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '2':
|
||||
case '4':
|
||||
case '6':
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
|
||||
{
|
||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
@ -1003,17 +983,13 @@ 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')
|
||||
{
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '2':
|
||||
case '4':
|
||||
case '6':
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
|
||||
{
|
||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
// retrieve global local tax
|
||||
|
||||
@ -755,20 +755,11 @@ class pdf_azur extends ModelePDFPropales
|
||||
//Local tax 1 before VAT
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
case '7':
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->country_code!='ES')
|
||||
{
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
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')) && $mysoc->country_code != 'ES') continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
@ -793,24 +784,15 @@ 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')
|
||||
{
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '1':
|
||||
case '3':
|
||||
case '5':
|
||||
case '7':
|
||||
//TODO: Place into a function to control showing by country or study better option
|
||||
if($mysoc->country_code!='ES')
|
||||
{
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
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')) && $mysoc->country_code != 'ES') continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey!=0) // On affiche pas taux 0
|
||||
@ -867,14 +849,10 @@ class pdf_azur extends ModelePDFPropales
|
||||
//Local tax 1 after VAT
|
||||
if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
|
||||
{
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '2':
|
||||
case '4':
|
||||
case '6':
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
foreach( $this->localtax1 as $localtax_type => $localtax_rate )
|
||||
{
|
||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
@ -908,17 +886,13 @@ 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')
|
||||
{
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate ) {
|
||||
switch ($localtax_type) {
|
||||
case '2':
|
||||
case '4':
|
||||
case '6':
|
||||
continue 2;
|
||||
break;
|
||||
}
|
||||
foreach( $this->localtax2 as $localtax_type => $localtax_rate )
|
||||
{
|
||||
if (in_array((string) $localtax_type, array('2','4','6'))) continue;
|
||||
|
||||
foreach( $localtax_rate as $tvakey => $tvaval )
|
||||
{
|
||||
if ($tvakey>0) // On affiche pas taux 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user