DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_STORE_TIMECARD_PKG_GRP

Source


1 PACKAGE BODY PO_STORE_TIMECARD_PKG_GRP AS
2 /* $Header: POXGSTCB.pls 120.2.12020000.2 2013/05/28 06:32:27 shikapoo ship $ */
3 
4 --  *** PRIVATE PROCEDURES  **
5 
6 /*  8i compatibility issue.  Commenting out
7 function  add_error (
8         p_rtrvd_tcs PO_RTRVD_TCS_REC
9     ) return PO_RTRVD_TCS_ERR_REC
10     IS
11       tc_id           po_tbl_number;
12       tc_day_id       po_tbl_number;
13       tc_detail_id    po_tbl_number;
14       po_number       po_tbl_varchar20;
15       line_number     po_tbl_number;
16       original_index   po_tbl_number;
17       msg_data        po_tbl_varchar2000;
18       msg_cnt number;
19       errors  NUMBER;
20       err_index  number;
21     begin
22 
23     errors := SQL%BULK_EXCEPTIONS.COUNT;
24 
25        --dbms_output.put_line('Number of errors is ' || errors);
26        FOR i IN 1..errors LOOP
27                err_index := SQL%BULK_EXCEPTIONS(i).ERROR_INDEX;
28                tc_id.extend;
29 	       tc_day_id.extend;
30 	       tc_detail_id.extend;
31 	       po_number.extend;
32 	       line_number.extend;
33 	       original_index.extend;
34 	       msg_data.extend;
35 
36 	       msg_cnt := msg_data.count;
37 
38 	       tc_id(msg_cnt) := p_rtrvd_tcs.tc_id(err_index);
39 	       tc_day_id(msg_cnt) := p_rtrvd_tcs.tc_day_id(err_index);
40 	       tc_detail_id(msg_cnt) := p_rtrvd_tcs.tc_detail_id(err_index);
41 	       po_number(msg_cnt) := p_rtrvd_tcs.po_number(err_index);
42 	       line_number(msg_cnt) := p_rtrvd_tcs.po_line_number(err_index);
43 	       original_index(msg_cnt) := err_index;
44 	       msg_data(msg_cnt) := SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE);
45 
46 
47          / *  old comment
48           dbms_output.put_line('Error ' || i || ' occurred during '||
49              'iteration ' || SQL%BULK_EXCEPTIONS(i).ERROR_INDEX);
50           dbms_output.put_line('Oracle error is ' ||
51              SQLERRM(-SQL%BULK_EXCEPTIONS(i).ERROR_CODE));
52          * /
53    END LOOP;
54 
55     return (PO_RTRVD_TCS_ERR_REC(tc_id  => tc_id,
56                                  tc_day_id  => tc_day_id,
57                                  tc_detail_id => tc_detail_id,
58                                  po_number  => po_number,
59                                  line_number => line_number,
60                                  original_index => original_index,
61                                  msg_data   => msg_data
62                                 ));
63 
64    end add_error;
65 
66 end of 8i compatibility issue
67 */
68 --  *** PUBLIC PROCEDURES  **
69 procedure initGlobals
70 is
71 begin
72   g_cur_po_header_id := null;
73   g_cur_po_line_id := null;
74 end initGlobals;
75 
76 function isFirstOccurance(p_po_header_id number, p_po_line_id number)
77     return number is
78     begin
79     if (p_po_header_id = g_cur_po_header_id and p_po_line_id = g_cur_po_line_id) then
80       return 1;
81     else
82       g_cur_po_header_id := p_po_header_id;
83       g_cur_po_line_id := p_po_line_id;
84       return 0;
85     end if;
86 end ;
87 
88 procedure store_timecard_details
89 	(
90 	p_api_version	number,
91 	x_return_status	out NOCOPY varchar2,
92 	x_msg_data      out NOCOPY varchar2,
93 	p_vendor_id	number,
94 	p_vendor_site_id	number,
95 	p_vendor_contact_id	number,
96 	p_po_num	varchar2,
97 	p_po_line_number	number,
98 	p_org_id	number,
99 	p_project_id	number,
100 	p_task_id	number,
101 	p_tc_id	number, --building_block_id for timecards
102 	p_tc_day_id	number,  --building_block_id for timecard days
103 	p_tc_detail_id	number,  -- building_block_id for details
104 	p_tc_uom	varchar2,  --mostly Hours
105 	p_tc_Start_date	date,   --Timecard start date
106 	p_tc_end_date	date,  --Timecard end date
107 	p_tc_entry_date	date, --date the worker worked
108 	p_tc_time_received	number, --number of hours worked
109 	p_tc_approval_status varchar2,
110 	p_tc_approval_date  date,
111 	p_tc_submission_date date,
112 	p_contingent_worker_id	number, --worker id
113 	p_tc_comment_text	varchar2, --tc comment
114 	p_line_rate_type	varchar2,  -- Regular, Overtime
115 	p_line_rate	number,
116 	p_action  VARCHAR2,
117 	p_interface_transaction_id number
118 	) is
119   l_po_header_id  number;
120   l_po_currency varchar2(15);
121   l_po_creation_date  date;
122   l_po_line_id number;
123   l_po_line_number number;
124   l_contractor_full_name varchar2(500);
125   l_contractor_first_name varchar2(240);
126   l_contractor_last_name varchar2(240);
127   l_project_name  varchar2(255);
128   l_task_number   varchar2(255);
129   l_line_rate	number;
130   l_stage  varchar2(2000);
131   l_vendor_id  number;
132   l_vendor_site_id number;
133   l_action  varchar2(2);
134   l_po_number varchar2(20);
135   l_org_id number;
136   l_tc_approved_date  date;
137   l_tc_uom  varchar2(30);
138   l_tc_start_date date;
139   l_tc_end_date date;
140   l_tc_entry_date date;
141   l_contingent_worker_id number;
142   l_line_rate_type varchar2(30);
143   l_tc_entry_seq  number;
144 
145   l_get_fresh varchar2(1) := 'N';
146   -- Bug6391432
147   -- To avoid the no data found for a zero amount time card correction
148   -- added up the logic to catch NO_DATA_FOUND exception and treat the
149   -- update action as insert action for timecards which had zero amount
150   -- when making a insert in ISP table and didnt went into ISP table.
151   begin
152 
153        if (upper(p_action) = 'UPDATE' OR upper(p_action) = 'DELETE') then
154            --Get the mandatory data to create a new row with the above action.
155            l_stage := 'Getting ready to UPDATE or DELETE';
156 	   Begin
157            select VENDOR_ID, VENDOR_SITE_ID, PO_HEADER_ID, PO_NUMBER, PO_LINE_ID, PO_LINE_NUMBER,
158                   ORG_ID, PO_CREATION_DATE,
159 	     	         PO_CONTRACTOR_FULL_NAME, TC_UOM, TC_APPROVED_DATE,
160 	     	         TC_START_DATE, TC_ENTRY_DATE, TC_END_DATE,
161 	     	         CONTINGENT_WORKER_ID, LINE_RATE_TYPE, LINE_RATE, LINE_RATE_CURRENCY
162 	     	    into l_vendor_id, l_vendor_site_id, l_po_header_id, l_po_number,
163 	     	         l_po_line_id, l_po_line_number,
164 	     	         l_org_id, l_po_creation_date,
165 	     	         l_contractor_full_name, l_tc_uom, l_tc_approved_date,
166 	     	         l_tc_start_date, l_tc_entry_date, l_tc_end_date,
167 	     	         l_contingent_worker_id, l_line_rate_type, l_line_rate, l_po_currency
168 	     	    from po_retrieved_timecards
169   	           where tc_detail_id = p_tc_detail_id and tc_day_id = p_tc_day_id and
170   	                 tc_id = p_tc_id and rownum = 1;  --all we need is mandatory data; so first row is sufficient.
171   	   EXCEPTION
172  	                  WHEN No_Data_Found THEN
173  	                     l_get_fresh := 'Y';
174  	   END;
175 	   l_stage := 'Got data for UPDATE or DELETE';
176   	   END IF;
177   	   IF ( (NOT (upper(p_action) = 'UPDATE' OR upper(p_action) = 'DELETE') ) OR
178  	          l_get_fresh = 'Y') THEN
179   	        l_action := 'I';
180   	        l_stage := 'Getting ready for INSERT';
181 
182   	       	 select po_header_id, currency_code, creation_date,
183 	   	            vendor_id, vendor_site_id
184 	           into l_po_header_id, l_po_currency, l_po_creation_date,
185 	   	            l_vendor_id, l_vendor_site_id
186 	           from po_headers_all
187   	          where segment1 = p_po_num and org_id = p_org_id;
188 
189               l_stage := 'Getting the line id';
190 	          SELECT po_line_id
191 	            INTO l_PO_LINE_ID
192 	            FROM  po_lines_all pla
193 	           WHERE pla.po_header_id = l_po_header_id
194                  AND pla.line_num = p_po_line_number;
195 
196 
197 
198               if (p_line_rate is null or p_line_rate = 0) then
199 
200                  l_stage := 'getting the line rate';
201   	             SELECT ptlv.rate_value
202 	               INTO l_line_rate
203 	               FROM po_temp_labor_rates_v ptlv, po_lines_all pla
204                   WHERE ptlv.po_line_id = pla.po_line_id
205                     AND ptlv.asg_rate_type = p_line_rate_type
206                     AND pla.po_header_id = l_po_header_id
207                     AND pla.line_num = p_po_line_number;
208              else
209                  l_line_rate := p_line_rate;
210              end if;
211 
212   	         if (p_contingent_worker_id is not null) then
213   	             l_stage := 'getting the contingent worker';
214 		     -- Bug6391432
215  	             -- Use per_all_people_f instead of per_people_f because of security settings
216  	             -- for this responsibility/user settings, some of the resource ids may not be
217  	             -- eligible for the per_people_f view criteria. which in turn will fail the query.
218   	             select first_name || last_name contractor_full_name,
219 	   	                first_name, last_name
220 	     	       into l_contractor_full_name,
221 	   	                l_contractor_first_name, l_contractor_last_name
222 	   	           from per_all_people_f
223   	              where person_id = p_contingent_worker_id and
224   	                    sysdate between effective_start_date and effective_end_date;
225   	          end if;
226 
227               if (p_project_id is not null) then
228   	             l_stage := 'getting the project id';
229   	             select SEGMENT1
230   	               into l_project_name
231   	               from PA_PROJECTS_ALL
232   	              where project_id = p_project_id;
233 
234                       -- Bug 16841557, replaced the call of pa_tasks with
235                       --pa_tasks_expend_v as part of CBS project.
236   	              if (p_task_id is not null) then
237   	                 l_stage := 'getting the task id';
238   	                 select TASK_NUMBER
239   	                   into l_task_number
240   	                   from pa_tasks_expend_v
241   	                  where project_id = p_project_id and task_id = p_task_id;
242   	               end if;
243 
244               end if;
245           /* set the local vars right to get ready to insert */
246           l_stage := 'Getting some misc data before INSERT';
247           l_po_number := p_PO_NUM;
248           l_po_line_number := p_po_line_number;
249           l_ORG_ID := p_ORG_ID;
250           l_TC_UOM := p_TC_UOM;
251           l_TC_START_DATE := p_TC_START_DATE;
252 	      l_TC_END_DATE := p_TC_END_DATE;
253 	      l_TC_ENTRY_DATE := p_TC_ENTRY_DATE;
254 	      l_tc_approved_date := p_TC_APPROVAL_DATE;
255 	      l_CONTINGENT_WORKER_ID := p_CONTINGENT_WORKER_ID;
256 	      l_LINE_RATE_TYPE := p_LINE_RATE_TYPE;
257 
258 
259        end if;  --end of if insert
260 
261   	if (upper(p_action) = 'UPDATE') then
262   	  l_stage := 'updating';
263   	  /*
264   	  update PO_RETRIEVED_TIMECARDS
265   	  set tc_time_received = p_tc_time_received, tc_comment_text = p_tc_comment_text,
266   	      line_rate_type = p_line_rate_type, line_rate =  p_line_rate
267   	  where tc_detail_id = p_tc_detail_id and tc_day_id = p_tc_day_id and tc_id = p_tc_id;
268   	  */
269 
270 
271   	  l_action := 'U';
272   	elsif (upper(p_action) = 'DELETE') then
273   	  l_stage := 'deleting';
274   	  l_action := 'D';
275   	  /*
276   	  delete PO_RETRIEVED_TIMECARDS
277   	  where tc_detail_id = p_tc_detail_id and tc_day_id = p_tc_day_id and tc_id = p_tc_id;
278   	  */
279     end if;
280 
281     select po_timecards_entry_s.nextval into l_tc_entry_seq  from dual;
282     l_stage := 'inserting';
283 
284   	insert into PO_RETRIEVED_TIMECARDS
285   	(
286   	  PO_HEADER_ID,
287 	  PO_NUMBER,
288 	  PO_LINE_ID,
289 	  PO_LINE_NUMBER,
290 	  ORG_ID,
291 	  PO_CREATION_DATE,
292 	  PO_CONTRACTOR_FULL_NAME,
293 	  PROJECT_ID,
294 	  PROJECT_NAME,
295 	  TASK_ID,
296 	  TASK_NAME,
297 	  TC_ID,
298 	  TC_DAY_ID,
299 	  TC_DETAIL_ID,
300 	  TC_SCOPE,
301 	  TC_UOM,
302 	  TC_START_DATE,
303 	  TC_END_DATE,
304 	  TC_ENTRY_DATE,
305 	  TC_TIME_RECEIVED,
306 	  TC_SUBMISSION_DATE,
307 	  TC_APPROVED_DATE,
308 	  TC_APPROVAL_STATUS,
309 	  CONTINGENT_WORKER_ID,
310 	  TC_COMMENT_TEXT,
311 	  LINE_RATE_TYPE,
312 	  LINE_RATE,
313 	  LINE_RATE_CURRENCY,
314 	  VENDOR_ID,
315 	  VENDOR_SITE_ID,
316 	  VENDOR_CONTACT_ID,
317 	  PO_CONTRACTOR_FIRST_NAME,
318       PO_CONTRACTOR_LAST_NAME,
319       INTERFACE_TRANSACTION_ID,
320       ACTION_FLAG,
321       TC_ENTRY_SEQUENCE
322   	)
323   	values
324   	(
325   	 l_PO_HEADER_ID,
326 	 l_PO_NUMBER,
327 	 l_PO_LINE_ID,
328 	 l_PO_LINE_NUMBER,
329 	 l_ORG_ID,
330      l_po_creation_date,
331 	 l_CONTRACTOR_FULL_NAME,
332      p_PROJECT_ID,
333 	 l_PROJECT_NAME,
334 	 p_TASK_ID,
335 	 l_TASK_NUMBER,
336 	 p_TC_ID,
337 	 p_TC_DAY_ID,
338 	 p_TC_DETAIL_ID,
339      'DETAIL',
340 	 l_TC_UOM,
341 	 l_TC_START_DATE,
342 	 l_TC_END_DATE,
343 	 l_TC_ENTRY_DATE,
344 	 p_TC_TIME_RECEIVED,
345 	 p_TC_SUBMISSION_DATE,
346 	 l_tc_approved_date,
347 	 p_TC_APPROVAL_STATUS,
348 	 l_CONTINGENT_WORKER_ID,
349 	 p_TC_COMMENT_TEXT,
350 	 l_LINE_RATE_TYPE,
351 	 l_LINE_RATE,
352 	 l_PO_CURRENCY,
353 	 l_VENDOR_ID,
354 	 l_VENDOR_SITE_ID,
355 	 p_VENDOR_CONTACT_ID,
356 	 l_contractor_first_name,
357      l_contractor_last_name,
358      p_interface_transaction_id,
359      l_action,
360      l_tc_entry_seq
361   	);
362 
363   	x_return_status := FND_API.G_RET_STS_SUCCESS;
364 
365   	--Do not commit
366 
367   	exception
368   	when others then
369   	x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
370 	x_msg_data  := 'Action = ' || p_action || 'Stage = ' || l_stage ||  ' PO Number: ' || p_po_num ||
371 	               ' Line : ' || to_char(p_po_line_number) ||
372 	               ' TC_ID : ' || to_char (p_tc_id) ||
373 	               ' TC_DAY_ID : ' || to_char(p_tc_day_id) ||
374 	               ' TC_DETAIL_ID : ' || to_char(p_tc_detail_id) ||
375 	               ' Error : ' || SQLERRM
376 	               ;
377 	-- dbms_output.put_line(SQLERRM);
378 
379 end store_timecard_details;
380 
381 
382  procedure reconcile_actions (p_api_version number,
383                               x_return_status  out NOCOPY varchar2,
384                               x_msg_data       out NOCOPY varchar2
385                               )
386  is
387  cursor  reconcile_csr is
388    select /*+ PO_RETRIEVED_TIMECARDS_N6 */ tc_id, tc_day_id, tc_detail_id,
389           action_flag, tc_time_received,
390           tc_comment_text, interface_transaction_id
391      from po_retrieved_timecards
392      where action_flag in ('I', 'U', 'D')
393      order by TC_ENTRY_SEQUENCE;
394 
395  l_tc_id number;
396  l_tc_day_id number;
397  l_tc_detail_id number;
398  l_action_flag varchar2(2);
399  l_tc_time_received number;
400  l_tc_comment_text varchar2(2000);
401  l_transaction_id  number;
402 
403  begin
404 
405  --First cleanup all the failed transactions from the po_retrieved_timecards.
406  delete /*+ PO_RETRIEVED_TIMECARDS_N6 */po_retrieved_timecards prt
407     where action_flag in ('I', 'U', 'D') and
408           not exists (select interface_transaction_id from rcv_transactions
409                       where interface_transaction_id = prt.interface_transaction_id);
410 
411   --now we will reconcile the succsful transactions.
412   open reconcile_csr;
413   loop
414 
415     fetch reconcile_csr into
416        l_tc_id, l_tc_day_id, l_tc_detail_id,
417           l_action_flag, l_tc_time_received,
418           l_tc_comment_text, l_transaction_id;
419 
420     exit when reconcile_csr%NOTFOUND;
421 
422 
423     if (l_action_flag = 'I') then
424        update po_retrieved_timecards
425        set action_flag = 'P'
426        where tc_id = l_tc_id and
427              tc_day_id = l_tc_day_id and
428              tc_detail_id = l_tc_detail_id and
429              action_flag = 'I';
430 
431     elsif (l_action_flag = 'U') then
432          update po_retrieved_timecards
433             set tc_time_received = l_tc_time_received,
434                 tc_comment_text = l_tc_comment_text
435           where tc_id = l_tc_id and
436                 tc_day_id = l_tc_day_id and
437                 tc_detail_id = l_tc_detail_id and
438                 action_flag = 'P';
439     elsif (l_action_flag = 'D') then
440          update po_retrieved_timecards
441             set action_flag = 'DP'
442          where tc_id = l_tc_id and
443                tc_day_id = l_tc_day_id and
444                tc_detail_id = l_tc_detail_id and
445                action_flag = 'P';
446 
447     end if;
448 
449   end loop;
450 
451   close reconcile_csr;
452 
453  delete po_retrieved_timecards
454   where action_flag in ('U', 'D');
455 
456 
457    x_return_status := FND_API.G_RET_STS_SUCCESS;
458 
459   	--Do not commit
460 
461 
462  exception
463  when others then
464    x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
465    x_msg_data := ' Error : ' || SQLERRM;
466  end;
467 
468 
469 
470  procedure store_timecard_details_rec (p_api_version number,
471                                    x_return_status	out NOCOPY varchar2,
472 	                           x_msg_data      out NOCOPY varchar2,
473 	                           p_rtrvd_tc  PO_RTRVD_TC_REC,
474                                    p_action	VARCHAR2
475                                   ) is
476  begin
477     store_timecard_details
478     	(
479     	 p_api_version           => p_api_version,
480          x_return_status         => x_return_status,
481     	 x_msg_data              =>x_msg_data,
482     	p_vendor_id              =>p_rtrvd_tc.VENDOR_ID,
483     	p_vendor_site_id         =>p_rtrvd_tc.VENDOR_SITE_ID,
484     	p_vendor_contact_id      =>p_rtrvd_tc.VENDOR_CONTACT_ID,
485     	p_po_num                 =>p_rtrvd_tc.PO_NUMBER,
486     	p_po_line_number         =>p_rtrvd_tc.PO_LINE_NUMBER,
487     	p_org_id                 =>p_rtrvd_tc.ORG_ID,
488     	p_project_id             =>p_rtrvd_tc.PROJECT_ID,
489     	p_task_id                =>p_rtrvd_tc.TASK_ID,
490     	p_tc_id                  =>p_rtrvd_tc.TC_ID,
491     	p_tc_day_id              =>p_rtrvd_tc.TC_DAY_ID,
492     	p_tc_detail_id           =>p_rtrvd_tc.TC_DETAIL_ID ,
493     	p_tc_uom                 =>p_rtrvd_tc.TC_UOM,
494     	p_tc_Start_date          =>p_rtrvd_tc.TC_START_DATE ,
495     	p_tc_end_date            =>p_rtrvd_tc.TC_END_DATE,
496     	p_tc_entry_date          =>p_rtrvd_tc.TC_ENTRY_DATE,
497     	p_tc_time_received       =>p_rtrvd_tc.TC_TIME_RECEIVED,
498     	p_tc_approval_status     =>p_rtrvd_tc.TC_APPROVAL_STATUS,
499     	p_tc_approval_date       =>p_rtrvd_tc.TC_APPROVED_DATE,
500     	p_tc_submission_date     =>p_rtrvd_tc.TC_SUBMISSION_DATE,
501     	p_contingent_worker_id   =>p_rtrvd_tc.CONTINGENT_WORKER_ID,
502     	p_tc_comment_text        =>p_rtrvd_tc.TC_COMMENT_TEXT,
503     	p_line_rate_type         =>p_rtrvd_tc.LINE_RATE_TYPE,
504     	p_line_rate              => p_rtrvd_tc.LINE_RATE,
505         p_action                 => p_action,
506         p_interface_transaction_id       => 0  --this api is not being used currently.
507     	);
508 
509   exception
510   when others then
511     x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
512     x_msg_data := ' Error : ' || SQLERRM;
513  end store_timecard_details_rec;
514 
515 
516 /*  8i compatibility issue.  Commenting out.
517  procedure store_timecard_details_bulk (p_api_version number,
518                                        x_return_status	out NOCOPY varchar2,
519 	                                   x_msg_data      out NOCOPY varchar2,
520 	                                   p_rtrvd_tcs PO_RTRVD_TCS_REC,
521 	                                   p_action varchar2,
522 	                                   x_errs out NOCOPY PO_RTRVD_TCS_ERR_REC)
523 is
524 errors  NUMBER;
525 err_index  number;
526 dml_errors EXCEPTION;
527 PRAGMA exception_init(dml_errors, -24381);
528 begin
529 
530  if (upper(p_action) = 'UPDATE') then
531     forall i in p_rtrvd_tcs.po_number.first..p_rtrvd_tcs.po_number.last
532        SAVE EXCEPTIONS
533   	  update PO_RETRIEVED_TIMECARDS
534   	  set tc_time_received = p_rtrvd_tcs.tc_time_received(i),
535   	      tc_comment_text = p_rtrvd_tcs.tc_comment_text(i),
536   	      line_rate_type = p_rtrvd_tcs.line_rate_type(i),
537   	      line_rate =  p_rtrvd_tcs.line_rate(i)
538   	  where tc_detail_id = p_rtrvd_tcs.tc_detail_id(i) and
539   	        tc_day_id = p_rtrvd_tcs.tc_day_id(i) and
540   	        tc_id = p_rtrvd_tcs.tc_id(i);
541 
542  elsif (upper(p_action) = 'DELETE') then
543  forall i in p_rtrvd_tcs.po_number.first..p_rtrvd_tcs.po_number.last
544      SAVE EXCEPTIONS
545   	  delete PO_RETRIEVED_TIMECARDS
546   	  where tc_detail_id = p_rtrvd_tcs.tc_detail_id(i) and
547   	        tc_day_id = p_rtrvd_tcs.tc_day_id(i) and
548   	        tc_id = p_rtrvd_tcs.tc_id(i);
549 
550  else
551 
552   forall i in p_rtrvd_tcs.po_number.first..p_rtrvd_tcs.po_number.last
553      SAVE EXCEPTIONS
554     insert into PO_RETRIEVED_TIMECARDS
555   	(
556   	  PO_HEADER_ID,
557 	  PO_NUMBER,
558 	  PO_LINE_ID,
559 	  PO_LINE_NUMBER,
560 	  ORG_ID,
561 	  PO_APPROVED_DATE,
562 	  PO_CONTRACTOR_FULL_NAME,
563 	  PROJECT_ID,
564 	  PROJECT_NAME,
565 	  TASK_ID,
566 	  TASK_NAME,
567 	  TC_ID,
568 	  TC_DAY_ID,
569 	  TC_DETAIL_ID,
570 	  TC_SCOPE,
571 	  TC_UOM,
572 	  TC_START_DATE,
573 	  TC_END_DATE,
574 	  TC_ENTRY_DATE,
575 	  TC_TIME_RECEIVED,
576 	  TC_SUBMISSION_DATE,
577 	  TC_APPROVED_DATE,
578 	  TC_APPROVAL_STATUS,
579 	  CONTINGENT_WORKER_ID,
580 	  TC_COMMENT_TEXT,
581 	  LINE_RATE_TYPE,
582 	  LINE_RATE,
583 	  LINE_RATE_CURRENCY,
584 	  VENDOR_ID,
585 	  VENDOR_SITE_ID,
586 	  VENDOR_CONTACT_ID,
587 	  PO_CONTRACTOR_FIRST_NAME,
588       PO_CONTRACTOR_LAST_NAME
589   	)
590   	values
591   	(
592   	 p_rtrvd_tcs.PO_HEADER_ID(i),
593 	 p_rtrvd_tcs.PO_NUMBER(i),
594 	 p_rtrvd_tcs.PO_LINE_ID(i),
595 	 p_rtrvd_tcs.PO_LINE_NUMBER(i),
596 	 p_rtrvd_tcs.ORG_ID(i),
597      p_rtrvd_tcs.po_CREATION_DATE(i),
598 	 p_rtrvd_tcs.CONTRACTOR_FULL_NAME(i),
599      p_rtrvd_tcs.PROJECT_ID(i),
600 	 p_rtrvd_tcs.PROJECT_NAME(i),
601 	 p_rtrvd_tcs.TASK_ID(i),
602 	 p_rtrvd_tcs.TASK_NUMBER(i),
603 	 p_rtrvd_tcs.TC_ID(i),
604 	 p_rtrvd_tcs.TC_DAY_ID(i),
605 	 p_rtrvd_tcs.TC_DETAIL_ID(i),
606      'DETAIL',
607 	 p_rtrvd_tcs.TC_UOM(i),
608 	 p_rtrvd_tcs.TC_START_DATE(i),
609 	 p_rtrvd_tcs.TC_END_DATE(i),
610 	 p_rtrvd_tcs.TC_ENTRY_DATE(i),
611 	 p_rtrvd_tcs.TC_TIME_RECEIVED(i),
612 	 p_rtrvd_tcs.TC_SUBMISSION_DATE(i),
613 	 p_rtrvd_tcs.TC_APPROVAL_DATE(i),
614 	 p_rtrvd_tcs.TC_APPROVAL_STATUS(i),
615 	 p_rtrvd_tcs.CONTINGENT_WORKER_ID(i),
616 	 p_rtrvd_tcs.TC_COMMENT_TEXT(i),
617 	 p_rtrvd_tcs.LINE_RATE_TYPE(i),
618 	 p_rtrvd_tcs.LINE_RATE(i),
619 	 p_rtrvd_tcs.PO_CURRENCY(i),
620 	 p_rtrvd_tcs.VENDOR_ID(i),
621 	 p_rtrvd_tcs.VENDOR_SITE_ID(i),
622 	 p_rtrvd_tcs.VENDOR_CONTACT_ID(i),
623 	 p_rtrvd_tcs.contractor_first_name(i),
624      p_rtrvd_tcs.contractor_last_name(i)
625   	);
626  end if;
627 
628 exception
629   when dml_errors then
630   x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
631   x_msg_data := '';
632 
633   x_errs := add_error (p_rtrvd_tcs);
634 
635   when others then
636     x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
637     x_msg_data := ' Error : ' || SQLERRM;
638 
639 end store_timecard_details_bulk;
640 
641 End of 8i compatibility issue.
642 */
643 
644 
645 end PO_STORE_TIMECARD_PKG_GRP;