From 003caa7063015a9937c11d077137964cbcf15710 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 17 Mar 2010 19:26:54 +0000 Subject: [PATCH] Qual: Better organisation of tax module menus to match other modules --- htdocs/compta/charges/index.php | 24 +++++++++----- htdocs/compta/sociales/index.php | 31 +++++++------------ htdocs/compta/tva/fiche.php | 10 ++++-- htdocs/includes/menus/barre_left/eldy.lib.php | 6 ++-- htdocs/langs/en_US/compta.lang | 1 + htdocs/langs/fr_FR/compta.lang | 1 + 6 files changed, 40 insertions(+), 33 deletions(-) diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 2c7ea8b7617..a208a0a308a 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -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?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); +$title=$langs->trans("TaxAndDividendsArea"); +if ($_GET["mode"] == 'sconly') $title=$langs->trans("SocialContributionsPayments"); -print $langs->trans("DescTaxAndDividendsArea").'
'; -print "
"; +print_fiche_titre($title,($year?"".img_previous()." ".$langs->trans("Year")." $year ".img_next()."":"")); + +if ($_GET["mode"] != 'sconly') +{ + print $langs->trans("DescTaxAndDividendsArea").'
'; + print "
"; +} // Social contributions - -print_titre($langs->trans("SocialContributions")); +if ($_GET["mode"] != 'sconly') +{ + print_titre($langs->trans("SocialContributionsPayments")); +} print ''; print ""; print ''; @@ -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); diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 9b6c4f4aaf4..d002b26d34b 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * * 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 ''; // Label @@ -193,7 +186,7 @@ if ($resql) print ''; // Due date - print ''; + print ''; print ''; diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index 316be47c1c9..aa9f0f64964 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -178,11 +178,15 @@ if ($_GET["action"] == 'create') print '\n"; + print ""; } - - print ''; print '
'.$langs->trans("PeriodEndDate").''; - print ''.img_file().' '.$obj->id.''; + $chargesociale_static->id=$obj->id; + $chargesociale_static->lib=$obj->id; + $chargesociale_static->ref=$obj->id; + print $chargesociale_static->getNomUrl(1,'20'); print ''; if ($obj->periode) { - print 'periode).'">'.dol_print_date($obj->periode,'day').''; + print 'jdate($obj->periode)).'">'.dol_print_date($db->jdate($obj->periode),'day').''; } else { @@ -204,7 +197,7 @@ if ($resql) print ''.price($obj->amount).''.dol_print_date($obj->de, 'day').''.dol_print_date($db->jdate($obj->de), 'day').''.$chargesociale_static->LibStatut($obj->paye,5).'
'.$langs->trans("PaymentMode").''; $html->select_types_paiements($_POST["paiementtype"], "paiementtype"); print "
    '; - print '
'; + + print "
"; + + print '
  '; + print '
'; + print ''; } diff --git a/htdocs/includes/menus/barre_left/eldy.lib.php b/htdocs/includes/menus/barre_left/eldy.lib.php index bdcfdf92d06..e63f34b58f4 100644 --- a/htdocs/includes/menus/barre_left/eldy.lib.php +++ b/htdocs/includes/menus/barre_left/eldy.lib.php @@ -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); } diff --git a/htdocs/langs/en_US/compta.lang b/htdocs/langs/en_US/compta.lang index 0310998d20d..74dba2259aa 100644 --- a/htdocs/langs/en_US/compta.lang +++ b/htdocs/langs/en_US/compta.lang @@ -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 diff --git a/htdocs/langs/fr_FR/compta.lang b/htdocs/langs/fr_FR/compta.lang index 78bf203e331..d36e686fc15 100644 --- a/htdocs/langs/fr_FR/compta.lang +++ b/htdocs/langs/fr_FR/compta.lang @@ -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