DBA Data[Home] [Help]

PACKAGE: APPS.OKC_CURRENCY_API

Source


1 PACKAGE OKC_CURRENCY_API AUTHID CURRENT_USER AS
2 /* $Header: OKCPCURS.pls 120.0 2005/05/25 22:51:33 appldev noship $ */
3 
4 -- Exceptions used.
5 NO_RATE EXCEPTION;
6 
7 INVALID_CURRENCY EXCEPTION;
8 
9 -- Function Get_OU_Currency ( Org_ID IN NUMBER DEFAULT NULL )
10 -- Returns  Currency code
11 -- Parameters - If Org_ID IS NULL, then determines the functional currency
12 --              for the operating unit, using FND_Profile Org_ID.
13 
14 FUNCTION GET_OU_CURRENCY ( p_ORG_ID IN NUMBER DEFAULT NULL )
15 RETURN VARCHAR2;
16 
17 
18 -- Function Get_SOB_Currency ( SOB_ID IN NUMBER )
19 -- Returns  Currency Code
20 -- Parameters - Set of Books ID needed.
21 
22 FUNCTION GET_SOB_CURRENCY ( p_SOB_ID IN NUMBER )
23 RETURN VARCHAR2;
24 
25 
26 -- Function Get_OU_SOB ( ORG_ID IN NUMBER DEFAULT NULL )
27 -- Returns  SOB_ID
28 -- Parameters - If Org_ID is not provided, then determines the set of books for
29 --			 the current OU.
30 
31 FUNCTION GET_OU_SOB ( p_ORG_ID IN NUMBER DEFAULT NULL )
32 RETURN NUMBER;
33 
34 
35 -- Function Get_OU_SOB_Name ( ORG_ID IN NUMBER DEFAULT NULL )
36 -- Returns  SOB Name
37 -- Parameters - If Org_ID is not provided, then determines the set of books for
38 --			 the current OU.
39 
40 FUNCTION GET_OU_SOB_NAME ( p_ORG_ID IN NUMBER DEFAULT NULL )
41 RETURN VARCHAR2;
42 
43 
44 -- Function IS_User_Rate_Allowed ( From_Currency, To_Currency, Effective_Date )`
45 -- Returns  BOOLEAN
46 -- Parameters - Needs From currency, To currency and Effective date.
47 --              Effective date defaults to sysdate.
48 -- Desc     If there is a fixed relationship between the two currencies,
49 --          then USER rate type is not allowed.
50 
51 FUNCTION IS_USER_RATE_ALLOWED ( p_FROM_CURRENCY IN VARCHAR2,
52 					       p_TO_CURRENCY   IN VARCHAR2,
53 					       p_EFFECTIVE_DATE IN DATE DEFAULT SYSDATE )
54 RETURN BOOLEAN;
55 
56 
57 -- Function Get_Rate ( From_Currency, To_currency, Conversion_date,
58 --                     Conversion_type, Conversion_Rate DEFAULT NULL )
59 -- Returns  Exchage Rate between the two currencies.
60 -- Parameters - All are needed. Conversion rate is expected only if the conversion
61 --              conversion type is USER. If USER is applicable, then the
62 --              conversion rate provided is returned, else obtained from
63 --              the system.
64 
65 FUNCTION GET_RATE ( p_FROM_CURRENCY IN VARCHAR2,
66 				p_TO_CURRENCY   IN VARCHAR2,
67 				p_CONVERSION_DATE IN DATE,
68 				p_CONVERSION_TYPE IN VARCHAR2,
69 				p_CONVERSION_RATE IN NUMBER DEFAULT NULL )
70 RETURN NUMBER;
71 
72 
73 -- Procedure Get_Rate ( From_Currency, To_Currency, Conversion_Date,
74 --                     Conversion_type, Conversion_Rate, Euro_Rate );
75 -- Returns   Conversion_Rate and Euro_Rate.
76 -- Parameters - All parameters are needed. Conversion_rate is IN OUT,
77 --              and Euro_rate is OUT.
78 -- Desc      Conversion_rate is the exchange rate between the two currencies.
79 --           If the To currency is EMU, then the From currency to EURO rate
80 --           is also obtained.
81 
82 PROCEDURE GET_RATE ( p_FROM_CURRENCY IN VARCHAR2,
83 				 p_TO_CURRENCY   IN VARCHAR2,
84 				 p_CONVERSION_DATE IN DATE,
85 				 p_CONVERSION_TYPE IN VARCHAR2,
86 				 x_CONVERSION_RATE IN OUT NOCOPY NUMBER,
87 				 x_EURO_RATE     OUT NOCOPY NUMBER,
88 				 x_return_status OUT NOCOPY VARCHAR2);
89 
90 -- Procedure Validate_Conversion_Attribs ( From_Currency, To_Currency,
91 --                                         Conversion_date, Conversion_type,
92 --                                         Conversion_rate, Status, Message )
93 -- Parameters - All currency conversion parameters are needed.
94 -- Desc         Validates the currency conversion attributes.
95 --              The return status and message are set accordingly.
96 
97 PROCEDURE VALIDATE_CONVERSION_ATTRIBS ( p_FROM_CURRENCY IN VARCHAR2,
98                                         p_TO_CURRENCY   IN VARCHAR2,
99                                         p_CONVERSION_DATE IN DATE,
100                                         p_CONVERSION_TYPE IN VARCHAR2,
101                                         p_CONVERSION_RATE IN NUMBER,
102                                         x_RETURN_STATUS  OUT NOCOPY VARCHAR2,
103                                         x_MESSAGE        OUT NOCOPY VARCHAR2 );
104 
105 
106 -- Procedure Convert_Amount ( From_Currency, To_Currency, Conversion_Date,
107 --                            Conversion_Type, Amount, Conversion_Rate, Converted_Amount);
108 -- Parameters - From Currency, To Currency, Rate Type, Conversion Date,
109 --              Conversion rate needed if User rate type used and Converted amount
110 --              is returned.
111 -- Desc      Provides the converted amount.
112 
113 PROCEDURE CONVERT_AMOUNT ( p_FROM_CURRENCY IN VARCHAR2,
114 					  p_TO_CURRENCY   IN VARCHAR2,
115 					  p_CONVERSION_DATE IN DATE,
116 					  p_CONVERSION_TYPE IN VARCHAR2,
117 					  p_AMOUNT          IN     NUMBER,
118 					  x_CONVERSION_RATE IN OUT NOCOPY NUMBER,
119 					  x_CONVERTED_AMOUNT   OUT NOCOPY NUMBER );
120 
121 -- Procedure Get_Info ( Currency, Effective_Date, Rate. MAU, Type )
122 -- Parameters - Currency and effective date are needed.
123 -- Returns      The Derive Type, Derive Factor for Euro related currencies,
124 --              and the Minimum Accountable Unit.
125 
126 PROCEDURE GET_INFO( p_currency  VARCHAR2,
127 	            p_eff_date  DATE,
128 	            x_conversion_rate   IN OUT NOCOPY    NUMBER,
129 		    x_mau               IN OUT NOCOPY    NUMBER,
130 		    x_currency_type     IN OUT NOCOPY    VARCHAR2 ) ;
131 
132 
133 -- Function Get_Currency_Type ( Currency, Effective Date)
134 -- Returns  Derive Type for the currency
135 -- Parameters are needed.
136 -- Desc     Provides the type of currency whether EURO, EMU or OTHER.
137 
138 FUNCTION GET_CURRENCY_TYPE( p_currency  VARCHAR2,
139 			    p_eff_date  DATE )
140 RETURN VARCHAR2;
141 
142 
143 -- Bug# 2155930 Euro Conversion
144 
145 -- Function GET_EURO_CURRENCY_CODE ( Currency )
146 -- Returns  Equivalent Euro Code for the Currency, if applicable,
147 --          Else returns the Currency itslef.
148 -- Parameters are needed.
149 -- Desc     Provides the Euro currency code if EMU currency.
150 --          Needed for Post-EFC after 01-Jan-2002
151 --          And if SoB is already switched to EUR, using EFC.
152 --          Assumes the OKC Context is set, so it can call the
153 --          Get_OU_Currency api using the OKC Context.
154 --          Primarily intended for OKS Billing program.
155 
156 
157 FUNCTION GET_EURO_CURRENCY_CODE( p_currency VARCHAR2 )
158 RETURN VARCHAR2;
159 
160 
161 -- Function IS_EURO_CONVERSION_NEEDED ( Currency )
162 -- Returns  Y if Euro conversion needed - for EMU Currencies
163 -- Parameters are needed.
164 -- Desc     Y if Euro conversion needed.
165 
166 FUNCTION IS_EURO_CONVERSION_NEEDED( p_currency VARCHAR2 )
167 RETURN VARCHAR2;
168 
169 END OKC_CURRENCY_API;