[ 1723106 ] DunningEntry Amt not updated correctly

http://sourceforge.net/tracker/index.php?func=detail&aid=1723106&group_id=176962&atid=879332

NOTE: got sql exception when deleting the last dunning run line
This commit is contained in:
teo_sarca 2007-05-22 08:44:43 +00:00
parent a9b3f4929b
commit 98b7b3791a
1 changed files with 2 additions and 2 deletions

View File

@ -326,9 +326,9 @@ public class MDunningRunLine extends X_C_DunningRunLine
{
// we do not count the fee line as an item, but it sum it up.
String sql = "UPDATE C_DunningRunEntry e "
+ "SET Amt=(SELECT SUM(ConvertedAmt)+SUM(FeeAmt)+SUM(InterestAmt)"
+ "SET Amt=NVL((SELECT SUM(ConvertedAmt)+SUM(FeeAmt)+SUM(InterestAmt)"
+ " FROM C_DunningRunLine l "
+ "WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID), "
+ "WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID), 0), "
+ "QTY=(SELECT COUNT(*)"
+ " FROM C_DunningRunLine l "
+ "WHERE e.C_DunningRunEntry_ID=l.C_DunningRunEntry_ID "