BF [ 1679765 ] On posting invoice, M_Product_PO.PriceLastInv is not updated
This commit is contained in:
parent
f51ccf2c8d
commit
e4b692e8cf
|
@ -875,14 +875,16 @@ public class Doc_Invoice extends Doc
|
||||||
//jz + " AND ROWNUM=1 AND i.C_Invoice_ID=").append(get_ID()).append(") ")
|
//jz + " AND ROWNUM=1 AND i.C_Invoice_ID=").append(get_ID()).append(") ")
|
||||||
if (DB.isOracle()) //jz
|
if (DB.isOracle()) //jz
|
||||||
{
|
{
|
||||||
sql.append(" AND ROWNUM=1) ");
|
sql.append(" AND ROWNUM=1 ");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
sql.append(" AND i.UPDATED IN (SELECT MAX(i1.UPDATED) "
|
sql.append(" AND i.UPDATED IN (SELECT MAX(i1.UPDATED) "
|
||||||
+ "FROM C_Invoice i1, C_InvoiceLine il1 "
|
+ "FROM C_Invoice i1, C_InvoiceLine il1 "
|
||||||
+ "WHERE i1.C_Invoice_ID=il1.C_Invoice_ID"
|
+ "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")
|
+ " 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(") ");
|
.append(" AND i1.C_Invoice_ID=").append(get_ID()).append(") ");
|
||||||
|
}
|
||||||
sql.append(" AND i.C_Invoice_ID=").append(get_ID()).append(") ")
|
sql.append(" AND i.C_Invoice_ID=").append(get_ID()).append(") ")
|
||||||
// update
|
// update
|
||||||
.append("WHERE EXISTS (SELECT * "
|
.append("WHERE EXISTS (SELECT * "
|
||||||
|
|
Loading…
Reference in New Issue