From 4c8695b62c40166cff6f1dd59fdbc6adf3d90b44 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 4 Jul 2008 10:52:21 +0000 Subject: [PATCH] Fix: Error management. Payment date is not preselected to avoid errors. --- htdocs/compta/paiement/avalider.php | 9 +++------ htdocs/compta/paiement/liste.php | 18 +++++++++--------- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/paiement/avalider.php b/htdocs/compta/paiement/avalider.php index 8d05d43bf21..825a34993b9 100644 --- a/htdocs/compta/paiement/avalider.php +++ b/htdocs/compta/paiement/avalider.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * * 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 @@ -15,16 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/compta/paiement/avalider.php \ingroup compta \brief Page liste des paiements a valider des factures clients - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -99,7 +96,7 @@ if ($resql) $var=!$var; print ""; print ''.''.img_object($langs->trans("ShowPayment"),"payment").' '.$objp->rowid.''; - print ''.dolibarr_print_date($objp->dp)."\n"; + print ''.dolibarr_print_date($objp->dp,'day')."\n"; print "$objp->paiement_type $objp->num_paiement\n"; print ''.price($objp->amount).''; print ''; diff --git a/htdocs/compta/paiement/liste.php b/htdocs/compta/paiement/liste.php index 2ccf7f42521..6b349f2bf55 100644 --- a/htdocs/compta/paiement/liste.php +++ b/htdocs/compta/paiement/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2007 Laurent Destailleur + * Copyright (C) 2004-2008 Laurent Destailleur * * 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 @@ -15,16 +15,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * $Id$ - * $Source$ */ /** \file htdocs/compta/paiement/liste.php \ingroup compta \brief Page liste des paiements des factures clients - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -65,6 +62,7 @@ $sql.= " p.statut, p.num_paiement,"; $sql.= " c.code as paiement_code,"; $sql.= " ba.rowid as bid, ba.label,"; $sql.= " s.rowid as socid, s.nom"; +//$sql.= " f.facnumber"; $sql.= " FROM ".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank_account as ba ON b.fk_account = ba.rowid"; @@ -89,7 +87,7 @@ if ($_GET["search_montant"]) $sql .=" AND p.amount=".price2num($_GET["search_montant"]); } -if ($_GET["orphelins"]) // Option qui ne sert qu'au debogage +if ($_GET["orphelins"]) // Option for debugging purpose only { // Paiements liés à aucune facture (pour aide au diagnostic) $sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, p.amount,"; @@ -103,8 +101,9 @@ if ($_GET["orphelins"]) // Option qui ne sert qu'au debogage $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid"; $sql.= " WHERE p.fk_paiement = c.id AND pf.rowid IS NULL"; } -$sql .= " ORDER BY $sortfield $sortorder"; -$sql .= $db->plimit( $limit+1 ,$offset); +$sql.= " ORDER BY ".$sortfield." ".$sortorder; +//$sql.= ", facnumber ASC"; +$sql.= $db->plimit( $limit+1 ,$offset); //print "$sql"; $resql = $db->query($sql); @@ -122,10 +121,11 @@ if ($resql) print ''; print_liste_field_titre($langs->trans("Ref"),"liste.php","p.rowid","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Date"),"liste.php","dp","",$paramlist,'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("ThirdParty"),"liste.php","c.libelle","",$paramlist,"",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("ThirdParty"),"liste.php","c.nom","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Type"),"liste.php","c.libelle","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Account"),"liste.php","ba.label","",$paramlist,"",$sortfield,$sortorder); print_liste_field_titre($langs->trans("AmountTTC"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield,$sortorder); + //print_liste_field_titre($langs->trans("Invoices"),"","","",$paramlist,'align="left"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),"liste.php","p.statut","",$paramlist,'align="right"',$sortfield,$sortorder); print "\n";