1 PACKAGE BODY ar_custom_contract_api AS
2 /* $Header: ARXRMCCB.pls 115.2 2003/11/21 16:32:52 mraymond noship $ */
3
4
5 pg_debug VARCHAR2(1) := NVL(fnd_profile.value('AFLOG_ENABLED'), 'N');
6
7
8 /*========================================================================
9 | PUBLIC FUNCTION implemented_third_party
10 |
11 | DESCRIPTION
12 | This is the function to determine if theird party contract system
13 | has been implented and you wish to use feed this data to the
14 | Revenue Mangement Engine.
15 |
16 | CALLED FROM PROCEDURES/FUNCTIONS (local to this package body)
17 | Revenue Managment Engine.
18 |
19 | MODIFICATION HISTORY
20 | Date Author Description of Changes
21 | 07-MAR-2003 Obaidur Rashid Created
22 |
23 *=======================================================================*/
24
25 FUNCTION implemented_third_party
26 RETURN BOOLEAN IS
27
28 BEGIN
29
30 -- Change 'FALSE' to 'TRUE' if u have implemented
31 -- a third party contract solution.
32
33 fnd_file.put_line(fnd_file.log,
34 'ar_custom_contract_api.implemented_third_party()');
35
36 RETURN FALSE;
37
38 END implemented_third_party;
39
40
41 /*========================================================================
42 | PUBLIC PROCEDURE retrieve_contract
43 |
44 | DESCRIPTION
45 | If you have a third party contract solution, and you want to
46 | retrieve data from that system and integrate with Oracle's
47 | revenue management solution, you must write code in this routine
48 | populate the OUT parameters appropriately so that Revenue Management
49 | Engine can take these into consideration.
50 |
51 | CALLED FROM PROCEDURES/FUNCTIONS
52 | Called by Revenue Management Engine.
53 |
54 | PARAMETERS
55 | p_customer_trx_id IN NUMBER Invoice ID
56 | p_customer_trx_line_id IN NUMBER Invoice Line ID
57 | p_sales_order IN NUMBER Sales Order Number (NOT ID)
58 | p_sales_order_line_id IN VARCHAR2 Sales Order Line ID
59 |
60 | NOTES
61 |
62 | MODIFICATION HISTORY
63 | Date Author Description of Changes
64 | DD-MON-YYYY Obaidur Rashid Created
65 |
66 *=======================================================================*/
67
68 PROCEDURE retrieve_contract_info (
69 p_customer_trx_id IN NUMBER,
70 p_customer_trx_line_id IN NUMBER,
71 p_sales_order IN NUMBER,
72 p_sales_order_line_id IN VARCHAR2,
73 p_transaction_date IN DATE,
74 x_contract_id OUT NOCOPY VARCHAR2,
75 x_contract_line_id OUT NOCOPY VARCHAR2,
76 x_acceptance_clause OUT NOCOPY VARCHAR2,
77 x_acceptance_expiry OUT NOCOPY DATE,
78 x_refund_clause OUT NOCOPY VARCHAR2,
79 x_refund_expiry OUT NOCOPY DATE,
80 x_cancellation_clause OUT NOCOPY VARCHAR2,
81 x_cancellation_expiry OUT NOCOPY DATE,
82 x_forfeiture_clause OUT NOCOPY VARCHAR2,
83 x_forfeiture_expiry OUT NOCOPY DATE,
84 x_fiscal_funding_clause OUT NOCOPY VARCHAR2,
85 x_fiscal_expiry OUT NOCOPY DATE) IS
86
87
88 BEGIN
89
90 fnd_file.put_line(fnd_file.log,
91 'ar_custom_contract_api.retrieve_Contract_info()+');
92
93 IF pg_debug IN ('Y', 'C') THEN
94 fnd_file.put_line(fnd_file.log, '*** parameters ***');
95 fnd_file.put_line(fnd_file.log, ' p_customer_trx_id : ' ||
96 p_customer_trx_id);
97 fnd_file.put_line(fnd_file.log, ' p_customer_trx_line_id : ' ||
98 p_customer_trx_line_id);
99 fnd_file.put_line(fnd_file.log, ' p_sales_order : ' || p_sales_order);
100 fnd_file.put_line(fnd_file.log, ' p_sales_order_line_id : ' ||
101 p_sales_order_line_id);
102 fnd_file.put_line(fnd_file.log, ' p_transaction_date : ' ||
103 p_transaction_date);
104 END IF;
105
106 -- Start out by assigning default values to the out parameters.
107 -- So, in the case where there is no associated contracts, our
108 -- engine would still function.
109
110 x_acceptance_clause := 'N';
111 x_acceptance_expiry := NULL;
112 x_refund_clause := 'N';
113 x_refund_expiry := NULL;
114 x_cancellation_clause := 'N';
115 x_cancellation_expiry := NULL;
116 x_forfeiture_clause := 'N';
117 x_forfeiture_expiry := NULL;
118 x_fiscal_funding_clause := 'N';
119 x_fiscal_expiry := NULL;
120
121 -- Here put your custom logic to retrieve contract contingencies
122 -- and populate the OUT parameters listed above appropriately.
123 -- Please note that when a value of 'Y' for any clause
124 -- would be interpreted as an existence of a contract contingency.
125 -- And the corresponding expiration fiels will then be used to
126 -- time the expiration of this clause. Nevetheless, some
127 -- contingencies may not have an expiration (e.g. Acceptance Clause).
128 -- In those cases you can leave it null.
129
130 -- If you are writing custom logic here then you must first change
131 -- value to TRUE in the function third_party_implemented.
132
133 fnd_file.put_line(fnd_file.log,
134 'ar_custom_contract_api.retrieve_Contract_info()-');
135
136 EXCEPTION
137
138 WHEN NO_DATA_FOUND THEN
139 IF pg_debug IN ('Y', 'C') THEN
140 arp_standard.debug('retrieve_contract_info: EXCEPTION NO_DATA_FOUND');
141 END IF;
142 RAISE;
143
144 WHEN OTHERS THEN
145 IF PG_DEBUG in ('Y', 'C') THEN
146 arp_standard.debug('retrieve_contract_info: EXCEPTION OTHERS');
147 END IF;
148 RAISE;
149
150 END retrieve_contract_info;
151
152
153 BEGIN
154
155 null;
156
157 EXCEPTION
158 WHEN NO_DATA_FOUND THEN
159 arp_standard.debug('EXCEPTION: ar_custom_contract_api.initialize');
160 RAISE;
161
162 WHEN OTHERS THEN
163 arp_standard.debug('EXCEPTION: ar_custom_contract_api.initialize');
164 RAISE;
165
166 END ar_custom_contract_api;