IDEMPIERE-2617 Transaction closed exception while posting

This commit is contained in:
Carlos Ruiz 2018-09-02 13:07:21 +02:00
parent e9f31283c6
commit a19eaa0c82
1 changed files with 10 additions and 10 deletions

View File

@ -88,7 +88,7 @@ public class MPeriod extends X_C_Period
*/
public static MPeriod get (Properties ctx, Timestamp DateAcct)
{
return get(ctx, DateAcct, 0);
return get(ctx, DateAcct, 0, null);
} // get
/**
@ -200,7 +200,7 @@ public class MPeriod extends X_C_Period
*/
public static int getC_Period_ID (Properties ctx, Timestamp DateAcct)
{
MPeriod period = get (ctx, DateAcct);
MPeriod period = get (ctx, DateAcct, 0, null);
if (period == null)
return 0;
return period.getC_Period_ID();
@ -215,7 +215,7 @@ public class MPeriod extends X_C_Period
*/
public static int getC_Period_ID (Properties ctx, Timestamp DateAcct, int AD_Org_ID)
{
MPeriod period = get (ctx, DateAcct, AD_Org_ID);
MPeriod period = get (ctx, DateAcct, AD_Org_ID, null);
if (period == null)
return 0;
return period.getC_Period_ID();
@ -254,7 +254,7 @@ public class MPeriod extends X_C_Period
s_log.warning("No DocBaseType");
return false;
}
MPeriod period = MPeriod.get (ctx, DateAcct, AD_Org_ID);
MPeriod period = MPeriod.get (ctx, DateAcct, AD_Org_ID, null);
if (period == null)
{
s_log.warning("No Period for " + DateAcct + " (" + DocBaseType + ")");
@ -398,7 +398,7 @@ public class MPeriod extends X_C_Period
public static MPeriod getFirstInYear (Properties ctx, Timestamp DateAcct, int AD_Org_ID)
{
MPeriod retValue = null;
int C_Calendar_ID = MPeriod.get(ctx, DateAcct, AD_Org_ID).getC_Calendar_ID();
int C_Calendar_ID = MPeriod.get(ctx, DateAcct, AD_Org_ID, null).getC_Calendar_ID();
String sql = "SELECT * "
+ "FROM C_Period "
@ -780,7 +780,7 @@ public class MPeriod extends X_C_Period
public static void testPeriodOpen(Properties ctx, Timestamp dateAcct, String docBaseType)
throws PeriodClosedException
{
if (!MPeriod.isOpen(ctx, dateAcct, docBaseType)) {
if (!MPeriod.isOpen(ctx, dateAcct, docBaseType, 0)) {
throw new PeriodClosedException(dateAcct, docBaseType);
}
}
@ -815,7 +815,7 @@ public class MPeriod extends X_C_Period
throws PeriodClosedException
{
MDocType dt = MDocType.get(ctx, C_DocType_ID);
testPeriodOpen(ctx, dateAcct, dt.getDocBaseType());
testPeriodOpen(ctx, dateAcct, dt.getDocBaseType(), 0);
}
/**
@ -842,9 +842,9 @@ public class MPeriod extends X_C_Period
{
if (m_C_Calendar_ID == 0)
{
MYear year = (MYear) getC_Year();
if (year != null)
m_C_Calendar_ID = year.getC_Calendar_ID();
int calId = DB.getSQLValueEx(null, "SELECT C_Calendar_ID FROM C_Year WHERE C_Year_ID=?", getC_Year_ID());
if (calId >= 0)
m_C_Calendar_ID = calId;
else
log.severe("@NotFound@ C_Year_ID=" + getC_Year_ID());
}