Skip to content

Commit

Permalink
Merge pull request #5430 from atm-arnaud/fix_4455
Browse files Browse the repository at this point in the history
FIX #4455
  • Loading branch information
eldy committed Jun 30, 2016
2 parents b09c653 + 38dcb0d commit 578a585
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions htdocs/fourn/card.php
Expand Up @@ -407,6 +407,18 @@
}

// TODO move to DAO class
$sql = "SELECT count(p.rowid) as total";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
$sql.= " WHERE p.fk_soc =".$object->id;
$sql.= " AND p.entity =".$conf->entity;
$sql.= " ORDER BY p.date_commande DESC";
$resql=$db->query($sql);
if ($resql)
{
$object_count = $db->fetch_object($resql);
$num = $object_count->total;
}

$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut, p.total_ht, p.tva as total_tva, p.total_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
$sql.= " WHERE p.fk_soc =".$object->id;
Expand All @@ -417,7 +429,6 @@
if ($resql)
{
$i = 0 ;
$num = $db->num_rows($resql);

if ($num > 0)
{
Expand All @@ -433,7 +444,7 @@
}

$var = True;
while ($i < $num && $i <= $MAXLIST)
while ($i < $num && $i < $MAXLIST)
{
$obj = $db->fetch_object($resql);
$var=!$var;
Expand Down

0 comments on commit 578a585

Please sign in to comment.