From e272f377922b8d2e25f979b36c02ba117d1cc859 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sun, 7 Feb 2010 11:18:00 +0000 Subject: [PATCH] Works on enhancement of local taxes New: Functionality applied to third parties --- htdocs/comm/fiche.php | 16 ++++++++ htdocs/compta/fiche.php | 16 ++++++++ htdocs/fourn/fiche.php | 16 ++++++++ htdocs/soc.php | 86 +++++++++++++++++++++++++++++++++++------ 4 files changed, 123 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 5558e83b136..7bc7a7b4aaf 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -5,6 +5,7 @@ * Copyright (C) 2006 Andre Cianfarani * 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 @@ -207,6 +208,21 @@ if ($socid > 0) print yn($objsoc->tva_assuj); print ''; print ''; + + // Local Taxes + if ($obj->code='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''; + print ''.$langs->trans('LocalTax1IsUsedES').''; + print yn($objsoc->localtax1_assuj); + print ''; + print ''; + print ''; + print ''.$langs->trans('LocalTax2IsUsedES').''; + print yn($objsoc->localtax2_assuj); + print ''; + print ''; + } // Conditions de reglement par defaut $langs->load('bills'); diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index c90cd045a72..d4797f87af3 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -1,6 +1,7 @@ * Copyright (C) 2004-2009 Laurent Destailleur + * 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 @@ -241,6 +242,21 @@ if ($socid > 0) print yn($societe->tva_assuj); print ''; print ''; + + // Local Taxes + if ($obj->code='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''; + print ''.$langs->trans('LocalTax1IsUsedES').''; + print yn($societe->localtax1_assuj); + print ''; + print ''; + print ''; + print ''.$langs->trans('LocalTax2IsUsedES').''; + print yn($societe->localtax2_assuj); + print ''; + print ''; + } // TVA Intra print ''.$langs->trans('VATIntraVeryShort').''; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 446151b1529..7051d9b6cbe 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -3,6 +3,7 @@ * Copyright (C) 2003 Eric Seigne * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2008 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 @@ -110,6 +111,21 @@ if ( $societe->fetch($socid) ) print yn($societe->tva_assuj); print ''; print ''; + +// Local Taxes + if ($obj->code='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''; + print ''.$langs->trans('LocalTax1IsUsedES').''; + print yn($societe->localtax1_assuj); + print ''; + print ''; + print ''; + print ''.$langs->trans('LocalTax2IsUsedES').''; + print yn($societe->localtax2_assuj); + print ''; + print ''; + } print ''; diff --git a/htdocs/soc.php b/htdocs/soc.php index daf38f74d62..01cacb831b6 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -5,6 +5,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2008 Patrick Raguin + * 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 @@ -111,6 +112,11 @@ if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) $soc->gencod = $_POST["gencod"]; $soc->tva_assuj = $_POST["assujtva_value"]; + + // Local Taxes + $soc->localtax1_assuj = $_POST["localtax1assuj_value"]; + $soc->localtax2_assuj = $_POST["localtax2assuj_value"]; + $soc->tva_intra = $_POST["tva_intra"]; $soc->forme_juridique_code = $_POST["forme_juridique_code"]; @@ -356,6 +362,11 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create') $soc->effectif_id=($_POST["effectif_id"]&&!$_POST["cleartype"])?$_POST["effectif_id_id"]:($_REQUEST["private"]?'EF1-5':''); $soc->tva_assuj = $_POST["assujtva_value"]; + + //Local Taxes + $soc->localtax1_assuj = $_POST["localtax1assuj_value"]; + $soc->localtax2_assuj = $_POST["localtax2assuj_value"]; + $soc->tva_intra=$_POST["tva_intra"]; $soc->commercial_id=$_POST["commercial_id"]; @@ -586,18 +597,23 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create') print ''; print $html->selectyesno('assujtva_value',1,1); // Assujeti par defaut en creation print ''; - - // Code TVA - if ($conf->use_javascript_ajax) + + + // Local Taxes + if($obj->code='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) { - print "\n"; - print ''; - print "\n"; + print ''.$langs->trans("LocalTax1IsUsedES").''; + print ''; + print $html->selectyesno('localtax1assuj_value',0,1); + print ''; + print ''.$langs->trans("LocalTax2IsUsedES").''; + print ''; + print $html->selectyesno('localtax2assuj_value',0,1); + print ''; + print ''; } + + print ''.$langs->trans('VATIntra').''; print ''; $s =''; @@ -614,6 +630,18 @@ $_GET["action"] == 'create' || $_POST["action"] == 'create') print ''; print ''; + + // Code TVA + if ($conf->use_javascript_ajax) + { + print "\n"; + print ''; + print "\n"; + } if ($user->rights->societe->client->voir) { @@ -709,6 +737,10 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') $soc->tva_assuj = $_POST["assujtva_value"]; $soc->tva_intra=$_POST["tva_intra"]; + + //Local Taxes + $soc->localtax1_assuj = $_POST["localtax1assuj_value"]; + $soc->localtax2_assuj = $_POST["localtax2assuj_value"]; // On positionne pays_id, pays_code et libelle du pays choisi if ($soc->pays_id) @@ -935,7 +967,22 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit') } print ''; print ''; - + + // Local Taxes + if($obj->code='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''.$langs->trans("LocalTax1IsUsedES").''; + print ''; + print $form->selectyesno('localtax1assuj_value',$soc->localtax1_assuj,1); + print ''; + + print ''.$langs->trans("LocalTax2IsUsedES").''; + print ''; + print $form->selectyesno('localtax2assuj_value',$soc->localtax2_assuj,1); + print ''; + print ''; + } + print ''.$langs->trans("Capital").' '.$langs->trans("Currency".$conf->monnaie).''; print ''.$langs->trans('JuridicalStatus').''; @@ -1156,6 +1203,23 @@ else print ''; print ''; + + // Local Taxes + if($obj->code='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1) + { + print ''; + print $langs->trans('LocalTax1IsUsedES'); + print ''; + print yn($soc->localtax1_assuj); + print ''; + + print ''; + print $langs->trans('LocalTax2IsUsedES'); + print ''; + print yn($soc->localtax2_assuj); + print ''; + } + // Capital print ''.$langs->trans('Capital').'';