Merge pull request #576 from simnandez/3.3

Fix: [ bug #662 ] Bad aplication of Localtax2 for suppliers if country is Spain
This commit is contained in:
Laurent Destailleur 2013-01-06 04:02:12 -08:00
commit d70f671ba0
2 changed files with 36 additions and 4 deletions

View File

@ -3,7 +3,7 @@
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -153,6 +153,7 @@ if ($object->fetch($id))
print '</tr>';
// Local Taxes
//TODO: Place into a function to control showing by country or study better option
if($mysoc->country_code=='ES')
{
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
@ -176,6 +177,14 @@ if ($object->fetch($id))
print yn($object->localtax2_assuj);
print '</td></tr>';
}
if ($mysoc->localtax2_assuj!="1")
{
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print yn($object->localtax2_assuj);
print '</td><tr>';
}
}
// TVA Intra

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
*
* 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
@ -931,7 +931,8 @@ else
// Capital
print '<tr><td>'.$langs->trans('Capital').'</td><td colspan="3"><input type="text" name="capital" size="10" value="'.$object->capital.'"> '.$langs->trans("Currency".$conf->currency).'</td></tr>';
// Local Taxes
// Local Taxes
//TODO: Place into a function to control showing by country or study better option
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
@ -953,7 +954,13 @@ else
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><tr>';
}
if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='') )
{
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><tr>';
}
if (! empty($conf->global->MAIN_MULTILANGS))
{
print '<tr><td>'.$langs->trans("DefaultLang").'</td><td colspan="3">'."\n";
@ -1349,6 +1356,7 @@ else
print '</tr>';
// Local Taxes
//TODO: Place into a function to control showing by country or study better option
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
@ -1371,6 +1379,13 @@ else
print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1);
print '</td></tr>';
}
if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1)
{
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print $form->selectyesno('localtax2assuj_value',0,1);
print '</td><tr>';
}
// Type - Size
print '<tr><td>'.$langs->trans("ThirdPartyType").'</td><td>';
@ -1665,6 +1680,7 @@ else
print '</tr>';
// Local Taxes
//TODO: Place into a function to control showing by country or study better option
if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1")
{
print '<tr><td>'.$langs->transcountry("LocalTax1IsUsed",$mysoc->country_code).'</td><td>';
@ -1686,6 +1702,13 @@ else
print yn($object->localtax2_assuj);
print '</td><tr>';
}
if ($mysoc->country_code=='ES' && $mysoc->localtax2_assuj!="1" && ! empty($conf->fournisseur->enabled) && $object->fournisseur==1)
{
print '<tr><td>'.$langs->transcountry("LocalTax2IsUsed",$mysoc->country_code).'</td><td colspan="3">';
print yn($object->localtax2_assuj);
print '</td><tr>';
}
// Type + Staff
$arr = $formcompany->typent_array(1);