diff --git a/htdocs/adherents/cotisation.class.php b/htdocs/adherents/cotisation.class.php index 6949ddbd723..0234d9fcf9c 100644 --- a/htdocs/adherents/cotisation.class.php +++ b/htdocs/adherents/cotisation.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2002-2004 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -261,7 +261,8 @@ class Cotisation Function fetch($rowid) { $sql = "SELECT d.rowid, ".$this->db->pdate("d.datedon")." as datedon, d.prenom, d.nom, d.societe, d.amount, p.libelle as projet, d.fk_statut, d.adresse, d.cp, d.ville, d.pays, d.public, d.amount, d.fk_paiement, d.note, cp.libelle, d.email, d.fk_don_projet"; - $sql .= " FROM llx_don as d, llx_don_projet as p, c_paiement as cp"; + $sql .= " FROM ".MAIN_DB_PREFIX."don as d, ".MAIN_DB_PREFIX."don_projet as p, ".MAIN_DB_PREFIX."c_paiement as cp"; + $sql .= " WHERE p.rowid = d.fk_don_projet AND cp.id = d.fk_paiement AND d.rowid = $rowid"; if ( $this->db->query( $sql) ) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 1bf70c538d8..528b4ec0a47 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2001-2004 Rodolphe Quiedeville * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -44,7 +44,7 @@ if ($action == 'create') { $sql = "SELECT s.nom,s.idp, f.amount, f.total_ttc as total, f.facnumber"; - $sql .= " FROM llx_societe as s, llx_facture as f WHERE f.fk_soc = s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture as f WHERE f.fk_soc = s.idp"; $sql .= " AND f.rowid = $facid"; $result = $db->query($sql); @@ -69,7 +69,7 @@ if ($action == 'create') print 'Montant :'.price($obj->total).' euros TTC'; - $sql = "SELECT sum(p.amount) FROM llx_paiement as p WHERE p.fk_facture = $facid;"; + $sql = "SELECT sum(p.amount) FROM ".MAIN_DB_PREFIX."paiement as p WHERE p.fk_facture = $facid;"; $result = $db->query($sql); if ($result) { @@ -90,7 +90,7 @@ if ($action == 'create') print "Type :\n"; - $sql = "SELECT rowid, label FROM llx_bank_account ORDER BY rowid"; + $sql = "SELECT rowid, label FROM ".MAIN_DB_PREFIX."bank_account ORDER BY rowid"; $result = $db->query($sql); if ($result) @@ -161,7 +161,7 @@ if ($action == '') { $sql = "SELECT ".$db->pdate("p.datep")." as dp, p.amount, f.amount as fa_amount, f.facnumber"; $sql .=", f.rowid as facid, c.libelle as paiement_type, p.num_paiement"; - $sql .= " FROM llx_paiement as p, llx_facture as f, c_paiement as c"; + $sql .= " FROM ".MAIN_DB_PREFIX."paiement as p, ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."c_paiement as c"; $sql .= " WHERE p.fk_facture = f.rowid AND p.fk_paiement = c.id"; if ($socidp)