diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 1d7d5140f48..d28e3f46bfb 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -130,7 +130,7 @@ $result = $db->query($sql); if ($result) { $var=True; - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; $options = ""; while ($i < $num) @@ -139,16 +139,16 @@ if ($result) $options .= "\n"; $i++; } - $db->free(); + $db->free($result); } + print_titre("Edition de l'écriture bancaire"); if ($_GET["action"] == 'delete_categ') { - $html = new Form($db); $html->form_confirm("ligne.php?rowid=".$_GET["rowid"]."&cat1=".$_GET["fk_categ"],"Supprimer dans la catégorie","Etes-vous sûr de vouloir supprimer le classement dans la catégorie ?","confirm_delete_categ"); } @@ -156,14 +156,15 @@ $var=False; print ''; -$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro, b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, fk_account"; -$sql .= " FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=$rowid"; -$sql .= " ORDER BY dateo ASC"; +$sql = "SELECT b.rowid,".$db->pdate("b.dateo")." as do,".$db->pdate("b.datev")." as dv, b.amount, b.label, b.rappro,"; +$sql.= " b.num_releve, b.fk_user_author, b.num_chq, b.fk_type, fk_account"; +$sql.= " FROM ".MAIN_DB_PREFIX."bank as b WHERE rowid=$rowid"; +$sql.= " ORDER BY dateo ASC"; $result = $db->query($sql); if ($result) { $i = 0; $total = 0; - if ($db->num_rows()) + if ($db->num_rows($result)) { $objp = $db->fetch_object($result); $total = $total + $objp->amount; @@ -199,7 +200,7 @@ if ($result) // Description print ""; print ""; @@ -217,13 +218,7 @@ if ($result) print "
".$langs->trans("Label").""; - print ''; + print ''; print "  trans("Update")."\">
".$langs->trans("Type").""; print "
rowid\">"; print ''; - print '"; + print $html->select_types_paiements($objp->fk_type,"value"); print ''; print "  trans("Update")."\">"; print "
"; @@ -246,7 +241,7 @@ if ($result) $i++; } - $db->free(); + $db->free($result); } print "
"; @@ -260,7 +255,7 @@ print ''; print ""; print ""; print "'; print ""; @@ -273,7 +268,7 @@ $result = $db->query($sql); if ($result) { $var=True; - $num = $db->num_rows(); + $num = $db->num_rows($result); $i = 0; $total = 0; while ($i < $num) { @@ -289,12 +284,12 @@ if ($result) $i++; } - $db->free(); + $db->free($result); } print "
".$langs->trans("Categories").""; -print "$options"; print " "; print '
"; $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?>