Small performance improvement on Payment completion - don't rewrite a valid value (avoid save/check cycle)

This commit is contained in:
Carlos Ruiz 2008-06-23 21:31:37 +00:00
parent 20fa496489
commit 2f9d6e74e6
1 changed files with 4 additions and 2 deletions

View File

@ -411,8 +411,10 @@ public class MPeriod extends X_C_Period
// We are OK
if (isInPeriod(today))
{
as.setC_Period_ID(getC_Period_ID());
as.save();
if (as.getC_Period_ID() != getC_Period_ID()) {
as.setC_Period_ID(getC_Period_ID());
as.save();
}
}
return true;
}