Fix: [ bug #1163 ] SQL Error when searching for supplier orders

This commit is contained in:
Laurent Destailleur 2013-12-01 16:18:18 +01:00
parent 8d1e10cd76
commit 395066519b
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
-------------------------------------------------------------- --------------------------------------------------------------
English Dolibarr ChangeLog English Dolibarr ChangeLog
-------------------------------------------------------------- --------------------------------------------------------------
***** ChangeLog for 3.4.2 compared to 3.4.1 ***** ***** ChangeLog for 3.4.2 compared to 3.4.1 *****
Fix: field's problem into company's page (RIB) Fix: field's problem into company's page (RIB)
Fix: Document cerfa doesn't contained firstname & lastname from donator Fix: Document cerfa doesn't contained firstname & lastname from donator
@ -12,6 +13,7 @@ Fix: [ bug #1142 ] Set paiement on invoice (PGSql)
Fix: [ bug #1145 ] Agenda button list type do not display Fix: [ bug #1145 ] Agenda button list type do not display
Fix: [ bug #1148 ] Product consomation : supplier order bad status Fix: [ bug #1148 ] Product consomation : supplier order bad status
Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists Fix: [ bug #1159 ] Commercial search "other" give p.note do not exists
Fix: [ bug #1163 ] SQL Error when searching for supplier orders
***** ChangeLog for 3.4.1 compared to 3.4.0 ***** ***** ChangeLog for 3.4.1 compared to 3.4.0 *****
Fix: Display buying price on line edit when no supplier price is defined Fix: Display buying price on line edit when no supplier price is defined

View File

@ -105,16 +105,17 @@ if ($sttc)
} }
if ($sall) if ($sall)
{ {
$sql.= " AND (cf.ref LIKE '%".$db->escape($sall)."%' OR cf.note LIKE '%".$db->escape($sall)."%')"; $sql.= " AND (cf.ref LIKE '%".$db->escape($sall)."%' OR cf.note_private LIKE '%".$db->escape($sall)."%' OR cf.note_public LIKE '%".$db->escape($sall)."%')";
} }
if ($socid) $sql.= " AND s.rowid = ".$socid; if ($socid) $sql.= " AND s.rowid = ".$socid;
if (GETPOST('statut')) if (GETPOST('statut'))
{ {
$sql .= " AND fk_statut =".GETPOST('statut'); $sql .= " AND fk_statut =".GETPOST('statut','int');
} }
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $sql.= " ORDER BY $sortfield $sortorder ";
$sql.= $db->plimit($conf->liste_limit+1, $offset);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)