';
+print '';
+
+print '| ';
$sql = "SELECT count(b.rowid)";
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
@@ -67,12 +75,12 @@ print " | \n";
if ($resql)
{
- $var=true;
+ $var=false;
if ($row = $db->fetch_row($resql) )
{
$num = $row[0];
}
- print "";
+ print " ";
print '| '.$langs->trans("BankChecksToReceipt").' | ';
print ''.$num.' | ';
print " \n";
@@ -82,8 +90,9 @@ else
dolibarr_print_error($db);
}
-print " | \n";
-print '';
+
+print ' | ';
+
$sql = "SELECT bc.rowid,".$db->pdate("bc.date_bordereau")." as db, bc.amount,bc.number,";
$sql.= " bc.statut, ba.label, ba.rowid as bid";
@@ -96,35 +105,41 @@ $resql = $db->query($sql);
if ($resql)
{
- print '';
- print '| '.$langs->trans("Date")." | ";
- print ''.$langs->trans("Numero").' | ';
- print ''.$langs->trans("Account").' | ';
- print ''.$langs->trans("Amount").' | ';
- print " \n";
-
- $var=true;
- while ( $objp = $db->fetch_object($resql) )
- {
- $var=!$var;
- print "\n";
- print '';
- print ' ';
- print dolibarr_print_date($objp->db,'%d/%m').' | ';
- if ($objp->statut == 1)
+ print '';
+ print '| '.$langs->trans("Date")." | ";
+ print ''.$langs->trans("Numero").' | ';
+ print ''.$langs->trans("Account").' | ';
+ print ''.$langs->trans("Amount").' | ';
+ print ''.$langs->trans("Status").' | ';
+ print " \n";
+
+ $var=true;
+ while ( $objp = $db->fetch_object($resql) )
{
- print ''.$objp->number.' | ';
+ $checkdepositstatic->statut=$objp->statut;
+ $checkdepositstatic->rowid=$objp->rowid;
+ $checkdepositstatic->number=$objp->number;
+
+ $accountstatic->id=$objp->bid;
+ $accountstatic->label=$objp->label;
+
+ $var=!$var;
+ print "\n";
+
+ print '| '.dolibarr_print_date($objp->db,'day').' | ';
+
+ print ''.$checkdepositstatic->getNomUrl(1).' | ';
+
+ print ''.$accountstatic->getNomUrl(1).' | ';
+
+ print ''.price($objp->amount).' | ';
+
+ print ''.$checkdepositstatic->LibStatut($objp->statut,3).' | ';
+
+ print ' ';
}
- else
- {
- print '(PROV'.$objp->rowid.') | ';
- }
- print ''.img_object($langs->trans("ShowAccount"),'account').' '.$objp->label.'';
- print ' | ';
- print ''.price($objp->amount).' | ';
- }
- print " ";
- $db->free($resql);
+ print " ";
+ $db->free($resql);
}
else
{
diff --git a/htdocs/compta/paiement/cheque/liste.php b/htdocs/compta/paiement/cheque/liste.php
index 6c4209e580b..ae86661290d 100644
--- a/htdocs/compta/paiement/cheque/liste.php
+++ b/htdocs/compta/paiement/cheque/liste.php
@@ -1,5 +1,6 @@
+ * Copyright (C) 2007 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
@@ -27,6 +28,8 @@
*/
require("./pre.inc.php");
+require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/remisecheque.class.php');
+require_once(DOL_DOCUMENT_ROOT.'/compta/bank/account.class.php');
$langs->load("bills");
@@ -43,13 +46,6 @@ if ($user->societe_id > 0)
$socid = $user->societe_id;
}
-
-/*
- * Affichage
- */
-
-llxHeader('',$langs->trans("CheckReceipt"));
-
$page=$_GET["page"];
$sortorder=$_GET["sortorder"];
$sortfield=$_GET["sortfield"];
@@ -58,18 +54,26 @@ $limit = $conf->liste_limit;
$offset = $limit * $page ;
if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="bc.rowid";
-
+
+$checkdepositstatic=new RemiseCheque($db);
+$accountstatic=new Account($db);
+
+
+/*
+ * Affichage
+ */
+
+llxHeader('',$langs->trans("CheckReceipt"));
+
$sql = "SELECT bc.rowid, bc.number, ".$db->pdate("bc.date_bordereau") ." as dp, bc.amount, bc.statut,";
$sql.= " ba.rowid as bid, ba.label";
$sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc";
$sql.= ",".MAIN_DB_PREFIX."bank_account as ba";
$sql.= " WHERE bc.fk_bank_account = ba.rowid";
-
if ($_GET["search_montant"])
{
$sql .=" AND p.amount=".price2num($_GET["search_montant"]);
}
-
$sql .= " ORDER BY $sortfield $sortorder";
$sql .= $db->plimit( $limit+1 ,$offset);
//print "$sql";
@@ -90,7 +94,7 @@ if ($resql)
print_liste_field_titre($langs->trans("Date"),"liste.php","dp","",$paramlist,'align="center"',$sortfield);
print_liste_field_titre($langs->trans("Account"),"liste.php","ba.label","",$paramlist,"",$sortfield);
print_liste_field_titre($langs->trans("Amount"),"liste.php","p.amount","",$paramlist,'align="right"',$sortfield);
- print_liste_field_titre($langs->trans("Status"),"liste.php","p.statut","",$paramlist,'align="center"',$sortfield);
+ print_liste_field_titre($langs->trans("Status"),"liste.php","p.statut","",$paramlist,'align="right"',$sortfield);
print " |
\n";
// Lignes des champs de filtre
@@ -109,26 +113,34 @@ if ($resql)
$objp = $db->fetch_object($resql);
$var=!$var;
print "