1 PACKAGE OKC_TIME_UTIL_PVT AS
2 /* $Header: OKCCTULS.pls 120.1 2005/12/30 10:28:41 skekkar noship $ */
3 ---------------------------------------------------------------------------
4 -- Procedures and Functions
5 ---------------------------------------------------------------------------
6 ---------------------------------------------------------------------------
7 -- GLOBAL VARIABLES
8 ---------------------------------------------------------------------------
9 G_APP_NAME CONSTANT VARCHAR2(3) := OKC_API.G_APP_NAME;
10 G_SQLERRM_TOKEN CONSTANT varchar2(200) := 'SQLerrm';
11 G_SQLCODE_TOKEN CONSTANT varchar2(200) := 'SQLcode';
12 G_DATE_ERROR CONSTANT varchar2(200) := 'OKC_INVALID_START_END_DATES';
13 G_COL_NAME_TOKEN CONSTANT VARCHAR2(200) := OKC_API.G_COL_NAME_TOKEN;
14 G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKC_TIME_UTIL_PVT';
15 G_INVALID_VALUE CONSTANT VARCHAR2(200) := OKC_API.G_INVALID_VALUE;
16 G_UNEXPECTED_ERROR CONSTANT VARCHAR2(200) := 'OKC_CONTRACTS_UNEXPECTED_ERROR';
17
18 ----------------------------------------------------------------------------
19 -- The following procedure derives the most suitable period and duration based
20 -- on a start and end date.
21 ----------------------------------------------------------------------------
22
23 PROCEDURE get_duration(
24 p_start_date in date,
25 p_end_date in date,
26 x_duration out nocopy number,
27 x_timeunit out nocopy varchar2,
28 x_return_status out nocopy varchar2);
29
30 ----------------------------------------------------------------------------
31 -- The following function returns the end date based on a start,duration and
32 -- period.
33 ----------------------------------------------------------------------------
34 FUNCTION get_enddate(
35 p_start_date in date,
36 p_timeunit varchar2,
37 p_duration number)
38 return date ;
39 ----------------------------------------------------------------------------
40 ----------------------------------------------------------------------------
41 -- The following section deals with handling of tve related rules
42 ----------------------------------------------------------------------------
43
44 TYPE col_val_rec IS RECORD (
45 col_name varchar2(60),
46 col_value varchar2(450)
47 );
48
49 TYPE t_col_vals is table of col_val_rec index by binary_integer;
50
51 FUNCTION get_app_id
52 return NUMBER;
53
54 -- /striping/
55 FUNCTION get_app_id(rule_code in varchar2)
56 return NUMBER;
57
58 FUNCTION get_rule_df_name
59 return varchar2;
60
61 -- /striping/
62 function get_rule_df_name(rule_code in varchar2)
63 return varchar2;
64
65 FUNCTION get_rule_defs_using_vs(
66 p_app_id IN NUMBER,
67 p_dff_name IN VARCHAR2,
68 p_fvs_name IN VARCHAR2)
69 return varchar2;
70
71 PROCEDURE get_dff_column_values (
72 p_app_id IN NUMBER,
73 p_dff_name IN VARCHAR2,
74 p_rdf_code IN VARCHAR2,
75 p_fvs_name IN VARCHAR2,
76 p_rule_id IN NUMBER,
77 p_col_vals OUT NOCOPY t_col_vals,
78 p_no_of_cols OUT NOCOPY NUMBER
79 );
80
81 FUNCTION get_tve_ids (
82 p_app_id IN NUMBER,
83 p_dff_name IN VARCHAR2,
84 p_rdf_code IN VARCHAR2,
85 p_fvs_name IN VARCHAR2,
86 p_rule_id IN NUMBER)
87 return varchar2;
88
89 -- Bug#2249285: New function added to check offsets in months and days for Renewal of Keep Duraion Lines
90
91 FUNCTION get_uom_code(p_timeunit IN VARCHAR2) return VARCHAR2;
92 PROCEDURE get_oracle_months_and_days(
93 p_start_date in date,
94 p_end_date in date,
95 x_month_duration out nocopy number,
96 x_day_duration out nocopy number,
97 x_return_status out nocopy varchar2);
98
99 ----------------------------------------------------------------------------
100 -- The following procedure derives the most suitable SEEDED period and duration based
101 -- on a start and end date.
102 -- This procedure is called by oks_reprice_pvt for prorating price
103 -- bug 4919611 ( base bug 4919612)
104 ----------------------------------------------------------------------------
105
106 PROCEDURE get_pricing_duration(
107 p_start_date in date,
108 p_end_date in date,
109 x_duration out nocopy number,
110 x_timeunit out nocopy varchar2,
111 x_return_status out nocopy varchar2);
112
113 END OKC_TIME_UTIL_PVT;