[Home] [Help]
PACKAGE BODY: APPS.XLA_ACCTG_METHOD_RULES_F_PKG
Source
1 PACKAGE BODY xla_acctg_method_rules_f_pkg AS
2 /* $Header: xlatbsap.pkb 120.6 2003/04/19 00:32:52 dcshah ship $ */
3 /*======================================================================+
4 | Copyright (c) 2001-2002 Oracle Corporation |
5 | Redwood Shores, CA, USA |
6 | All rights reserved. |
7 +=======================================================================+
8 | PACKAGE NAME |
9 | xla_acctg_method_rules_f_pkg |
10 | |
11 | DESCRIPTION |
12 | Forms PL/SQL Wrapper for xla_acctg_method_rules |
13 | |
14 | HISTORY |
15 | 05/22/01 Dimple Shah Created |
16 | |
17 +======================================================================*/
18
19
20
21 /*======================================================================+
22 | |
23 | Procedure insert_row |
24 | |
25 +======================================================================*/
26 PROCEDURE insert_row
27 (x_rowid IN OUT NOCOPY VARCHAR2
28 ,x_acctg_method_rule_id IN OUT NOCOPY NUMBER
29 ,x_amb_context_code IN VARCHAR2
30 ,x_accounting_method_type_code IN VARCHAR2
31 ,x_accounting_method_code IN VARCHAR2
32 ,x_application_id IN NUMBER
33 ,x_product_rule_type_code IN VARCHAR2
34 ,x_product_rule_code IN VARCHAR2
35 ,x_start_date_active IN DATE
36 ,x_end_date_active IN DATE
37 ,x_creation_date IN DATE
38 ,x_created_by IN NUMBER
39 ,x_last_update_date IN DATE
40 ,x_last_updated_by IN NUMBER
41 ,x_last_update_login IN NUMBER)
42 IS
43
44 CURSOR c IS
45 SELECT rowid
46 FROM xla_acctg_method_rules
47 WHERE acctg_method_rule_id = x_acctg_method_rule_id;
48
49 BEGIN
50 xla_utility_pkg.trace('> .insert_row' ,20);
51
52 INSERT INTO xla_acctg_method_rules
53 (creation_date
54 ,created_by
55 ,accounting_method_type_code
56 ,accounting_method_code
57 ,acctg_method_rule_id
58 ,amb_context_code
59 ,application_id
60 ,product_rule_type_code
61 ,product_rule_code
62 ,start_date_active
63 ,end_date_active
64 ,last_update_date
65 ,last_updated_by
66 ,last_update_login)
67 VALUES
68 (x_creation_date
69 ,x_created_by
70 ,x_accounting_method_type_code
71 ,x_accounting_method_code
72 ,xla_acctg_method_rules_s.nextval
73 ,x_amb_context_code
74 ,x_application_id
75 ,x_product_rule_type_code
76 ,x_product_rule_code
77 ,x_start_date_active
78 ,x_end_date_active
79 ,x_last_update_date
80 ,x_last_updated_by
81 ,x_last_update_login)
82 returning acctg_method_rule_id into x_acctg_method_rule_id
83 ;
84
85 OPEN c;
86 FETCH c INTO x_rowid;
87
88 IF (c%NOTFOUND) THEN
89 CLOSE c;
90 RAISE NO_DATA_FOUND;
91 END IF;
92 CLOSE c;
93
94 xla_utility_pkg.trace('< .insert_row' ,20);
95 END insert_row;
96
97 /*======================================================================+
98 | |
99 | Procedure lock_row |
100 | |
101 +======================================================================*/
102 PROCEDURE lock_row
103 (x_rowid IN OUT NOCOPY VARCHAR2
104 ,x_acctg_method_rule_id IN NUMBER
105 ,x_amb_context_code IN VARCHAR2
106 ,x_accounting_method_type_code IN VARCHAR2
107 ,x_accounting_method_code IN VARCHAR2
108 ,x_application_id IN NUMBER
109 ,x_product_rule_type_code IN VARCHAR2
110 ,x_product_rule_code IN VARCHAR2
111 ,x_start_date_active IN DATE
112 ,x_end_date_active IN DATE)
113
114 IS
115
116 CURSOR c IS
117 SELECT accounting_method_type_code
118 ,accounting_method_code
119 ,amb_context_code
120 ,application_id
121 ,product_rule_type_code
122 ,product_rule_code
123 ,start_date_active
124 ,end_date_active
125 FROM xla_acctg_method_rules
126 WHERE acctg_method_rule_id = x_acctg_method_rule_id
127 FOR UPDATE OF accounting_method_type_code NOWAIT;
128
129 recinfo c%ROWTYPE;
130
131 BEGIN
132 xla_utility_pkg.trace('> .lock_row' ,20);
133
134 OPEN c;
135 FETCH c INTO recinfo;
136
137 IF (c%NOTFOUND) THEN
138 CLOSE c;
139 fnd_message.set_name('FND', 'FORM_RECORD_DELETED');
140 app_exception.raise_exception;
141 END IF;
142 CLOSE c;
143
144 IF ( (recinfo.accounting_method_type_code = x_accounting_method_type_code)
145 AND (recinfo.accounting_method_code = x_accounting_method_code)
146 AND (recinfo.application_id = x_application_id)
147 AND (recinfo.amb_context_code = x_amb_context_code)
148 AND (recinfo.product_rule_type_code = x_product_rule_type_code)
149 AND (recinfo.product_rule_code = x_product_rule_code)
150 AND (recinfo.start_date_active = x_start_date_active)
151 AND ((recinfo.end_date_active = x_end_date_active)
152 OR ((recinfo.end_date_active IS NULL)
153 AND (x_end_date_active IS NULL)))
154 ) THEN
155 null;
156 ELSE
157 fnd_message.set_name('FND', 'FORM_RECORD_CHANGED');
158 app_exception.raise_exception;
159 END IF;
160
161 xla_utility_pkg.trace('< .lock_row' ,20);
162 RETURN;
163
164 END lock_row;
165
166 /*======================================================================+
167 | |
168 | Procedure update_row |
169 | |
170 +======================================================================*/
171 PROCEDURE update_row
172 (x_rowid IN OUT NOCOPY VARCHAR2
173 ,x_acctg_method_rule_id IN NUMBER
174 ,x_amb_context_code IN VARCHAR2
175 ,x_accounting_method_type_code IN VARCHAR2
176 ,x_accounting_method_code IN VARCHAR2
177 ,x_application_id IN NUMBER
178 ,x_product_rule_type_code IN VARCHAR2
179 ,x_product_rule_code IN VARCHAR2
180 ,x_start_date_active IN DATE
181 ,x_end_date_active IN DATE
182 ,x_last_update_date IN DATE
183 ,x_last_updated_by IN NUMBER
184 ,x_last_update_login IN NUMBER)
185
186 IS
187
188 BEGIN
189 xla_utility_pkg.trace('> .update_row' ,20);
190 UPDATE xla_acctg_method_rules
191 SET
192 product_rule_type_code = x_product_rule_type_code
193 ,product_rule_code = x_product_rule_code
194 ,last_update_date = x_last_update_date
195 ,start_date_active = x_start_date_active
196 ,end_date_active = x_end_date_active
197 ,last_updated_by = x_last_updated_by
198 ,last_update_login = x_last_update_login
199 WHERE acctg_method_rule_id = x_acctg_method_rule_id;
200
201 IF (SQL%NOTFOUND) THEN
202 RAISE NO_DATA_FOUND;
203 END IF;
204
205 xla_utility_pkg.trace('< .update_row' ,20);
206 END update_row;
207
208 /*======================================================================+
209 | |
210 | Procedure delete_row |
211 | |
212 +======================================================================*/
213 PROCEDURE delete_row
214 (x_acctg_method_rule_id IN NUMBER)
215
216 IS
217
218 BEGIN
219 xla_utility_pkg.trace('> .delete_row' ,20);
220 DELETE FROM xla_acctg_method_rules
221 WHERE acctg_method_rule_id = x_acctg_method_rule_id;
222
223 IF (SQL%NOTFOUND) THEN
224 RAISE NO_DATA_FOUND;
225 END IF;
226
227 xla_utility_pkg.trace('< .delete_row' ,20);
228 END delete_row;
229
230 end xla_acctg_method_rules_f_pkg;