|
|
发表于 2007/1/11 14:55:39
|
显示全部楼层
AD_WF_Activity 的textmsg如下:
800004: 总计=37000 - 程文革测试 - @PeriodClosed@ - java.lang.Exception: @PeriodClosed@ (0): org.compiere.wf.MWFActivity.performWork(MWFActivity.jav a:826) (1): org.compiere.wf.MWFActivity.run(MWFActivity.java:711)
通过源程序跟踪出错点:
MPeriod.java
public static MPeriod get (Properties ctx, Timestamp DateAcct)
{
if (DateAcct == null)
return null;
// Search in Cache first
Iterator it = s_cache.values().iterator();
while (it.hasNext())
{
MPeriod period = (MPeriod)it.next();
if (period.isStandardPeriod() && period.isInPeriod(DateAcct))
return period;
}
// Get it from DB
MPeriod retValue = null;
int AD_Client_ID = Env.getAD_Client_ID(ctx);
String sql = "SELECT * "
+ "FROM C_Period "
+ "WHERE C_Year_ID IN "
+ "(SELECT C_Year_ID FROM C_Year WHERE C_Calendar_ID= "
+ "(SELECT C_Calendar_ID FROM AD_ClientInfo WHERE AD_Client_ID=?))"
+ " AND ? BETWEEN TRUNC(StartDate) AND TRUNC(EndDate)"
+ " AND IsActive='Y' AND PeriodType='S'";
try
{
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt (1, AD_Client_ID);
pstmt.setTimestamp (2, TimeUtil.getDay(DateAcct));
ResultSet rs = pstmt.executeQuery();
while (rs.next())
{
MPeriod period = new MPeriod(ctx, rs, null);
Integer key = new Integer (period.getC_Period_ID());
s_cache.put (key, period);
if (period.isStandardPeriod())
retValue = period;
}
rs.close();
pstmt.close();
pstmt = null;
}
catch (SQLException e)
{
s_log.log(Level.SEVERE, "DateAcct=" + DateAcct, e);
}
if (retValue == null)
s_log.warning("No Standard Period for " + DateAcct
+ " (AD_Client_ID=" + AD_Client_ID + ")");
return retValue;
} // get |
|