Qual: Better organisation of tax module menus to match other modules

This commit is contained in:
Laurent Destailleur 2010-03-17 19:26:54 +00:00
parent b6626f562c
commit 003caa7063
6 changed files with 40 additions and 33 deletions

View File

@ -21,7 +21,7 @@
/** /**
* \file htdocs/compta/charges/index.php * \file htdocs/compta/charges/index.php
* \ingroup compta * \ingroup compta
* \brief Page to list social contributions * \brief Page to list payments of social contributions and vat
* \version $Id$ * \version $Id$
*/ */
@ -39,7 +39,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
$year=$_GET["year"]; $year=$_GET["year"];
$filtre=$_GET["filtre"]; $filtre=$_GET["filtre"];
if (! $year) { $year=date("Y", time()); } if (! $year && $_GET["mode"] != 'sconly') { $year=date("Y", time()); }
@ -53,15 +53,23 @@ $payment_sc_static=new PaiementCharge($db);
llxHeader('',$langs->trans("TaxAndDividendsArea")); llxHeader('',$langs->trans("TaxAndDividendsArea"));
print_fiche_titre($langs->trans("TaxAndDividendsArea"),($year?"<a href='index.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='index.php?year=".($year+1)."'>".img_next()."</a>":"")); $title=$langs->trans("TaxAndDividendsArea");
if ($_GET["mode"] == 'sconly') $title=$langs->trans("SocialContributionsPayments");
print $langs->trans("DescTaxAndDividendsArea").'<br>'; print_fiche_titre($title,($year?"<a href='index.php?year=".($year-1)."'>".img_previous()."</a> ".$langs->trans("Year")." $year <a href='index.php?year=".($year+1)."'>".img_next()."</a>":""));
print "<br>";
if ($_GET["mode"] != 'sconly')
{
print $langs->trans("DescTaxAndDividendsArea").'<br>';
print "<br>";
}
// Social contributions // Social contributions
if ($_GET["mode"] != 'sconly')
print_titre($langs->trans("SocialContributions")); {
print_titre($langs->trans("SocialContributionsPayments"));
}
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print "<tr class=\"liste_titre\">"; print "<tr class=\"liste_titre\">";
print '<td width="120">'.$langs->trans("PeriodEndDate").'</td>'; print '<td width="120">'.$langs->trans("PeriodEndDate").'</td>';
@ -90,7 +98,7 @@ if ($year > 0)
$sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = $year)"; $sql .= "or (s.periode is null and date_format(s.date_ech, '%Y') = $year)";
$sql .= ")"; $sql .= ")";
} }
$sql.= " GROUP BY c.id, c.libelle, s.rowid, s.fk_type, s.periode, s.date_ech"; $sql.= " GROUP BY c.id, c.libelle, s.rowid, s.fk_type, s.periode, s.date_ech, pc.rowid, pc.datep, pc.amount";
$sql.= " ORDER BY c.libelle ASC"; $sql.= " ORDER BY c.libelle ASC";
dol_syslog("compta/charges/index.php: select payment sql=".$sql); dol_syslog("compta/charges/index.php: select payment sql=".$sql);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -42,7 +42,7 @@ if ($page < 0) $page = 0;
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$offset = $limit * $page ; $offset = $limit * $page ;
if (! $sortfield) $sortfield="c.id"; if (! $sortfield) $sortfield="s.date_ech";
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
$year=$_GET["year"]; $year=$_GET["year"];
@ -71,13 +71,14 @@ else
* View * View
*/ */
llxHeader(); llxHeader();
$html = new Form($db); $html = new Form($db);
$sql = "SELECT s.rowid as id, s.fk_type as type, "; $sql = "SELECT s.rowid as id, s.fk_type as type, ";
$sql.= " s.amount,".$db->pdate("s.date_ech")." as de, s.libelle, s.paye,".$db->pdate("s.periode")." as periode,"; $sql.= " s.amount, s.date_ech, s.libelle, s.paye, s.periode,";
$sql.= " c.libelle as type_lib"; $sql.= " c.libelle as type_lib";
$sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as s"; $sql.= ", ".MAIN_DB_PREFIX."chargesociales as s";
@ -99,19 +100,8 @@ if ($filtre) {
if ($typeid) { if ($typeid) {
$sql .= " AND s.fk_type=".$typeid; $sql .= " AND s.fk_type=".$typeid;
} }
if ($_GET["sortfield"]) { $sql.=$db->order($sortfield,$sortorder);
$sql .= " ORDER BY ".$_GET["sortfield"]; $sql.= $db->plimit($limit+1,$offset);
}
else {
$sql .= " ORDER BY lower(s.date_ech)";
}
if ($_GET["sortorder"]) {
$sql .= " ".$_GET["sortorder"];
}
else {
$sql .= " DESC";
}
$sql .= $db->plimit($limit+1,$offset);
$chargesociale_static=new ChargeSociales($db); $chargesociale_static=new ChargeSociales($db);
@ -180,7 +170,10 @@ if ($resql)
// Ref // Ref
print '<td width="60">'; print '<td width="60">';
print '<a href="charges.php?id='.$obj->id.'">'.img_file().' '.$obj->id.'</a>'; $chargesociale_static->id=$obj->id;
$chargesociale_static->lib=$obj->id;
$chargesociale_static->ref=$obj->id;
print $chargesociale_static->getNomUrl(1,'20');
print '</td>'; print '</td>';
// Label // Label
@ -193,7 +186,7 @@ if ($resql)
print '<td align="center">'; print '<td align="center">';
if ($obj->periode) if ($obj->periode)
{ {
print '<a href="index.php?year='.strftime("%Y",$obj->periode).'">'.dol_print_date($obj->periode,'day').'</a>'; print '<a href="index.php?year='.strftime("%Y",$db->jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode),'day').'</a>';
} }
else else
{ {
@ -204,7 +197,7 @@ if ($resql)
print '<td align="right" width="100">'.price($obj->amount).'</td>'; print '<td align="right" width="100">'.price($obj->amount).'</td>';
// Due date // Due date
print '<td width="110" align="center">'.dol_print_date($obj->de, 'day').'</td>'; print '<td width="110" align="center">'.dol_print_date($db->jdate($obj->de), 'day').'</td>';
print '<td align="right" nowrap="nowrap">'.$chargesociale_static->LibStatut($obj->paye,5).'</a></td>'; print '<td align="right" nowrap="nowrap">'.$chargesociale_static->LibStatut($obj->paye,5).'</a></td>';

View File

@ -178,11 +178,15 @@ if ($_GET["action"] == 'create')
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>'; print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
$html->select_types_paiements($_POST["paiementtype"], "paiementtype"); $html->select_types_paiements($_POST["paiementtype"], "paiementtype");
print "</td>\n"; print "</td>\n";
print "</tr>";
} }
print '<tr><td>&nbsp;</td><td><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
print '</table>'; print '</table>';
print "<br>";
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
print '</form>'; print '</form>';
} }

