From 82cbed8dc1e96dd05efefb1180e7114c4ae8d766 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 14 Feb 2010 13:12:05 +0000 Subject: [PATCH] Qual: Uniformise gui --- htdocs/chargesociales.class.php | 23 ++++++++++++++ htdocs/compta/charges/index.php | 51 +++++++++++++++++++----------- htdocs/compta/paiement/fiche.php | 2 +- htdocs/compta/sociales/charges.php | 5 ++- 4 files changed, 60 insertions(+), 21 deletions(-) diff --git a/htdocs/chargesociales.class.php b/htdocs/chargesociales.class.php index c89b33ea783..7009ff4bb67 100644 --- a/htdocs/chargesociales.class.php +++ b/htdocs/chargesociales.class.php @@ -767,6 +767,29 @@ class PaiementCharge extends CommonObject return 0; } } + + /** + * \brief Renvoie nom clicable (avec eventuellement le picto) + * \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul + * \param maxlen Longueur max libelle + * \return string Chaine avec URL + */ + function getNomUrl($withpicto=0,$maxlen=0) + { + global $langs; + + $result=''; + + if (empty($this->ref)) $this->ref=$this->lib; + + $lien = ''; + $lienfin=''; + + if ($withpicto) $result.=($lien.img_object($langs->trans("ShowPayment").': '.$this->ref,'payment').$lienfin.' '); + if ($withpicto && $withpicto != 2) $result.=' '; + if ($withpicto != 2) $result.=$lien.($maxlen?dol_trunc($this->ref,$maxlen):$this->ref).$lienfin; + return $result; + } } diff --git a/htdocs/compta/charges/index.php b/htdocs/compta/charges/index.php index 6fd885e3418..cd2fc1b998b 100644 --- a/htdocs/compta/charges/index.php +++ b/htdocs/compta/charges/index.php @@ -48,6 +48,8 @@ if (! $year) { $year=date("Y", time()); } */ $tva_static = new Tva($db); +$socialcontrib=new ChargeSociales($db); +$payment_sc_static=new PaiementCharge($db); llxHeader('',$langs->trans("TaxAndDividendsArea")); @@ -65,13 +67,15 @@ print ""; print ''.$langs->trans("PeriodEndDate").''; print ''.$langs->trans("Label").''; print "".$langs->trans("Type").""; -print "".$langs->trans("Amount").""; -print "".$langs->trans("NbOfPayments").""; -print "".$langs->trans("AlreadyPaid").""; +print ''.$langs->trans("ExpectedToPay").""; +print ''.$langs->trans("RefPayment").""; +print ''.$langs->trans("DatePayment").""; +print ''.$langs->trans("PayedByThisPayment").""; print "\n"; -$sql = "SELECT c.id, c.libelle as lib, s.rowid, s.libelle, s.fk_type as type, s.periode, s.date_ech,"; -$sql.= " count(s.rowid) as nb, sum(s.amount) as total, sum(pc.amount) as totalpaye"; +$sql = "SELECT c.id, c.libelle as lib,"; +$sql.= " s.rowid, s.libelle, s.fk_type as type, s.periode, s.date_ech, s.amount as total,"; +$sql.= " pc.rowid as pid, pc.datep, pc.amount as totalpaye"; $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c,"; $sql.= " ".MAIN_DB_PREFIX."chargesociales as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementcharge as pc ON pc.fk_charge = s.rowid"; @@ -109,14 +113,17 @@ if ($resql) if (empty($date)) $date=$obj->date_ech; print ''.dol_print_date($date,'day').''; print ''; - $socialcontrib=new ChargeSociales($db); $socialcontrib->id=$obj->rowid; $socialcontrib->lib=$obj->libelle; print $socialcontrib->getNomUrl(1,'20'); print ''; print ''.$obj->lib.''; print ''.price($obj->total).''; - print ''.$obj->nb.''; + + $payment_sc_static->id=$obj->pid; + $payment_sc_static->ref=$obj->pid; + print ''.$payment_sc_static->getNomUrl(1)."\n"; + print ''.dol_print_date($db->jdate($obj->datep),'day').''; print ''.price($obj->totalpaye).''; print ''; $total = $total + $obj->total; @@ -125,9 +132,10 @@ if ($resql) $i++; } print ''.$langs->trans("Total").''; - print ''.price($total).""; - print ''.$totalnb.''; - print ''.price($totalpaye).""; + print ''.price($total).""; + print ' '; + print ' '; + print ''.price($totalpaye).""; print ""; } else @@ -168,9 +176,10 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') print ''; print ''.$langs->trans("PeriodEndDate").''; print "".$langs->trans("Label").""; - print ''.$langs->trans("Amount").""; + print ''.$langs->trans("ExpectedToPay").""; + print ''.$langs->trans("RefPayment").""; print ''.$langs->trans("DatePayment").""; - print ''.$langs->trans("AlreadyPaid").""; + print ''.$langs->trans("PayedByThisPayment").""; print "\n"; $var=1; while ($i < $num) @@ -183,11 +192,14 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') print ""; print ''.dol_print_date($db->jdate($obj->dm),'day').' ? '."\n"; - $tva_static->id=$obj->rowid; - $tva_static->ref=$obj->label; - print "".$tva_static->getNomUrl(1)."\n"; + print "".$obj->label."\n"; + + print ''.price($obj->amount).""; + + $tva_static->id=$obj->rowid; + $tva_static->ref=$obj->rowid; + print ''.$tva_static->getNomUrl(1)."\n"; - print "".price($obj->amount).""; print ''.dol_print_date($db->jdate($obj->dm),'day')."\n"; print "".price($obj->amount).""; print "\n"; @@ -195,9 +207,10 @@ if (empty($_GET["mode"]) || $_GET["mode"] != 'sconly') $i++; } print ''.$langs->trans("Total").''; - print ''.price($total).""; - print ' '; - print ''.price($total).""; + print ''.price($total).""; + print ' '; + print ' '; + print ''.price($total).""; print ""; print ""; diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index fc25aa0e0a2..0d1af024f36 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo * Copyright (C) 2005-2009 Regis Houssin * diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 6825b2e357e..3953d99f250 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -322,7 +322,8 @@ if ($chid > 0) } print ""; - print ''; + $rowspan=5; + print ''; /* * Paiements @@ -399,6 +400,8 @@ if ($chid > 0) print ''.$langs->trans("Status").''.$cha->getLibStatut(4).''; + print ' '; + if ($_GET['action'] == 'edit') { print '';