From f571adf62e07b50e774a1b5ec326b204fc54a3b3 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Nov 2012 12:19:47 +0100 Subject: [PATCH] Fix: For supplier invoice, we must use properties of supplier to know if seller use localtax RE and IRPF. --- htdocs/fourn/facture/fiche.php | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 6ad8499ffc1..dfe8095d0e9 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -1361,11 +1361,9 @@ else if (! empty($conf->banque->enabled)) $nbcols++; // Local taxes - if ($mysoc->country_code=='ES') - { - if($mysoc->localtax1_assuj=="1") $nbrow++; - if($mysoc->localtax2_assuj=="1") $nbrow++; - } + // TODO I use here $societe->localtax1_assuj. Before it was $mysoc->localtax1_assuj, but this is a supplier invoice, so made by supplier, so depends on supplier properties + if ($societe->localtax1_assuj=="1") $nbrows++; + if ($societe->localtax2_assuj=="1") $nbrows++; print ''; @@ -1473,21 +1471,20 @@ else print ''.$langs->trans('AmountVAT').''.price($object->total_tva).''.$langs->trans('Currency'.$conf->currency).''; // Amount Local Taxes - if ($mysoc->country_code=='ES') + // TODO I use here $societe->localtax1_assuj. Before it was $mysoc->localtax1_assuj, but this is a supplier invoice, so made by supplier, so depends on supplier properties + if ($societe->localtax1_assuj=="1") //Localtax1 RE { - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE - { - print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; - print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF - { - print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; - print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } + print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; + print ''.price($object->total_localtax1).''; + print ''.$langs->trans("Currency".$conf->currency).''; } + if ($societe->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; + print ''.price($object->total_localtax2).''; + print ''.$langs->trans("Currency".$conf->currency).''; + } + print ''.$langs->trans('AmountTTC').''.price($object->total_ttc).''.$langs->trans('Currency'.$conf->currency).''; // Project