Fix: affichage correct du nombre total de factures dans le résumé
This commit is contained in:
parent
da5bbd1dc9
commit
aeb020f192
@ -256,55 +256,50 @@ if ( $societe->fetch($socid) )
|
|||||||
/*
|
/*
|
||||||
* Liste des factures associées
|
* Liste des factures associées
|
||||||
*/
|
*/
|
||||||
$langs->load("bills");
|
$langs->load('bills');
|
||||||
|
$max=5;
|
||||||
$max=5;
|
$sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye';
|
||||||
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p';
|
||||||
$sql = "SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,".$db->pdate("p.datef")." as df, total_ttc as amount, paye";
|
$sql.= ' WHERE p.fk_soc = '.$societe->id;
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as p";
|
$sql.= ' ORDER BY p.datef DESC';
|
||||||
$sql.= " WHERE p.fk_soc = ".$societe->id;
|
$resql=$db->query($sql);
|
||||||
$sql.= " ORDER BY p.datef DESC";
|
if ($resql)
|
||||||
$sql.= " ".$db->plimit($max+1);
|
{
|
||||||
|
$i = 0 ;
|
||||||
$resql=$db->query($sql);
|
$num = $db->num_rows($resql);
|
||||||
if ($resql)
|
if ($num > 0)
|
||||||
{
|
{
|
||||||
$i = 0 ;
|
print '<table class="noborder" width="100%">';
|
||||||
$num = $db->num_rows($resql);
|
print '<tr class="liste_titre">';
|
||||||
if ($num > 0)
|
print '<td colspan="4">';
|
||||||
{
|
print '<table class="noborder" width="100%"><tr><td>'.$langs->trans('LastSuppliersBills',min($num,$max)).'</td><td align="right"><a href="facture/index.php?socid='.$societe->id.'">'.$langs->trans('AllBills').' ('.$num.')</td></tr></table>';
|
||||||
print '<table class="noborder" width="100%">';
|
print '</td></tr>';
|
||||||
print '<tr class="liste_titre">';
|
}
|
||||||
print "<td colspan=\"4\">";
|
$facturestatic = new FactureFournisseur($db);
|
||||||
print "<table class=\"noborder\" width=\"100%\"><tr><td>".$langs->trans("LastSuppliersBills",min($num,$max))."</td><td align=\"right\"><a href=\"facture/index.php?socid=$societe->id\">".$langs->trans("AllBills")." (".$num.")</td></tr></table>";
|
while ($i < min($num,$max))
|
||||||
print "</td></tr>";
|
{
|
||||||
}
|
$obj = $db->fetch_object($resql);
|
||||||
$facturestatic = new FactureFournisseur($db);
|
$var=!$var;
|
||||||
while ($i < min($num,$max))
|
print '<tr '.$bc[$var].'>';
|
||||||
{
|
print '<td>';
|
||||||
$obj = $db->fetch_object($resql);
|
print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
|
||||||
$var=!$var;
|
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.'</a> '.dolibarr_trunc($obj->libelle,14).'</td>';
|
||||||
|
print '<td align="right" width="80">'.dolibarr_print_date($obj->df).'</td>';
|
||||||
print "<tr $bc[$var]>";
|
print '<td align="right">'.price($obj->amount).'</td>';
|
||||||
print '<td>';
|
print '<td align="center">'.$facturestatic->LibStatutShort($obj->paye,$obj->fk_statut).'</td>';
|
||||||
print '<a href="facture/fiche.php?facid='.$obj->rowid.'">';
|
print '</tr>';
|
||||||
print img_object($langs->trans("ShowBill"),"bill")." ".$obj->facnumber.'</a> '.dolibarr_trunc($obj->libelle,14).'</td>';
|
$i++;
|
||||||
print '<td align="right" width="80">'.dolibarr_print_date($obj->df).'</td>';
|
}
|
||||||
print '<td align="right">'.price($obj->amount).'</td>';
|
$db->free($resql);
|
||||||
print '<td align="center">'.$facturestatic->LibStatutShort($obj->paye,$obj->fk_statut).'</td>';
|
if ($num > 0)
|
||||||
print "</tr>";
|
{
|
||||||
$i++;
|
print '</table><br>';
|
||||||
}
|
}
|
||||||
$db->free($resql);
|
}
|
||||||
if ($num > 0)
|
else
|
||||||
{
|
{
|
||||||
print "</table><br>";
|
dolibarr_print_error($db);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
dolibarr_print_error($db);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user