Ajout numéro facture dans liste rappel des factures à payer.

Ajout total reste à payer pour les factures fournisseurs sur le même modèle que le total reste à encaisser des factures clients.
This commit is contained in:
Laurent Destailleur 2004-04-04 12:25:19 +00:00
parent 6d55830683
commit 453269e63b

View File

@ -231,6 +231,7 @@ if ($user->comm > 0 && $conf->commercial )
/* /*
* Factures impayées * Factures impayées
*
*/ */
$sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total_ttc, sum(pf.amount) as am"; $sql = "SELECT f.facnumber, f.rowid, s.nom, s.idp, f.total_ttc, sum(pf.amount) as am";
@ -247,9 +248,9 @@ if ( $db->query($sql) )
if ($num) if ($num)
{ {
print '<table class="noborder" cellspacing="0" cellpadding="3" width="100%">'; print '<table class="noborder" cellspacing="0" cellpadding="3" width="100%">';
print '<tr class="liste_titre"><td colspan="3">Factures impayées</td><td>Reçu</td></tr>'; print '<tr class="liste_titre"><td colspan="2">Factures impayées</td><td align="right">Montant TTC</td><td align="right">Reçu</td></tr>';
$var = True; $var = True;
$total = 0; $total = $totalam = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
@ -297,11 +298,6 @@ else
{ {
print $db->error(); print $db->error();
} }
/*
*
*
*/
/* /*
* Factures a payer * Factures a payer
@ -309,7 +305,7 @@ else
*/ */
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
$sql = "SELECT ff.total_ttc as amount, ff.libelle, ff.rowid"; $sql = "SELECT ff.rowid, ff.facnumber, ff.libelle, ff.total_ttc as amount";
$sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
$sql .= " WHERE ff.paye=0"; $sql .= " WHERE ff.paye=0";
@ -319,21 +315,26 @@ if ($user->societe_id == 0)
if ($num) if ($num)
{ {
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">'; print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
print '<tr class="liste_titre"><td colspan="2">Factures à payer</td>'; print '<tr class="liste_titre"><td colspan="2">Factures à payer</td><td align="right">Montant TTC</td></tr>';
print "</tr>\n"; print "</tr>\n";
$i = 0; $i = 0;
$var = True; $var = True;
$total = $totalam = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object( $i); $obj = $db->fetch_object( $i);
$var = !$var; $var = !$var;
print "<tr $bc[$var]>"; print '<tr '.$bc[$var].'><td width="20%"><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$obj->rowid.'">'.img_file().'</a>';
print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$obj->rowid.'">'.img_file().'</a>&nbsp;'; print '&nbsp;<a href="'.DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$obj->rowid.'">'.$obj->facnumber.'</a></td>';
print '<a href="../fourn/facture/fiche.php?facid='.$obj->rowid.'">'.$obj->libelle.'</a></td>'; print '<td><a href="../fourn/facture/fiche.php?facid='.$obj->rowid.'">'.$obj->libelle.'</a></td>';
print '<td align="right">'.price($obj->amount).'</td>'; print '<td align="right">'.price($obj->amount).'</td>';
print '</tr>'; print '</tr>';
$total += $obj->total_ttc;
$totalam += $obj->am;
$i++; $i++;
} }
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="2" align="left">Reste à payer : '.price($total-$totalam).'</td><td align="right">'.price($total).'</td></tr>';
print '</table><br>'; print '</table><br>';
} }
} }