DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_POXAWDCCR_XMLP_PKG

Source


1 package body PO_POXAWDCCR_XMLP_PKG AS
2 /* $Header: POXAWDCCR_XMLB.pls 120.2 2011/02/10 06:47:37 nbingi noship $ */
3 
4 FUNCTION AfterPForm RETURN Boolean IS
5   doc_date_where_a VARCHAR2(500);
6   doc_date_where_c VARCHAR2(500);
7 
8   Begin
9 
10   if (po_clm_clo_util.getclmstatus = 'Y') then
11 
12     if (p_issue_office is null) then
13       doc_iss_off_where := '1=1';
14       doc_mod_iss_off_where := '1=1';
15     else
16       doc_iss_off_where := 'PHA.CLM_ISSUING_OFFICE = :p_issue_office';
17       doc_mod_iss_off_where := 'PHA.CLM_MOD_ISSUING_OFFICE = :p_issue_office';
18     end if;
19 
20     t_date_to := p_date_to + 1;
21 
22     IF (p_date_from IS NULL AND t_date_to IS NULL) then
23         doc_date_where := '1=1';
24     ELSE
25       iF (p_date_from IS NOT NULL AND t_date_to IS NULL) then
26 
27           doc_date_where_a := 'PHA.APPROVED_DATE >= :p_date_from';
28           doc_date_where_c := 'PHA.CREATION_DATE >= :p_date_from';
29 
30       ELSiF (p_date_from IS NULL AND t_date_to IS NOT NULL) then
31 
32           doc_date_where_a := 'PHA.APPROVED_DATE <= :t_date_to';
33           doc_date_where_c := 'PHA.CREATION_DATE <= :t_date_to';
34 
35       ELSiF (p_date_from IS NOT NULL AND t_date_to IS NOT NULL) then
36 
37           doc_date_where_a := 'PHA.APPROVED_DATE BETWEEN :p_date_from AND :t_date_to';
38           doc_date_where_c := 'PHA.CREATION_DATE BETWEEN :p_date_from AND :t_date_to';
39 
40       END IF;
41       doc_date_where := '((PHA.APPROVED_DATE IS NOT NULL AND ' || doc_date_where_a ||
42 		' ) OR (PHA.APPROVED_DATE IS NULL AND ' || doc_date_where_c || ' ))';
43     END IF;
44   else
45     doc_date_where := '1=2';
46     doc_iss_off_where := '1=2';
47     doc_mod_iss_off_where := '1=2';
48   end if;
49 RETURN (TRUE);
50 END AfterPForm;
51 
52 FUNCTION getIssueOfficeCode return VARCHAR2 IS
53   issue_office_desc VARCHAR2(200) := '';
54 Begin
55 
56   if p_issue_office is not null then
57       select hrall.location_code
58       into issue_office_desc
59       FROM hr_locations_all hrall, hr_location_extra_info loceit
60       WHERE loceit.location_id = hrall.location_id
61        and loceit.information_type = 'CLM_OFFICE_CODE'
62        and po_uda_data_util.is_location_valid(hrall.location_id, 'ISSUING_OFFICE') = 'Y'
63        and hrall.location_id = p_issue_office;
64   end if;
65 
66   RETURN (issue_office_desc);
67 
68   exception
69    when others then
70     RETURN (p_issue_office);
71 END getIssueOfficeCode;
72 
73 END PO_POXAWDCCR_XMLP_PKG;
74