bugfix : mauvais appel en base
This commit is contained in:
parent
cfb5481df0
commit
c6cac72362
@ -120,11 +120,13 @@ if ($_GET["id"] > 0) {
|
|||||||
/*
|
/*
|
||||||
* Commande
|
* Commande
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
$sql = 'SELECT s.nom, s.idp, c.amount_ht, c.fk_projet, c.remise, c.tva, c.total_ttc, c.ref, c.fk_statut, '.$db->pdate('c.date_commande').' as dp, c.note,';
|
$sql = 'SELECT s.nom, s.idp, c.amount_ht, c.fk_projet, c.remise, c.tva, c.total_ttc, c.ref, c.fk_statut, '.$db->pdate('c.date_commande').' as dp, c.note,';
|
||||||
$sql.= ' x.firstname, x.name, x.fax, x.phone, x.email, c.fk_user_author, c.fk_user_valid, c.fk_user_cloture, c.date_creation, c.date_valid, c.date_cloture';
|
$sql.= ' x.firstname, x.name, x.fax, x.phone, x.email, c.fk_user_author, c.fk_user_valid, c.fk_user_cloture, c.date_creation, c.date_valid, c.date_cloture';
|
||||||
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'commande as c, '.MAIN_DB_PREFIX.'socpeople as x';
|
$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'commande as c, '.MAIN_DB_PREFIX.'socpeople as x';
|
||||||
$sql.= ' WHERE c.fk_soc = s.idp AND c.fk_soc_contact = x.idp AND c.rowid = '.$commande->id;
|
$sql.= ' WHERE c.fk_soc = s.idp';
|
||||||
|
//$sql.= ' AND c.fk_soc_contact = x.idp'; //le champs fk_soc_contact est vide dans la base llx_commande
|
||||||
|
$sql.= ' AND c.rowid = '.$commande->id;
|
||||||
if ($socidp) $sql .= ' AND s.idp = '.$socidp;
|
if ($socidp) $sql .= ' AND s.idp = '.$socidp;
|
||||||
|
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
@ -135,7 +137,7 @@ if ($_GET["id"] > 0) {
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
if ($db->num_rows($result)) {
|
if ($db->num_rows($result)) {
|
||||||
$obj = $db->fetch_object($result);
|
$obj = $db->fetch_object($result);
|
||||||
*/
|
|
||||||
$societe = new Societe($db);
|
$societe = new Societe($db);
|
||||||
$societe->fetch($obj->idp);
|
$societe->fetch($obj->idp);
|
||||||
|
|
||||||
@ -289,10 +291,10 @@ if ($_GET["id"] > 0) {
|
|||||||
print '<td align="right" colspan="2"><b>'.price($commande->price).'</b></td>';
|
print '<td align="right" colspan="2"><b>'.price($commande->price).'</b></td>';
|
||||||
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
print '<td>'.$langs->trans("Currency".$conf->monnaie).'</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
/* }
|
}
|
||||||
} else {
|
} else {
|
||||||
dolibarr_print_error($db);
|
dolibarr_print_error($db);
|
||||||
}*/
|
}
|
||||||
} else {
|
} else {
|
||||||
// Commande non trouvée
|
// Commande non trouvée
|
||||||
print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
|
print $langs->trans("ErrorPropalNotFound",$_GET["id"]);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user