Fix: la deuxime requete crasait la premiere au lieu de s'unire

This commit is contained in:
Regis Houssin 2007-12-04 21:30:35 +00:00
parent f6c21b9250
commit 0fe4408ce5
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2007 Destailleur Laurent <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2006 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
*
* 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

View File

@ -1523,7 +1523,7 @@ class Propal extends CommonObject
$sql.= " WHERE fp.fk_facture = f.rowid AND fp.fk_propal = ".$id;
$sql.= " UNION ";
// Cas des factures lier via la commande
$sql = "SELECT f.rowid, f.facnumber";
$sql.= "SELECT f.rowid, f.facnumber";
$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql.= ", ".MAIN_DB_PREFIX."co_pr as cp, ".MAIN_DB_PREFIX."co_fa as cf";
$sql.= " WHERE cp.fk_propale = ".$id." AND cf.fk_commande = cp.fk_commande AND cf.fk_facture = f.rowid";