From ab819101dbf65d16fc1ce69dc45215176a14c904 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 24 Apr 2010 16:00:48 +0000 Subject: [PATCH] Works on enhancement of local taxes. Prepare User Interface of documents --- htdocs/comm/propal.php | 29 +++++++++++++++++++++++++++-- htdocs/commande/fiche.php | 25 +++++++++++++++++++++++++ htdocs/compta/commande/fiche.php | 27 ++++++++++++++++++++++++++- htdocs/compta/facture.php | 26 ++++++++++++++++++++++++++ htdocs/compta/propal.php | 27 +++++++++++++++++++++++++++ htdocs/fourn/commande/fiche.php | 25 +++++++++++++++++++++++++ htdocs/fourn/facture/fiche.php | 31 ++++++++++++++++++++++++++++--- 7 files changed, 184 insertions(+), 6 deletions(-) diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index a7cf0850a27..39f7ccc3ffc 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -5,6 +5,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1186,7 +1187,14 @@ if ($id > 0 || ! empty($ref)) if ($conf->projet->enabled) $rowspan++; if ($conf->global->PROPALE_ADD_DELIVERY_ADDRESS) $rowspan++; - + + //Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $rowspan++; + if($mysoc->localtax2_assuj=="1") $rowspan++; + } + // Notes print ''.$langs->trans('NotePublic').' :
'. nl2br($propal->note_public).''; print ''; @@ -1361,7 +1369,24 @@ if ($id > 0 || ! empty($ref)) print ''.$langs->trans('AmountVAT').''; print ''.price($propal->total_tva).''; print ''.$langs->trans("Currency".$conf->monnaie).''; - + + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''.$langs->transcountry("AmountLT1",$mysoc->pays_code).''; + print ''.price($propal->total_localtax1).''; + print ''.$langs->trans("Currency".$conf->monnaie).''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''.$langs->transcountry("AmountLT2",$mysoc->pays_code).''; + print ''.price($propal->total_localtax2).''; + print ''.$langs->trans("Currency".$conf->monnaie).''; + } + } + // Amount TTC print ''.$langs->trans('AmountTTC').''; print ''.price($propal->total_ttc).''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index b05a943ced8..c959ab15d27 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -4,6 +4,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1422,6 +1423,13 @@ else */ $nbrow=7; if ($conf->projet->enabled) $nbrow++; + + //Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $nbrow++; + if($mysoc->localtax2_assuj=="1") $nbrow++; + } print ''; @@ -1650,6 +1658,23 @@ else print ''; print ''; + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; + } + } + // Total TTC print ''; print ''; diff --git a/htdocs/compta/commande/fiche.php b/htdocs/compta/commande/fiche.php index 7f843169924..bd8c346e8c7 100644 --- a/htdocs/compta/commande/fiche.php +++ b/htdocs/compta/commande/fiche.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003-2005 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -147,8 +148,15 @@ if ($id > 0 || ! empty($ref)) /* * Commande */ - $nbrow=8; + $nbrow=7; if ($conf->projet->enabled) $nbrow++; + + //Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $nbrow++; + if($mysoc->localtax2_assuj=="1") $nbrow++; + } print '
'.$langs->trans('AmountVAT').''.price($commande->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($propal->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($propal->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($commande->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'; @@ -352,6 +360,23 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; + } + } + // Total TTC print ''; print ''; diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 9007e0413b1..c4798cde04d 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -5,6 +5,7 @@ * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2006 Andre Cianfarani + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2474,6 +2475,13 @@ else $nbrows=8; if ($conf->global->FAC_USE_CUSTOMER_ORDER_REF) $nbrows++; if ($conf->projet->enabled) $nbrows++; + + //Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $nbrows++; + if($mysoc->localtax2_assuj=="1") $nbrows++; + } print ''; print ''; print ''; + + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; + } + } + print ''; print ''; diff --git a/htdocs/compta/propal.php b/htdocs/compta/propal.php index 1566b55908a..d31ad73fd85 100644 --- a/htdocs/compta/propal.php +++ b/htdocs/compta/propal.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Raphael Bertrand (Resultic) + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -196,6 +197,13 @@ if ($id > 0 || ! empty($ref)) print ''; if ($conf->projet->enabled) $rowspan++; + + //Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $rowspan++; + if($mysoc->localtax2_assuj=="1") $rowspan++; + } // Note print ''; @@ -303,6 +311,25 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; + } + } + + print ''; print ''; diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index 7d142611739..72923db8276 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -636,6 +637,14 @@ if ($id > 0 || ! empty($ref)) */ $nbrow=8; if ($conf->projet->enabled) $nbrow++; + + //Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $nbrow++; + if($mysoc->localtax2_assuj=="1") $nbrow++; + } + print '
'.$langs->trans('AmountVAT').''.price($commande->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($propal->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($propal->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($commande->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'; @@ -2798,6 +2806,24 @@ else print ''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($fac->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($propal->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($propal->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($fac->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('NotePublic').' :
'. nl2br($propal->note_public).'
'.$langs->trans('AmountVAT').''.price($propal->total_tva).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($propal->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($propal->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($propal->total_ttc).''.$langs->trans("Currency".$conf->monnaie).'
'; // Ref @@ -714,6 +723,22 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; + } + } print ''; print ''; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 3c3da65807f..a87305a72f2 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Christophe Combelles * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2009 Regis Houssin + * Copyright (C) 2010 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -788,6 +789,13 @@ else */ $nbrows=7; if ($conf->projet->enabled) $nbrows++; + + // Local taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if($mysoc->localtax1_assuj=="1") $nbrow++; + if($mysoc->localtax2_assuj=="1") $nbrow++; + } print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + + // Amount Local Taxes + if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE + { + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; + } + } + print ''; // Project if ($conf->projet->enabled)
'.$langs->trans("AmountVAT").''.price($commande->total_tva).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($propal->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($propal->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans("AmountTTC").''.price($commande->total_ttc).''.$langs->trans("Currency".$conf->monnaie).'
'; $sql = 'SELECT datep as dp, pf.amount,'; @@ -874,9 +882,26 @@ else $alreadypaid=$fac->getSommePaiement(); print '
'.$langs->trans('Status').''.$fac->getLibStatut(4,$alreadypaid).'
'.$langs->trans('AmountHT').''.price($fac->total_ht).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($fac->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($fac->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountHT').''.price($fac->total_ht).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->trans('AmountVAT').''.price($fac->total_tva).''.$langs->trans('Currency'.$conf->monnaie).'
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($propal->total_localtax1).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($propal->total_localtax2).''.$langs->trans("Currency".$conf->monnaie).'
'.$langs->trans('AmountTTC').''.price($fac->total_ttc).''.$langs->trans('Currency'.$conf->monnaie).'