Qual: Better organisation of tax module menus to match other modules
This commit is contained in:
parent
b6626f562c
commit
003caa7063
@ -21,7 +21,7 @@
|
||||
/**
|
||||
* \file htdocs/compta/charges/index.php
|
||||
* \ingroup compta
|
||||
* \brief Page to list social contributions
|
||||
* \brief Page to list payments of social contributions and vat
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
@ -39,7 +39,7 @@ $result = restrictedArea($user, 'tax', '', '', 'charges');
|
||||
|
||||
$year=$_GET["year"];
|
||||
$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"));
|
||||
|
||||
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 "<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>":""));
|
||||
|
||||
if ($_GET["mode"] != 'sconly')
|
||||
{
|
||||
print $langs->trans("DescTaxAndDividendsArea").'<br>';
|
||||
print "<br>";
|
||||
}
|
||||
|
||||
|
||||
// Social contributions
|
||||
|
||||
print_titre($langs->trans("SocialContributions"));
|
||||
if ($_GET["mode"] != 'sconly')
|
||||
{
|
||||
print_titre($langs->trans("SocialContributionsPayments"));
|
||||
}
|
||||
print '<table class="noborder" width="100%">';
|
||||
print "<tr class=\"liste_titre\">";
|
||||
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 .= ")";
|
||||
}
|
||||
$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";
|
||||
|
||||
dol_syslog("compta/charges/index.php: select payment sql=".$sql);
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* 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>
|
||||
*
|
||||
* 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;
|
||||
$offset = $limit * $page ;
|
||||
|
||||
if (! $sortfield) $sortfield="c.id";
|
||||
if (! $sortfield) $sortfield="s.date_ech";
|
||||
if (! $sortorder) $sortorder="DESC";
|
||||
|
||||
$year=$_GET["year"];
|
||||
@ -71,13 +71,14 @@ else
|
||||
* View
|
||||
*/
|
||||
|
||||
|
||||
llxHeader();
|
||||
|
||||
$html = new Form($db);
|
||||
|
||||
|
||||
$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.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
|
||||
$sql.= ", ".MAIN_DB_PREFIX."chargesociales as s";
|
||||
@ -99,19 +100,8 @@ if ($filtre) {
|
||||
if ($typeid) {
|
||||
$sql .= " AND s.fk_type=".$typeid;
|
||||
}
|
||||
if ($_GET["sortfield"]) {
|
||||
$sql .= " ORDER BY ".$_GET["sortfield"];
|
||||
}
|
||||
else {
|
||||
$sql .= " ORDER BY lower(s.date_ech)";
|
||||
}
|
||||
if ($_GET["sortorder"]) {
|
||||
$sql .= " ".$_GET["sortorder"];
|
||||
}
|
||||
else {
|
||||
$sql .= " DESC";
|
||||
}
|
||||
$sql .= $db->plimit($limit+1,$offset);
|
||||
$sql.=$db->order($sortfield,$sortorder);
|
||||
$sql.= $db->plimit($limit+1,$offset);
|
||||
|
||||
|
||||
$chargesociale_static=new ChargeSociales($db);
|
||||
@ -180,7 +170,10 @@ if ($resql)
|
||||
|
||||
// Ref
|
||||
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>';
|
||||
|
||||
// Label
|
||||
@ -193,7 +186,7 @@ if ($resql)
|
||||
print '<td align="center">';
|
||||
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
|
||||
{
|
||||
@ -204,7 +197,7 @@ if ($resql)
|
||||
print '<td align="right" width="100">'.price($obj->amount).'</td>';
|
||||
|
||||
// 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>';
|
||||
|
||||
|
||||
@ -178,11 +178,15 @@ if ($_GET["action"] == 'create')
|
||||
print '<tr><td class="fieldrequired">'.$langs->trans("PaymentMode").'</td><td>';
|
||||
$html->select_types_paiements($_POST["paiementtype"], "paiementtype");
|
||||
print "</td>\n";
|
||||
print "</tr>";
|
||||
}
|
||||
|
||||
print '<tr><td> </td><td><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
|
||||
print '</table>';
|
||||
|
||||
print "<br>";
|
||||
|
||||
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> ';
|
||||
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></center>';
|
||||
|
||||
print '</form>';
|
||||
}
|
||||
|
||||
|
||||
@ -458,15 +458,15 @@ function print_left_eldy_menu($db,$menu_array)
|
||||
if ($conf->tax->enabled)
|
||||
{
|
||||
$newmenu->add(DOL_URL_ROOT."/compta/charges/index.php?leftmenu=tax&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&mainmenu=accountancy&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/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&mainmenu=accountancy&mode=sconly",$langs->trans("Payments"), 2, $user->rights->tax->charges->lire);
|
||||
// VAT
|
||||
if ($conf->compta->tva)
|
||||
{
|
||||
if (preg_match('/^tax/i',$leftmenu)) $newmenu->add(DOL_URL_ROOT."/compta/tva/index.php?leftmenu=tax_vat&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/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/quadri_detail.php?leftmenu=tax_vat", $langs->trans("ReportByQuarter"), 2, $user->rights->tax->charges->lire);
|
||||
}
|
||||
|
||||
@ -63,6 +63,7 @@ DatePayment=Payment date
|
||||
NewVATPayment=New VAT payment
|
||||
VATPayment=VAT Payment
|
||||
VATPayments=VAT Payments
|
||||
SocialContributionsPayments=Social contributions payments
|
||||
ShowVatPayment=Show VAT payment
|
||||
TotalToPay=Total to pay
|
||||
TotalVATReceived=Total VAT received
|
||||
|
||||
@ -63,6 +63,7 @@ DatePayment=Date de règlement
|
||||
NewVATPayment=Nouveau règlement de TVA
|
||||
VATPayment=Règlement TVA
|
||||
VATPayments=Règlements TVA
|
||||
SocialContributionsPayments=Règlements charges sociales
|
||||
ShowVatPayment=Affiche paiement TVA
|
||||
TotalToPay=Total à payer
|
||||
TotalVATReceived=Total TVA perçue
|
||||
|
||||
Loading…
Reference in New Issue
Block a user