4: FUNCTION get_period_name(l_invoice_id IN NUMBER) RETURN VARCHAR2
5: IS
6: l_sob_id NUMBER;
7: l_inv_date DATE;
8: l_period_name gl_period_statuses.period_name%TYPE := '';
9: BEGIN
10: select set_of_books_id, invoice_date
11: into l_sob_id, l_inv_date
12: from ap_invoices_all
13: where invoice_id = l_invoice_id;
14:
15: select period_name
16: into l_period_name
17: from gl_period_statuses
18: where application_id = 200
19: and set_of_books_id = l_sob_id
20: and l_inv_Date between start_date and end_date;
21:
27: FUNCTION get_check_period_name(l_check_id IN NUMBER) RETURN VARCHAR2
28: IS
29: l_sob_id NUMBER;
30: l_check_date DATE;
31: l_period_name gl_period_statuses.period_name%TYPE := '';
32: BEGIN
33: select APS.set_of_books_id, AC.check_date
34: into l_sob_id, l_check_date
35: from ap_checks_all AC, ap_system_parameters_all APS
37: and AC.org_id = APS.org_id;
38:
39: select period_name
40: into l_period_name
41: from gl_period_statuses
42: where application_id = 200
43: and set_of_books_id = l_sob_id
44: and l_check_date between start_date and end_date;
45: