FIX We must take the last recent defined price when using price level

This commit is contained in:
Laurent Destailleur 2016-07-11 11:34:11 +02:00
parent 47d7ac8031
commit 0367cee671

View File

@ -1896,8 +1896,8 @@ class Form
$sql.= " WHERE fk_product='".$objp->rowid."'";
$sql.= " AND entity IN (".getEntity('productprice', 1).")";
$sql.= " AND price_level=".$price_level;
$sql.= " ORDER BY date_price, rowid";
$sql.= " DESC LIMIT 1";
$sql.= " ORDER BY date_price DESC, rowid DESC";
$sql.= " LIMIT 1";
dol_syslog(get_class($this).'::constructProductListOption search price for level '.$price_level.'', LOG_DEBUG);
$result2 = $this->db->query($sql);