1 PACKAGE BODY AR_CUST_BAL_RPT_PKG
2 -- $Header: AR_CBSLRPTB.pls 120.1 2011/04/12 10:20:16 ankuagar ship $
3 --*************************************************************************
4 -- Copyright (c) 2000 Oracle Product Development
5 -- All rights reserved
6 --*************************************************************************
7 --
8 -- HEADER
9 -- Source control header
10 --
11 -- PROGRAM NAME
12 -- AR_CBSLRPTB.pls
13 --
14 -- DESCRIPTION
15 -- This script creates the package body of AR_CUST_BAL_RPT_PKG
16 -- This package is used to report on AR Customer Balance Statement Letter Report.
17 --
18 -- USAGE
19 -- To install sqlplus <apps_user>/<apps_pwd> @AR_CBSLRPTB.pls
20 -- To execute sqlplus <apps_user>/<apps_pwd> AR_CUST_BAL_RPT_PKG
21 --
22 -- PROGRAM LIST DESCRIPTION
23 --
24 -- DEPENDENCIES
25 -- None
26 --
27 -- CALLED BY
28 -- Statement Generation Program.
29 --
30 -- LAST UPDATE DATE 24-Jun-2007
31 -- Date the program has been modified for the last time
32 --
33 -- HISTORY
34 -- =======
35 --
36 -- VERSION DATE AUTHOR(S) DESCRIPTION
37 -- ------- ----------- --------------- ------------------------------------
38 -- Draft1A 02-Feb-2007 Sajana Doma Initial Creation
39 --
40 --
41 --************************************************************************
42 AS
43 FUNCTION BeforeReport RETURN BOOLEAN
44 IS
45 l_count1 number;
46 l_count2 number;
47 l_org_id number;
48 BEGIN
49 P_CONC_REQUEST_ID := FND_GLOBAL.CONC_REQUEST_ID;
50
51 BEGIN
52 select org_id into l_org_id from fnd_concurrent_requests
53 where request_id in ( select parent_request_id from fnd_concurrent_requests where request_id=p_conc_request_id);
54 EXCEPTION
55 WHEN OTHERS THEN
56 l_org_id := NULL;
57 END;
58 IF l_org_id is not null then
59 mo_global.set_policy_context('S',l_org_id);
60 END IF;
61
62 P_SORT_BY_PHONETICS := FND_PROFILE.VALUE('RA_CUSTOMERS_SORT_BY_PHONETICS');
63
64 IF P_SORT_BY_PHONETICS = 'Y'
65 THEN
66 P_SORT := 'HZP.ORGANIZATION_NAME_PHONETIC';
67 ELSE
68 P_SORT := 'HZP.PARTY_NAME';
69 END IF;
70
71 RETURN (TRUE);
72 EXCEPTION
73 WHEN OTHERS THEN
74 P_SORT_BY_PHONETICS := 'N';
75 P_SORT := 'HZP.PARTY_NAME';
76 END;
77
78 FUNCTION AfterReport RETURN BOOLEAN
79 IS
80 l_count1 number;
81 l_count2 number;
82 BEGIN
83 RETURN (TRUE);
84 END;
85
86 END AR_CUST_BAL_RPT_PKG;