Works on enhancement of local taxes. Prepare User Interface of documents

This commit is contained in:
Juanjo Menent 2010-04-24 16:00:48 +00:00
parent 18aef6981c
commit ab819101db
7 changed files with 184 additions and 6 deletions

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010 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
@ -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 '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('NotePublic').' :<br>'. nl2br($propal->note_public).'</td>';
print '</tr>';
@ -1361,7 +1369,24 @@ if ($id > 0 || ! empty($ref))
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td>';
print '<td align="right" colspan="2" nowrap>'.price($propal->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right" colspan="2" nowrap>'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td height="10">'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right" colspan="2" nowrap>'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
// Amount TTC
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td>';
print '<td align="right" colspan="2" nowrap>'.price($propal->total_ttc).'</td>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010 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
@ -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 '<table class="border" width="100%">';
@ -1650,6 +1658,23 @@ else
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($commande->total_tva).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
// Total TTC
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($commande->total_ttc).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 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
@ -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 '<table class="border" width="100%">';
@ -352,6 +360,23 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($commande->total_tva).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
// Total TTC
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($commande->total_ttc).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010 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
@ -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 '<td rowspan="'.$nbrows.'" colspan="2" valign="top">';
@ -2798,6 +2806,24 @@ else
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_tva).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right" colspan="2" nowrap>'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right" colspan="2" nowrap>'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2" nowrap>'.price($fac->total_ttc).'</td>';
print '<td>'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2010 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
@ -196,6 +197,13 @@ if ($id > 0 || ! empty($ref))
print '</td>';
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 '<td valign="top" colspan="2" width="50%" rowspan="'.$rowspan.'">'.$langs->trans('NotePublic').' :<br>'. nl2br($propal->note_public).'</td>';
@ -303,6 +311,25 @@ if ($id > 0 || ! empty($ref))
print '<tr><td height="10">'.$langs->trans('AmountVAT').'</td><td align="right" colspan="2">'.price($propal->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right" colspan="2">'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right" colspan="2">'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
print '<tr><td height="10">'.$langs->trans('AmountTTC').'</td><td align="right" colspan="2">'.price($propal->total_ttc).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 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
@ -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 '<table class="border" width="100%">';
// Ref
@ -714,6 +723,22 @@ if ($id > 0 || ! empty($ref))
print '<tr><td>'.$langs->trans("AmountVAT").'</td><td align="right">'.price($commande->total_tva).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
print '<tr><td>'.$langs->trans("AmountTTC").'</td><td align="right">'.price($commande->total_ttc).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Christophe Combelles <ccomb@free.fr>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.fr>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2010 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
@ -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 '<td rowspan="'.$nbrows.'" valign="top">';
$sql = 'SELECT datep as dp, pf.amount,';
@ -874,9 +882,26 @@ else
$alreadypaid=$fac->getSommePaiement();
print '<tr><td>'.$langs->trans('Status').'</td><td colspan="3">'.$fac->getLibStatut(4,$alreadypaid).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountHT').'</td><td><b>'.price($fac->total_ht).'</b></td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td>'.price($fac->total_tva).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td>'.price($fac->total_ttc).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountHT').'</td><td align="right">'.price($fac->total_ht).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
print '<tr><td>'.$langs->trans('AmountVAT').'</td><td align="right">'.price($fac->total_tva).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Amount Local Taxes
if ($mysoc->pays_code=='ES' && $conf->global->MAIN_FEATURES_LEVEL >= 1)
{
if ($mysoc->localtax1_assuj=="1") //Localtax1 RE
{
print '<tr><td>'.$langs->transcountry("AmountLT1",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax1).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF
{
print '<tr><td>'.$langs->transcountry("AmountLT2",$mysoc->pays_code).'</td>';
print '<td align="right">'.price($propal->total_localtax2).'</td>';
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
}
}
print '<tr><td>'.$langs->trans('AmountTTC').'</td><td align="right">'.price($fac->total_ttc).'</td><td colspan="2" align="left">'.$langs->trans('Currency'.$conf->monnaie).'</td></tr>';
// Project
if ($conf->projet->enabled)