29:
30: IF (LedgerId IS NOT NULL) THEN
31: SELECT start_date, end_date
32: INTO PeriodStartDate, PeriodEndDate
33: FROM gl_period_statuses
34: WHERE period_name = PeriodName
35: AND application_id = 101
36: AND ledger_id = LedgerId;
37: END IF;
80: ) IS
81: BEGIN
82: SELECT greatest(least(sysdate, end_date), start_date)
83: INTO AccountingDate
84: FROM gl_period_statuses
85: WHERE application_id = 101
86: AND ledger_id = LedgerId
87: AND period_name = PeriodName;
88: