Fix bug [ 1820810 ] Wrong Period Assigned to Fact_Acct

This commit is contained in:
Carlos Ruiz 2007-10-27 01:19:33 +00:00
parent 593b413282
commit 6097212d3d
1 changed files with 3 additions and 2 deletions

View File

@ -59,6 +59,7 @@ public class MPeriod extends X_C_Period
*/ */
public static MPeriod get (Properties ctx, Timestamp DateAcct) public static MPeriod get (Properties ctx, Timestamp DateAcct)
{ {
int AD_Client_ID = Env.getAD_Client_ID(ctx);
if (DateAcct == null) if (DateAcct == null)
return null; return null;
// Search in Cache first // Search in Cache first
@ -66,13 +67,13 @@ public class MPeriod extends X_C_Period
while (it.hasNext()) while (it.hasNext())
{ {
MPeriod period = (MPeriod)it.next(); MPeriod period = (MPeriod)it.next();
if (period.isStandardPeriod() && period.isInPeriod(DateAcct)) if (period.isStandardPeriod() && period.isInPeriod(DateAcct)
&& period.getAD_Client_ID() == AD_Client_ID) // globalqss - CarlosRuiz - Fix [ 1820810 ] Wrong Period Assigned to Fact_Acct
return period; return period;
} }
// Get it from DB // Get it from DB
MPeriod retValue = null; MPeriod retValue = null;
int AD_Client_ID = Env.getAD_Client_ID(ctx);
String sql = "SELECT * " String sql = "SELECT * "
+ "FROM C_Period " + "FROM C_Period "
+ "WHERE C_Year_ID IN " + "WHERE C_Year_ID IN "