1 PACKAGE OKI_DISCO_UTIL_PUB AUTHID CURRENT_USER AS
2 /* $Header: OKIPDULS.pls 115.2 2002/12/02 22:22:57 rpotnuru 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) := 'Start Date > End Date';
13 G_PKG_NAME CONSTANT VARCHAR2(200) := 'OKI_DISCO_UTIL_PUB';
14 G_INVALID_VALUE CONSTANT VARCHAR2(200) := OKC_API.G_INVALID_VALUE;
15 G_UNEXPECTED_ERROR CONSTANT VARCHAR2(200) := 'OKC_CONTRACTS_UNEXPECTED_ERROR';
16
17 g_start_date DATE;
18 g_end_date DATE;
19 g_period VARCHAR2(100);
20 g_duration NUMBER;
21
22 ----------------------------------------------------------------------------
23 -- The following function derives the number of periods based
24 -- on sob_id, start and end date.
25 ----------------------------------------------------------------------------
26 FUNCTION get_num_periods(
27 p_sob_id IN NUMBER,
28 p_start_date in date,
29 p_end_date in date)
30 return number;
31
32 ----------------------------------------------------------------------------
33 -- The following function returns the original license order number
34 -- based on the chr_id
35 ----------------------------------------------------------------------------
36 FUNCTION get_order_number(
37 p_chr_id IN NUMBER)
38 RETURN VARCHAR2;
39
40 ----------------------------------------------------------------------------
41 -- The following function derives the most suitable period based
42 -- on a start and end date.
43 -- This function should be used in conjunction with get_duration function
44 ----------------------------------------------------------------------------
45 FUNCTION get_period(
46 p_start_date IN DATE ,
47 p_end_date IN DATE )
48 RETURN VARCHAR2;
49 ----------------------------------------------------------------------------
50 -- The following function derives the most suitable duration based
51 -- on a start and end date.
52 -- This function should be used in conjunction with get_period function
53 ----------------------------------------------------------------------------
54
55 FUNCTION get_duration(
56 p_start_date IN DATE ,
57 p_end_date IN DATE )
58 RETURN NUMBER;
59
60 ----------------------------------------------------------------------------
61 -- The following function derives the end date based
62 -- on a start date, period_code and duration
63 ----------------------------------------------------------------------------
64 FUNCTION get_end_date(
65 p_start_date IN DATE ,
66 p_period_code IN VARCHAR2,
67 p_duration IN NUMBER)
68 RETURN DATE;
69
70 ----------------------------------------------------------------------------
71 -- The following function derives the aanualized amount based
72 -- on amount, start and end date.
73 ----------------------------------------------------------------------------
74 FUNCTION get_annualized_amount(
75 p_amount IN NUMBER,
76 p_start_date IN DATE,
77 p_end_date IN DATE)
78 RETURN NUMBER;
79
80 ----------------------------------------------------------------------------
81 -- The following function derives current month revenue for the given
82 -- chr_id, sob_id, End date.
83 ----------------------------------------------------------------------------
84 FUNCTION get_cur_month_rev(
85 p_chr_id IN NUMBER,
86 p_sob_id IN NUMBER,
87 p_end_date IN DATE)
88 RETURN NUMBER;
89
90 ----------------------------------------------------------------------------
91 -- The following function derives backdated revenue for the given
92 -- chr_id, sob_id, End date.
93 ----------------------------------------------------------------------------
94 FUNCTION get_backdated_rev(
95 p_chr_id IN NUMBER,
96 p_sob_id IN NUMBER,
97 p_end_date IN DATE)
98 RETURN NUMBER;
99
100
101 END OKI_DISCO_UTIL_PUB;