From 86d25e24b1cfa29140cf2a9bbd0a1d0efb13de45 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 16 Jan 2007 22:36:24 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20probl=E8me=20avec=20les=20factures=20r?= =?UTF-8?q?=E9curentes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/compta/facture/facture-rec.class.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php index 380e5c5bcb8..3656b2fde0b 100644 --- a/htdocs/compta/facture/facture-rec.class.php +++ b/htdocs/compta/facture/facture-rec.class.php @@ -151,9 +151,13 @@ class FactureRec extends Facture function fetch($rowid, $societe_id=0) { - $sql = "SELECT f.fk_soc,f.titre,f.amount,f.tva,f.total,f.total_ttc,f.remise,f.remise_percent,f.fk_projet, c.rowid as crid, c.libelle, c.libelle_facture, f.note, f.fk_user_author, f.fk_mode_reglement"; - $sql .= " FROM ".MAIN_DB_PREFIX."facture_rec as f, ".MAIN_DB_PREFIX."cond_reglement as c"; - $sql .= " WHERE f.rowid=$rowid AND c.rowid = f.fk_cond_reglement"; + $sql = "SELECT f.fk_soc, f.titre, f.amount, f.tva, f.total, f.total_ttc"; + $sql .= ", f.remise,f.remise_percent,f.fk_projet, c.rowid as crid, c.libelle"; + $sql .= ", c.libelle_facture, f.note, f.fk_user_author, f.fk_cond_reglement, f.fk_mode_reglement"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture_rec as f"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."cond_reglement as c ON f.fk_cond_reglement = c.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as p ON f.fk_mode_reglement = p.id"; + $sql .= " WHERE f.rowid=".$rowid; if ($societe_id > 0) {