BF [ 1693997 ] Calculation of cost should happen when transaction complete. Fixed wrong location.

This commit is contained in:
armenrz 2008-10-10 09:45:55 +00:00
parent a783f40b25
commit fb6232be35
1 changed files with 10 additions and 10 deletions

View File

@ -579,6 +579,16 @@ public class MMatchPO extends X_M_MatchPO
*/
protected boolean afterSave (boolean newRecord, boolean success)
{
if (newRecord && success)
{
// Elaine 2008/6/20
String err = createMatchPOCostDetail(this, getOrderLine());
if(err != null && err.length() > 0)
{
s_log.warning(err);
return false;
}
}
// Purchase Order Delivered/Invoiced
// (Reserved in VMatch and MInOut.completeIt)
if (success && getC_OrderLine_ID() != 0)
@ -613,16 +623,6 @@ public class MMatchPO extends X_M_MatchPO
return orderLine.save();
}
//
if (newRecord)
{
// Elaine 2008/6/20
String err = createMatchPOCostDetail(this, getOrderLine());
if(err != null && err.length() > 0)
{
s_log.warning(err);
return false;
}
}
return success;
} // afterSave