IDEMPIERE-2687 Special case for journal documents with direct period

This commit is contained in:
Carlos Ruiz 2019-04-18 15:31:47 +02:00
parent eb82017e1e
commit 877e198a70
1 changed files with 10 additions and 0 deletions

View File

@ -373,6 +373,16 @@ public class MPeriod extends X_C_Period
orgID = po.get_ValueAsInt(idxorg);
}
if (tableID == MJournal.Table_ID || tableID == MJournalBatch.Table_ID) {
// special case for journal that has direct period
int periodID = po.get_ValueAsInt("C_Period_ID");
MPeriod period = MPeriod.get(ctx, periodID);
boolean open = period.isOpen(docBaseType, dateAcct);
if (!open)
s_log.warning(period.getName() + ": Not open for " + docBaseType + " (" + dateAcct + ")");
return open;
}
return isOpen(ctx, dateAcct, docBaseType, orgID);
} // isOpen