[Home] [Help]
PACKAGE BODY: APPS.PON_PONXFEDOPPS_XMLP_PKG
Source
1 package body PON_PONXFEDOPPS_XMLP_PKG AS
2 /* $Header: PONXFEDOPPS_XMLB.pls 120.4 2011/02/13 17:35:53 bhuchand noship $ */
3
4
5 FUNCTION AfterPForm RETURN Boolean IS
6 doc_date_where_a VARCHAR2(500);
7 doc_date_where_c VARCHAR2(500);
8
9 Begin
10
11 if (po_clm_clo_util.getclmstatus = 'Y') then
12
13 if (p_issue_office is null) then
14 doc_iss_off_where := '1=1 ';
15 else
16 doc_iss_off_where := ' decode(PAH.AMENDMENT_FLAG, ''Y'', ' ||
17 'PO_UDA_PUB.GET_ADDRESS_ATTR_VALUE( ' ||
18 'PAH.UDA_TEMPLATE_ID, NULL, PAH.AUCTION_HEADER_ID, ' ||
19 'NULL, NULL, NULL, NULL, NULL,''addresses'', NULL, ' ||
20 '''location'', ''AMD_ISSUING_OFFICE'', ''INTERNAL_VALUE'') ,'||
21 'PO_UDA_PUB.GET_ADDRESS_ATTR_VALUE( ' ||
22 'PAH.UDA_TEMPLATE_ID, NULL, PAH.AUCTION_HEADER_ID, ' ||
23 'NULL, NULL, NULL, NULL, NULL,''addresses'', NULL, ' ||
24 '''location'', ''ISSUING_OFFICE'', ''INTERNAL_VALUE''))' ||
25 ' = :p_issue_office ' ;
26 end if;
27
28 t_date_to := p_date_to + 1;
29
30 IF (p_date_from IS NULL AND t_date_to IS NULL) then
31 doc_date_where := '1=1';
32 ELSE
33 iF (p_date_from IS NOT NULL AND t_date_to IS NULL) then
34 doc_date_where_a := 'PAH.PUBLISH_DATE >= :p_date_from';
35 doc_date_where_c := 'PAH.CREATION_DATE >= :p_date_from';
36 ELSiF (p_date_from IS NULL AND t_date_to IS NOT NULL) then
37 doc_date_where_a := 'PAH.PUBLISH_DATE <= :t_date_to';
38 doc_date_where_c := 'PAH.CREATION_DATE <= :t_date_to';
39 ELSiF (p_date_from IS NOT NULL AND t_date_to IS NOT NULL) then
40 doc_date_where_a := 'PAH.PUBLISH_DATE BETWEEN :p_date_from AND :t_date_to';
41 doc_date_where_c := 'PAH.CREATION_DATE BETWEEN :p_date_from AND :t_date_to';
42 END IF;
43 doc_date_where := '((PAH.AUCTION_STATUS NOT IN (''DRAFT'', ''CANCELLED'') AND ' || doc_date_where_a ||
44 ') OR (PAH.AUCTION_STATUS = ''DRAFT'' AND ' || doc_date_where_c || '))';
45 END IF;
46 else
47 doc_date_where := '1=2';
48 doc_iss_off_where := '1=2';
49
50 end if;
51
52 RETURN (TRUE);
53 END AfterPForm;
54
55 FUNCTION getIssueOfficeCode return VARCHAR2 IS
56 issue_office_desc VARCHAR2(200) := '';
57 Begin
58
59 if p_issue_office is not null then
60 select hrall.location_code
61 into issue_office_desc
62 FROM hr_locations_all hrall, hr_location_extra_info loceit
63 WHERE loceit.location_id = hrall.location_id
64 and loceit.information_type = 'CLM_OFFICE_CODE'
65 and po_uda_data_util.is_location_valid(hrall.location_id, 'ISSUING_OFFICE') = 'Y'
66 and hrall.location_id = p_issue_office;
67 end if;
68
69 RETURN (issue_office_desc);
70
71 exception
72 when others then
73 RETURN (p_issue_office);
74 END getIssueOfficeCode;
75
76 END PON_PONXFEDOPPS_XMLP_PKG;
77