diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 423092fa032..af31af6becd 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -1,9 +1,9 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2009 Laurent Destailleur + * Copyright (C) 2004-2010 Laurent Destailleur * Copytight (C) 2004 Christophe Combelles - * Copytight (C) 2005-2009 Regis Houssin + * Copytight (C) 2005-2010 Regis Houssin * * 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 @@ -29,12 +29,12 @@ require("./pre.inc.php"); // We use pre.inc.php to have a dynamic menu require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/societe/societe.class.php"); -require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/chargesociales.class.php"); -require_once(DOL_DOCUMENT_ROOT."/paiement.class.php"); -require_once(DOL_DOCUMENT_ROOT."/compta/tva/tva.class.php"); -require_once(DOL_DOCUMENT_ROOT."/fourn/facture/paiementfourn.class.php"); +require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); +require_once(DOL_DOCUMENT_ROOT."/adherents/class/adherent.class.php"); +require_once(DOL_DOCUMENT_ROOT."/compta/sociales/class/chargesociales.class.php"); +require_once(DOL_DOCUMENT_ROOT."/compta/paiement/class/paiement.class.php"); +require_once(DOL_DOCUMENT_ROOT."/compta/tva/class/tva.class.php"); +require_once(DOL_DOCUMENT_ROOT."/fourn/class/paiementfourn.class.php"); $langs->load("bills"); @@ -290,6 +290,8 @@ if ($account || $_GET["ref"]) /** * Search form */ + $param.='&account='.$acct->id; + // Define transaction list navigation string $navig=''; @@ -297,7 +299,7 @@ if ($account || $_GET["ref"]) $nbpage=floor($total_lines/$viewline)+($total_lines % $viewline > 0?1:0); // Nombre de page total if ($limitsql > $viewline) { - $navig.=''.img_previous().''; + $navig.=''.img_previous().''; } $navig.= ' Page '; $navig.=''; @@ -311,7 +313,7 @@ if ($account || $_GET["ref"]) $navig.='/'.$nbpage.' '; if ($total_lines > $limitsql ) { - $navig.= ''.img_next().''; + $navig.= ''.img_next().''; } $navig.=''; @@ -344,13 +346,14 @@ if ($account || $_GET["ref"]) print ''; print ''; - print ''.$langs->trans("AddBankRecordLong").''; + print ''.$langs->trans("AddBankRecordLong").''; print ''; print ''; print ''.$langs->trans("Date").''; print ' '; print ''.$langs->trans("Type").''; + print ''.$langs->trans("Numero").''; print ''.$langs->trans("Description").''; print ''.$langs->trans("Debit").''; print ''.$langs->trans("Credit").''; @@ -363,9 +366,10 @@ if ($account || $_GET["ref"]) print ''; print ''; $html->select_types_paiements((isset($_POST["operation"])?$_POST["operation"]:''),'operation','1,2',2,1); + print ''; print ''; print ''; - print ''; + print ''; if ($nbcategories) { print '
'.$langs->trans("Category").': '; @@ -403,7 +407,7 @@ if ($account || $_GET["ref"]) else print ' '; print ''; - print '
'; + print ''; print ''; print ''; print ''; @@ -461,7 +465,7 @@ if ($account || $_GET["ref"]) $sql.= " AND b.fk_account = ba.rowid"; $sql.= " AND ba.entity = ".$conf->entity; $sql.= $sql_rech; - $sql.= $db->order("b.datev", "ASC"); + $sql.= $db->order("b.datev, b.datec", "ASC"); // We add date of creation to have correct order when everything is done the same day $sql.= $db->plimit($limitsql, 0); dol_syslog("account.php get transactions - sql=".$sql); @@ -469,7 +473,12 @@ if ($account || $_GET["ref"]) if ($result) { $total = 0; - $time = dol_now('tzserver'); + + $now=dol_now('tzserver'); + $nows=dol_date('Ymd',$now); + + //$html->load_cache_types_paiements(); + //$html->cache_types_paiements $var=true; @@ -485,10 +494,12 @@ if ($account || $_GET["ref"]) $var=!$var; // Is it a transaction in future ? - if ($db->jdate($objp->do) > $time && !$sep) // Yes, we show a subtotal + $dos=dol_date('Ymd',$db->jdate($objp->do)); + //print "dos=".$dos." nows=".$nows; + if ($dos > $nows && !$sep) // Yes, we show a subtotal { $sep = 1 ; - print ''; + print ''; print $langs->trans("CurrentBalance"); print ''; print "".price($total - $objp->amount).""; @@ -502,7 +513,12 @@ if ($account || $_GET["ref"]) print "".dol_print_date($db->jdate($objp->dv),"day")."\n"; - print "".$langs->trans($objp->fk_type)."\n"; + // Payment type + print ""; + $label=($langs->trans("PaymentTypeShort".$objp->fk_type)!="PaymentTypeShort".$objp->fk_type)?$langs->trans("PaymentTypeShort".$objp->fk_type):$objp->fk_type; + if ($objp->fk_type == 'SOLD') $label=' '; + print $label; + print "\n"; print ''.($objp->num_chq?$objp->num_chq:"")."\n"; // Description @@ -565,11 +581,11 @@ if ($account || $_GET["ref"]) { // Label generique car entre parentheses. On l'affiche en le traduisant if ($reg[1]=='paiement') $reg[1]='Payment'; - print $langs->trans($reg[1]); + print ' '.$langs->trans($reg[1]); } else { - print $links[$key]['label']; + print ' '.$links[$key]['label']; } print ''; } @@ -680,7 +696,7 @@ if ($account || $_GET["ref"]) // Show total if ($page == 0 && ! $mode_search) { - print ''; + print ''; if ($sep) print ' '; else print $langs->trans("CurrentBalance"); print '';