View File

@ -458,15 +458,15 @@ function print_left_eldy_menu($db,$menu_array)
if ($conf->tax->enabled) if ($conf->tax->enabled)
{ {
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&amp;mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire); $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&amp;mainmenu=accountancy",$langs->trans("MenuTaxAndDividends"), 0, $user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&amp;mainmenu=accountancy&amp;mode=sconly",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("MenuSocialContributions"),1,$user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/charges.php?leftmenu=tax_social&action=create",$langs->trans("MenuNewSocialContribution"), 2, $user->rights->tax->charges->creer);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/sociales/index.php?leftmenu=tax_social",$langs->trans("List"), 2, $user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax_social&amp;mainmenu=accountancy&amp;mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire);
// VAT // VAT
if ($conf->compta->tva) if ($conf->compta->tva)
{ {
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&amp;mainmenu=accountancy",$langs->trans("VAT"),1,$user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/fiche.php?leftmenu=tax_vat&action=create",$langs->trans("NewPayment"),2,$user->rights->tax->charges->creer);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("List"),2,$user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/reglement.php?leftmenu=tax_vat",$langs->trans("Payments"),2,$user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/clients.php?leftmenu=tax_vat", $langs->trans("ReportByCustomers"), 2, $user->rights->tax->charges->lire);
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire); if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
} }

View File

@ -63,6 +63,7 @@ DatePayment=Payment date
NewVATPayment=New VAT payment NewVATPayment=New VAT payment
VATPayment=VAT Payment VATPayment=VAT Payment
VATPayments=VAT Payments VATPayments=VAT Payments
SocialContributionsPayments=Social contributions payments
ShowVatPayment=Show VAT payment ShowVatPayment=Show VAT payment
TotalToPay=Total to pay TotalToPay=Total to pay
TotalVATReceived=Total VAT received TotalVATReceived=Total VAT received

View File

@ -63,6 +63,7 @@ DatePayment=Date de règlement
NewVATPayment=Nouveau règlement de TVA NewVATPayment=Nouveau règlement de TVA
VATPayment=Règlement TVA VATPayment=Règlement TVA
VATPayments=Règlements TVA VATPayments=Règlements TVA
SocialContributionsPayments=Règlements charges sociales
ShowVatPayment=Affiche paiement TVA ShowVatPayment=Affiche paiement TVA
TotalToPay=Total à payer TotalToPay=Total à payer
TotalVATReceived=Total TVA perçue TotalVATReceived=Total TVA perçue