1 PACKAGE BODY AR_ADV_BAL_SEL_CURR_PKG AS
2 -- $Header: ARADVBALPKGB.pls 120.2.12000000.1 2007/10/24 18:52:51 sgudupat noship $
3 --*****************************************************************************
4 -- Copyright (c) 2000 Oracle Solution Services (India) Product Development
5 -- All rights reserved
6 --*****************************************************************************
7 --
8 --
9 -- PROGRAM NAME
10 -- ARADVBALPKGB.pls
11 --
12 -- DESCRIPTION
13 -- This script creates the package specification of AR_ADV_BAL_SEL_CURR_PKG.
14 -- This package is used by the 'Balance of Advances Received in Selected currency-slovakia' report.
15 --
16 -- USAGE
17 --
18 -- To execute This can be applied by running this script at SQL*Plus.
19 --
20 -- PROGRAM LIST DESCRIPTION
21 --
22 -- beforeReportTrigger It is a public function which is run just after the
23 -- queries are parsed and before queries are executed.
24 --
25 -- DEPENDENCIES
26 -- None
27 --
28 -- CALLED BY
29 -- DataTemplate Extract in 'Balance of Advances Received in Selected currency-slovakia' report.
30 --
31 -- LAST UPDATE DATE 17-FEB-2007
32 --
33 --
34 -- HISTORY
35 -- =======
36 --
37 -- VERSION DATE AUTHOR(S) DESCRIPTION
38 -- ------- ----------- ----------------- ------------------------------------
39 -- Draft1A 17-FEB-2007 Mallikarjun Gupta Initial version
40 --***************************************************************************
41 FUNCTION beforereport RETURN BOOLEAN IS
42 BEGIN
43
44 SELECT gl.currency_code
45 INTO gc_func_currency
46 FROM gl_ledgers gl
47 ,gl_access_set_norm_assign gasna
48 WHERE gasna.access_set_id = fnd_profile.VALUE('GL_ACCESS_SET_ID')
49 AND gl.ledger_id = gasna.ledger_id
50 AND gl.ledger_category_code = 'PRIMARY';
51
52 ---pl\sql bolck to get control segment name
53 ---for the given control segment number
54
55 SELECT FSEG.segment_name
56 INTO gc_ctrl_seg
57 FROM fnd_id_flex_structures fst
58 ,fnd_id_flex_segments fseg
59 WHERE fst.id_flex_code = fseg.id_flex_code
60 AND fst.id_flex_num = fseg.id_flex_num
61 AND fst.application_id = fseg.application_id
62 AND fseg.id_flex_code = 'GL#'
63 AND fseg.id_flex_num = P_CHART_OF_ACCOUNTS_ID
64 AND fseg.application_id = 101
65 AND fseg.segment_num = P_CONTROL_SEGMENT;
66
67 ----build the where clause for CURRENCY CODE WHERE
68 fnd_file.put_line(fnd_file.log,'P_CURRENCY_TYPE'||P_CURRENCY_TYPE);
69 IF P_CURRENCY_TYPE = 'Selected Currency' THEN
70 gc_currency_code_where:=' TRX.invoice_currency_code = :P_CURRENCY_CODE ';
71 ELSIF P_CURRENCY_TYPE = 'All Currencies' THEN
72 gc_currency_code_where:=' 1 = 1 ';
73 ELSE
74 gc_currency_code_where:=' TRX.invoice_currency_code not in (:gc_func_currency)';
75 END IF;
76 fnd_file.put_line(fnd_file.log,'gc_currency_code_where'||gc_currency_code_where);
77
78 RETURN TRUE;
79 END beforereport;
80
81 END AR_ADV_BAL_SEL_CURR_PKG;