DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_DAILY_CONVERSION_TYPES_SV1

Source


1 PACKAGE BODY PO_DAILY_CONVERSION_TYPES_SV1 AS
2 /* $Header: POXPIRTB.pls 120.1.12010000.1 2008/09/18 12:20:49 appldev noship $ */
3 
4 /*===============================================================
5 
6    FUNCTION NAME : val_rate_type_code()
7 
8 ================================================================*/
9  FUNCTION val_rate_type_code( x_rate_type_code  IN VARCHAR2)
10 
11  RETURN BOOLEAN IS
12 
13    x_progress   varchar2(3) := null;
14    x_temp       binary_integer;
15 
16  BEGIN
17    x_progress  := '010';
18 
19    /* check to see if the given rate_type_code is a valid on in
20       gl_daily_conversion_types_v view */
21 
22    SELECT count(*)
23      INTO x_temp
24      FROM gl_daily_conversion_types_v
25     WHERE conversion_type = x_rate_type_code;
26 
27    IF x_temp = 0 THEN
28       RETURN FALSE;    /* validation fails */
29    ELSE
30       RETURN TRUE;     /* validation succeeds */
31    END IF;
32 
33 EXCEPTION
34    WHEN others THEN
35         po_message_s.sql_error('val_rate_type_code', x_progress, sqlcode);
36         raise;
37 END val_rate_type_code;
38 
39 
40 /*====================================================================
41 
42     FUNCTION NAME : derive_rate_type_code()
43 
44 ====================================================================*/
45 
46 FUNCTION  derive_rate_type_code(X_rate_type IN VARCHAR2)
47 return VARCHAR2 IS
48 
49    X_progress       varchar2(3)     := NULL;
50    X_rate_type_v    varchar2(30)    := NULL;
51 
52 BEGIN
53 
54    X_progress := '010';
55 
56    /* get the rate_type_code from gl_daily_conversion_types table
57       based on the rate_type value provided from input parameter */
58 
59    SELECT	 conversion_type
60    INTO		 X_rate_type_v
61    FROM		 gl_daily_conversion_types
62    WHERE	 user_conversion_type = X_rate_type;
63 
64    RETURN X_rate_type_v;
65 
66 EXCEPTION
67 
68    WHEN no_data_found THEN
69         RETURN NULL;
70    WHEN others THEN
71         po_message_s.sql_error('derive_rate_type_code',X_progress, sqlcode);
72         raise;
73 
74 END derive_rate_type_code;
75 
76 
77 
78 END PO_DAILY_CONVERSION_TYPES_SV1;