N'inclue que les comptes rapprochables dans le comptage des critures rapprocher
This commit is contained in:
parent
bc90e10577
commit
d8a09e992a
@ -496,8 +496,9 @@ class Account
|
|||||||
|
|
||||||
$this->nbtodo=$this->nbtodolate=0;
|
$this->nbtodo=$this->nbtodolate=0;
|
||||||
$sql = "SELECT b.rowid,".$this->db->pdate("b.datev")." as datefin";
|
$sql = "SELECT b.rowid,".$this->db->pdate("b.datev")." as datefin";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
|
$sql.= " FROM ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba";
|
||||||
$sql.= " WHERE b.rappro=0";
|
$sql.= " WHERE b.rappro=0 AND b.fk_account = ba.rowid";
|
||||||
|
$sql.= " AND ba.rappro = 1";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -307,7 +307,14 @@ if ($account > 0)
|
|||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
_print_lines($db, $result, $sql, $acct);
|
$total = _print_lines($db, $result, $sql, $acct);
|
||||||
|
if ($page == 0)
|
||||||
|
{
|
||||||
|
print '<tr class="liste_total"><td align="right" colspan="6">'.$langs->trans("Balance").'</td>';
|
||||||
|
print '<td align="right" nowrap>'.price($total).'</td>';
|
||||||
|
print '<td> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
}
|
||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -348,13 +355,21 @@ $db->close();
|
|||||||
llxFooter('$Date$ - $Revision$');
|
llxFooter('$Date$ - $Revision$');
|
||||||
|
|
||||||
|
|
||||||
/*
|
/**
|
||||||
*
|
* \brief Affiche ligne ecriture
|
||||||
|
* \param db Handler d'accès base
|
||||||
|
* \param result Resultset du select
|
||||||
|
* \param sql Requete sql
|
||||||
|
* \param acct Compte
|
||||||
|
* \return Renvoi total solde
|
||||||
*/
|
*/
|
||||||
function _print_lines($db,$result,$sql,$acct)
|
function _print_lines($db,$result,$sql,$acct)
|
||||||
{
|
{
|
||||||
global $bc, $nbline, $viewline, $user, $page;
|
global $bc, $nbline, $viewline, $user, $page;
|
||||||
$var=True;
|
|
||||||
|
$var=true;
|
||||||
|
$total=0;
|
||||||
|
|
||||||
$num = $db->num_rows($result);
|
$num = $db->num_rows($result);
|
||||||
$i = 0; $total = 0; $sep = 0;
|
$i = 0; $total = 0; $sep = 0;
|
||||||
|
|
||||||
@ -381,6 +396,7 @@ function _print_lines($db,$result,$sql,$acct)
|
|||||||
print "<td nowrap> ".dolibarr_print_date($objp->dv,"%d/%m/%y")."</td>\n";
|
print "<td nowrap> ".dolibarr_print_date($objp->dv,"%d/%m/%y")."</td>\n";
|
||||||
print "<td nowrap> ".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
print "<td nowrap> ".$objp->fk_type." ".($objp->num_chq?$objp->num_chq:"")."</td>\n";
|
||||||
print "<td><a href=\"ligne.php?rowid=$objp->rowid&account=$acct->id\">$objp->label</a>";
|
print "<td><a href=\"ligne.php?rowid=$objp->rowid&account=$acct->id\">$objp->label</a>";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Ajout les liens
|
* Ajout les liens
|
||||||
*/
|
*/
|
||||||
@ -451,5 +467,6 @@ function _print_lines($db,$result,$sql,$acct)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $total;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user