[Home] [Help]
PACKAGE BODY: APPS.HR_NZ_PERSON_ADDRESS_API
Source
1 PACKAGE BODY hr_nz_person_address_api AS
2 /* $Header: hrnzwrpa.pkb 120.2 2005/10/05 22:30:39 rpalli noship $ */
3
4 -- Package Variables
5 --
6 g_package VARCHAR2(33) := 'hr_nz_person_address_api.';
7
8 --------------------------------------------------------------------------
9 -- create_nz_person_address
10 --------------------------------------------------------------------------
11 PROCEDURE create_nz_person_address
12 (p_validate IN BOOLEAN DEFAULT FALSE
13 ,p_effective_date IN DATE
14 ,p_pradd_ovlapval_override IN BOOLEAN DEFAULT FALSE
15 ,p_validate_county IN BOOLEAN DEFAULT TRUE
16 ,p_person_id IN NUMBER
17 ,p_primary_flag IN VARCHAR2
18 ,p_date_from IN DATE
19 ,p_date_to IN DATE DEFAULT NULL
20 ,p_address_type IN VARCHAR2 DEFAULT NULL
21 ,p_comments IN LONG DEFAULT NULL
22 ,p_address_line1 IN VARCHAR2
23 ,p_address_line2 IN VARCHAR2 DEFAULT NULL
24 ,p_address_line3 IN VARCHAR2 DEFAULT NULL
25 ,p_town_or_city IN VARCHAR2 DEFAULT NULL
26 ,p_region_1 IN VARCHAR2 DEFAULT NULL
27 ,p_region_2 IN VARCHAR2 DEFAULT NULL
28 ,p_region_3 IN VARCHAR2 DEFAULT NULL
29 ,p_postcode IN VARCHAR2 DEFAULT NULL
30 ,p_country IN VARCHAR2
31 ,p_telephone_number_1 IN VARCHAR2 DEFAULT NULL
32 ,p_telephone_number_2 IN VARCHAR2 DEFAULT NULL
33 ,p_telephone_number_3 IN VARCHAR2 DEFAULT NULL
34 ,p_addr_attribute_category IN VARCHAR2 DEFAULT NULL
35 ,p_addr_attribute1 IN VARCHAR2 DEFAULT NULL
36 ,p_addr_attribute2 IN VARCHAR2 DEFAULT NULL
37 ,p_addr_attribute3 IN VARCHAR2 DEFAULT NULL
38 ,p_addr_attribute4 IN VARCHAR2 DEFAULT NULL
39 ,p_addr_attribute5 IN VARCHAR2 DEFAULT NULL
40 ,p_addr_attribute6 IN VARCHAR2 DEFAULT NULL
41 ,p_addr_attribute7 IN VARCHAR2 DEFAULT NULL
42 ,p_addr_attribute8 IN VARCHAR2 DEFAULT NULL
43 ,p_addr_attribute9 IN VARCHAR2 DEFAULT NULL
44 ,p_addr_attribute10 IN VARCHAR2 DEFAULT NULL
45 ,p_addr_attribute11 IN VARCHAR2 DEFAULT NULL
46 ,p_addr_attribute12 IN VARCHAR2 DEFAULT NULL
47 ,p_addr_attribute13 IN VARCHAR2 DEFAULT NULL
48 ,p_addr_attribute14 IN VARCHAR2 DEFAULT NULL
49 ,p_addr_attribute15 IN VARCHAR2 DEFAULT NULL
50 ,p_addr_attribute16 IN VARCHAR2 DEFAULT NULL
51 ,p_addr_attribute17 IN VARCHAR2 DEFAULT NULL
52 ,p_addr_attribute18 IN VARCHAR2 DEFAULT NULL
53 ,p_addr_attribute19 IN VARCHAR2 DEFAULT NULL
54 ,p_addr_attribute20 IN VARCHAR2 DEFAULT NULL
55 ,p_add_information13 IN VARCHAR2 DEFAULT NULL
56 ,p_add_information14 IN VARCHAR2 DEFAULT NULL
57 ,p_add_information15 IN VARCHAR2 DEFAULT NULL
58 ,p_add_information16 IN VARCHAR2 DEFAULT NULL
59 ,p_add_information17 IN VARCHAR2 DEFAULT NULL
60 ,p_add_information18 IN VARCHAR2 DEFAULT NULL
61 ,p_add_information19 IN VARCHAR2 DEFAULT NULL
62 ,p_add_information20 IN VARCHAR2 DEFAULT NULL
63 ,p_party_id IN NUMBER DEFAULT NULL
64 ,p_address_id OUT NOCOPY NUMBER
65 ,p_object_version_number OUT NOCOPY NUMBER
66 ) IS
67 --
68 -- Declare cursors and local variables
69 --
70 l_proc VARCHAR2(72) := g_package||'create_nz_person_address';
71 --
72 BEGIN
73 hr_utility.set_location('Entering:'|| l_proc, 5);
74 --
75 -- Create Person Address details.
76 --
77 hr_person_address_api.create_person_address
78 (p_validate => p_validate
79 ,p_effective_date => p_effective_date
80 ,p_pradd_ovlapval_override => p_pradd_ovlapval_override
81 ,p_validate_county => p_validate_county
82 ,p_person_id => p_person_id
83 ,p_primary_flag => p_primary_flag
84 ,p_style => 'NZ_GLB'
85 ,p_date_from => p_date_from
86 ,p_date_to => p_date_to
87 ,p_address_type => p_address_type
88 ,p_comments => p_comments
89 ,p_address_line1 => p_address_line1
90 ,p_address_line2 => p_address_line2
91 ,p_address_line3 => p_address_line3
92 ,p_town_or_city => p_town_or_city
93 ,p_region_1 => p_region_1
94 ,p_region_2 => p_region_2
95 ,p_region_3 => p_region_3
96 ,p_postal_code => p_postcode
97 ,p_country => p_country
98 ,p_telephone_number_1 => p_telephone_number_1
99 ,p_telephone_number_2 => p_telephone_number_2
100 ,p_telephone_number_3 => p_telephone_number_3
101 ,p_addr_attribute_category => p_addr_attribute_category
102 ,p_addr_attribute1 => p_addr_attribute1
103 ,p_addr_attribute2 => p_addr_attribute2
104 ,p_addr_attribute3 => p_addr_attribute3
105 ,p_addr_attribute4 => p_addr_attribute4
106 ,p_addr_attribute5 => p_addr_attribute5
107 ,p_addr_attribute6 => p_addr_attribute6
108 ,p_addr_attribute7 => p_addr_attribute7
109 ,p_addr_attribute8 => p_addr_attribute8
110 ,p_addr_attribute9 => p_addr_attribute9
111 ,p_addr_attribute10 => p_addr_attribute10
112 ,p_addr_attribute11 => p_addr_attribute11
113 ,p_addr_attribute12 => p_addr_attribute12
114 ,p_addr_attribute13 => p_addr_attribute13
115 ,p_addr_attribute14 => p_addr_attribute14
116 ,p_addr_attribute15 => p_addr_attribute15
117 ,p_addr_attribute16 => p_addr_attribute16
118 ,p_addr_attribute17 => p_addr_attribute17
119 ,p_addr_attribute18 => p_addr_attribute18
120 ,p_addr_attribute19 => p_addr_attribute19
121 ,p_addr_attribute20 => p_addr_attribute20
122 ,p_add_information13 => p_add_information13
123 ,p_add_information14 => p_add_information14
124 ,p_add_information15 => p_add_information15
125 ,p_add_information16 => p_add_information16
126 ,p_add_information17 => p_add_information17
127 ,p_add_information18 => p_add_information18
128 ,p_add_information19 => p_add_information19
129 ,p_add_information20 => p_add_information20
130 ,p_party_id => p_party_id
131 ,p_address_id => p_address_id
132 ,p_object_version_number => p_object_version_number
133 );
134 --
135 hr_utility.set_location(' Leaving:'||l_proc, 10);
136 END create_nz_person_address;
137 --
138
139 --------------------------------------------------------------------------
140 -- update_nz_person_address
141 --------------------------------------------------------------------------
142 PROCEDURE update_nz_person_address
143 (p_validate IN BOOLEAN DEFAULT FALSE
144 ,p_effective_date IN DATE
145 ,p_validate_county IN BOOLEAN DEFAULT TRUE
146 ,p_address_id IN NUMBER
147 ,p_object_version_number IN OUT NOCOPY NUMBER
148 ,p_date_from IN DATE DEFAULT hr_api.g_date
149 ,p_date_to IN DATE DEFAULT hr_api.g_date
150 ,p_primary_flag IN VARCHAR2 DEFAULT hr_api.g_varchar2
151 ,p_address_type IN VARCHAR2 DEFAULT hr_api.g_varchar2
152 ,p_comments IN LONG DEFAULT hr_api.g_varchar2
153 ,p_address_line1 IN VARCHAR2 DEFAULT hr_api.g_varchar2
154 ,p_address_line2 IN VARCHAR2 DEFAULT hr_api.g_varchar2
155 ,p_address_line3 IN VARCHAR2 DEFAULT hr_api.g_varchar2
156 ,p_town_or_city IN VARCHAR2 DEFAULT hr_api.g_varchar2
157 ,p_region_1 IN VARCHAR2 DEFAULT hr_api.g_varchar2
158 ,p_region_2 IN VARCHAR2 DEFAULT hr_api.g_varchar2
159 ,p_region_3 IN VARCHAR2 DEFAULT hr_api.g_varchar2
160 ,p_postcode IN VARCHAR2 DEFAULT hr_api.g_varchar2
161 ,p_country IN VARCHAR2 DEFAULT hr_api.g_varchar2
162 ,p_telephone_number_1 IN VARCHAR2 DEFAULT hr_api.g_varchar2
163 ,p_telephone_number_2 IN VARCHAR2 DEFAULT hr_api.g_varchar2
164 ,p_telephone_number_3 IN VARCHAR2 DEFAULT hr_api.g_varchar2
165 ,p_addr_attribute_category IN VARCHAR2 DEFAULT hr_api.g_varchar2
166 ,p_addr_attribute1 IN VARCHAR2 DEFAULT hr_api.g_varchar2
167 ,p_addr_attribute2 IN VARCHAR2 DEFAULT hr_api.g_varchar2
168 ,p_addr_attribute3 IN VARCHAR2 DEFAULT hr_api.g_varchar2
169 ,p_addr_attribute4 IN VARCHAR2 DEFAULT hr_api.g_varchar2
170 ,p_addr_attribute5 IN VARCHAR2 DEFAULT hr_api.g_varchar2
171 ,p_addr_attribute6 IN VARCHAR2 DEFAULT hr_api.g_varchar2
172 ,p_addr_attribute7 IN VARCHAR2 DEFAULT hr_api.g_varchar2
173 ,p_addr_attribute8 IN VARCHAR2 DEFAULT hr_api.g_varchar2
174 ,p_addr_attribute9 IN VARCHAR2 DEFAULT hr_api.g_varchar2
175 ,p_addr_attribute10 IN VARCHAR2 DEFAULT hr_api.g_varchar2
176 ,p_addr_attribute11 IN VARCHAR2 DEFAULT hr_api.g_varchar2
177 ,p_addr_attribute12 IN VARCHAR2 DEFAULT hr_api.g_varchar2
178 ,p_addr_attribute13 IN VARCHAR2 DEFAULT hr_api.g_varchar2
179 ,p_addr_attribute14 IN VARCHAR2 DEFAULT hr_api.g_varchar2
180 ,p_addr_attribute15 IN VARCHAR2 DEFAULT hr_api.g_varchar2
181 ,p_addr_attribute16 IN VARCHAR2 DEFAULT hr_api.g_varchar2
182 ,p_addr_attribute17 IN VARCHAR2 DEFAULT hr_api.g_varchar2
183 ,p_addr_attribute18 IN VARCHAR2 DEFAULT hr_api.g_varchar2
184 ,p_addr_attribute19 IN VARCHAR2 DEFAULT hr_api.g_varchar2
185 ,p_addr_attribute20 IN VARCHAR2 DEFAULT hr_api.g_varchar2
186 ,p_add_information13 IN VARCHAR2 DEFAULT hr_api.g_varchar2
187 ,p_add_information14 IN VARCHAR2 DEFAULT hr_api.g_varchar2
188 ,p_add_information15 IN VARCHAR2 DEFAULT hr_api.g_varchar2
189 ,p_add_information16 IN VARCHAR2 DEFAULT hr_api.g_varchar2
190 ,p_add_information17 IN VARCHAR2 DEFAULT hr_api.g_varchar2
191 ,p_add_information18 IN VARCHAR2 DEFAULT hr_api.g_varchar2
192 ,p_add_information19 IN VARCHAR2 DEFAULT hr_api.g_varchar2
193 ,p_add_information20 IN VARCHAR2 DEFAULT hr_api.g_varchar2
194 ,p_party_id IN NUMBER DEFAULT hr_api.g_number
195 ) IS
196 --
197 -- Declare cursors and local variables
198 --
199 l_proc VARCHAR2(72) := g_package||'update_nz_person_address';
200 l_style per_addresses.style%TYPE;
201 --
202 CURSOR csr_add_style IS
203 SELECT addr.style
204 FROM per_addresses addr
205 WHERE addr.address_id = p_address_id;
206 --
207 BEGIN
208 hr_utility.set_location('Entering:'|| l_proc, 5);
209 --
210 -- Check that the Address identified is NZ style.
211 --
212 OPEN csr_add_style;
213 FETCH csr_add_style INTO l_style;
214 IF (csr_add_style%NOTFOUND)
215 THEN
216 CLOSE csr_add_style;
217 --
218 hr_utility.set_location(l_proc, 7);
219 --
220 hr_utility.set_message(801, 'HR_7220_INVALID_PRIMARY_KEY');
221 hr_utility.raise_error;
222 --
223 ELSE
224 --
225 CLOSE csr_add_style;
226 --
227 IF (l_style <> 'NZ_GLB') THEN
228 --
229 hr_utility.set_location(l_proc, 8);
230 --
231 hr_utility.set_message(801, 'HR_7788_ADD_INV_NOT_NZ_STYLE');
232 hr_utility.raise_error;
233 --
234 END IF;
235 END IF;
236 --
237 hr_utility.set_location(l_proc, 9);
238 --
239 -- Update Person Address details.
240 --
241 hr_person_address_api.update_person_address
242 (p_validate => p_validate
243 ,p_effective_date => p_effective_date
244 ,p_validate_county => p_validate_county
245 ,p_address_id => p_address_id
246 ,p_object_version_number => p_object_version_number
247 ,p_date_from => p_date_from
248 ,p_date_to => p_date_to
249 ,p_primary_flag => p_primary_flag
250 ,p_address_type => p_address_type
251 ,p_comments => p_comments
252 ,p_address_line1 => p_address_line1
253 ,p_address_line2 => p_address_line2
254 ,p_address_line3 => p_address_line3
255 ,p_town_or_city => p_town_or_city
256 ,p_region_1 => p_region_1
257 ,p_region_2 => p_region_2
258 ,p_region_3 => p_region_3
259 ,p_postal_code => p_postcode
260 ,p_country => p_country
261 ,p_telephone_number_1 => p_telephone_number_1
262 ,p_telephone_number_2 => p_telephone_number_2
263 ,p_telephone_number_3 => p_telephone_number_3
264 ,p_addr_attribute_category => p_addr_attribute_category
265 ,p_addr_attribute1 => p_addr_attribute1
266 ,p_addr_attribute2 => p_addr_attribute2
267 ,p_addr_attribute3 => p_addr_attribute3
268 ,p_addr_attribute4 => p_addr_attribute4
269 ,p_addr_attribute5 => p_addr_attribute5
270 ,p_addr_attribute6 => p_addr_attribute6
271 ,p_addr_attribute7 => p_addr_attribute7
272 ,p_addr_attribute8 => p_addr_attribute8
273 ,p_addr_attribute9 => p_addr_attribute9
274 ,p_addr_attribute10 => p_addr_attribute10
275 ,p_addr_attribute11 => p_addr_attribute11
276 ,p_addr_attribute12 => p_addr_attribute12
277 ,p_addr_attribute13 => p_addr_attribute13
278 ,p_addr_attribute14 => p_addr_attribute14
279 ,p_addr_attribute15 => p_addr_attribute15
280 ,p_addr_attribute16 => p_addr_attribute16
281 ,p_addr_attribute17 => p_addr_attribute17
282 ,p_addr_attribute18 => p_addr_attribute18
283 ,p_addr_attribute19 => p_addr_attribute19
284 ,p_addr_attribute20 => p_addr_attribute20
285 ,p_add_information13 => p_add_information13
286 ,p_add_information14 => p_add_information14
287 ,p_add_information15 => p_add_information15
288 ,p_add_information16 => p_add_information16
289 ,p_add_information17 => p_add_information17
290 ,p_add_information18 => p_add_information18
291 ,p_add_information19 => p_add_information19
292 ,p_add_information20 => p_add_information20
293 ,p_party_id => p_party_id
294 );
295 hr_utility.set_location(' Leaving:'||l_proc, 11);
296 END update_nz_person_address;
297
298 END hr_nz_person_address_api;