BF [ 1679765 ] On posting invoice, M_Product_PO.PriceLastInv is not updated

This commit is contained in:
teo_sarca 2007-03-13 12:52:21 +00:00
parent f51ccf2c8d
commit e4b692e8cf
1 changed files with 3 additions and 1 deletions

View File

@ -875,14 +875,16 @@ public class Doc_Invoice extends Doc
//jz + " AND ROWNUM=1 AND i.C_Invoice_ID=").append(get_ID()).append(") ")
if (DB.isOracle()) //jz
{
sql.append(" AND ROWNUM=1) ");
sql.append(" AND ROWNUM=1 ");
}
else
{
sql.append(" AND i.UPDATED IN (SELECT MAX(i1.UPDATED) "
+ "FROM C_Invoice i1, C_InvoiceLine il1 "
+ "WHERE i1.C_Invoice_ID=il1.C_Invoice_ID"
+ " AND po.M_Product_ID=il1.M_Product_ID AND po.C_BPartner_ID=i1.C_BPartner_ID")
.append(" AND i1.C_Invoice_ID=").append(get_ID()).append(") ");
}
sql.append(" AND i.C_Invoice_ID=").append(get_ID()).append(") ")
// update
.append("WHERE EXISTS (SELECT * "