DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_GCC_CURR_CONV

Source


1 package body pay_gcc_curr_conv as
2 /* $Header: pygcccur.pkb 120.0.12020000.2 2013/02/06 07:04:36 bkeshary noship $ */
3 
4 -- --------------------------------------------------------------------------
5 -- |-----------------------< get_conversion_type >--------------------------------|
6 -- --------------------------------------------------------------------------
7   --
8   -- Purpose
9   --  Returns the rate type given the business group, effective date and
10   --  processing type
11   --
12   --  Current processing types are:-
13   --  		            P - Payroll Processing
14   --                  R - General HRMS reporting
15   --            	    I - Business Intelligence System
16   --  Arguments
17   --  p_business_group_id	The business group
18   --  p_effective_date		The date for which to return the rate type
19   --  p_processing_type		The processing type of which to return the rate
20   --
21   --  Returns null if no rate type found
22   --
23   --
24 
25 
26 
27   FUNCTION get_conversion_type (
28 		p_business_group_id	NUMBER,
29     p_date_earned IN DATE,
30 		p_conversion_date	OUT NOCOPY DATE,
31 		p_processing_type	IN VARCHAR2 ) RETURN VARCHAR2 IS
32 --
33         l_row_name varchar2(30);
34         l_value    pay_user_column_instances_f.value%type;
35         l_conversion_type varchar2(30);
36   BEGIN
37 --
38  --   hr_utility.trace_on(null,'bpk');
39      hr_utility.set_location('Entering: ' , 10);
40 
41       hr_utility.set_location('p_business_group_id: ' || p_business_group_id, 20);
42       hr_utility.set_location('p_conversion_date: ' || p_conversion_date, 30);
43       hr_utility.set_location('p_processing_type: ' || p_processing_type, 40);
44 
45 
46   	l_value := hruserdt.get_table_value(p_business_group_id,
47                                             'EXCHANGE_RATE_TYPES',
48                                             'Conversion Rate Type' ,
49 					    'PAY' ,
50 					    p_date_earned) ;
51 
52 --  l_conversion_type := l_value;
53 --
54 --      l_value is a user_conversion_type
55 --      we want to return the conversion_type, hence:
56 --
57         select conversion_type
58         into l_conversion_type
59         from gl_daily_conversion_types
60        where user_conversion_type = l_value;
61 --
62    if l_value is NULL then
63       l_conversion_type := 'PY_GCC_USR_TAB_ERROR';
64   end if;
65 
66     p_conversion_date := p_date_earned;
67 
68    return l_conversion_type;
69 --
70  EXCEPTION
71      WHEN OTHERS THEN
72 
73  --    raise
74  	RETURN null;
75 --         Don't know what the problem was with the user the table.
76 --         However don't want to percolate an exception from get_table_value
77 --         Request from payroll team for this to be put in.
78   END get_conversion_type;
79 
80 
81 
82 end PAY_GCC_CURR_CONV;