180:
181: l_business_group_id hr_organization_units.business_group_id%TYPE;
182: l_count NUMBER ;
183: l_field VARCHAR2(300) := NULL;
184: l_org_information1 hr_organization_information.org_information1%TYPE;
185: l_main_lc_status hr_organization_information.org_information6%TYPE;
186:
187: UNIQUE_AST_NUMBER EXCEPTION;
188: UNIQUE_ORG_NUMBER EXCEPTION;
181: l_business_group_id hr_organization_units.business_group_id%TYPE;
182: l_count NUMBER ;
183: l_field VARCHAR2(300) := NULL;
184: l_org_information1 hr_organization_information.org_information1%TYPE;
185: l_main_lc_status hr_organization_information.org_information6%TYPE;
186:
187: UNIQUE_AST_NUMBER EXCEPTION;
188: UNIQUE_ORG_NUMBER EXCEPTION;
189: UNIQUE_MAIN_LOCAL_UNIT EXCEPTION;
221: WHERE organization_id = p_organization_id;
222: /*
223: CURSOR orglocalunit IS
224: select o.organization_id
225: from hr_organization_units o , hr_organization_information hoi , FND_SESSIONS s
226: where o.organization_id = hoi.organization_id
227: and hoi.org_information_context = 'CLASS'
228: and hoi.org_information1 = 'SE_LOCAL_UNIT'
229: and to_char(o.organization_id) in
228: and hoi.org_information1 = 'SE_LOCAL_UNIT'
229: and to_char(o.organization_id) in
230: (
231: select hoinf.org_information1
232: from hr_organization_units org, hr_organization_information hoinf
233: where org.business_group_id = l_business_group_id
234: and org.organization_id = hoinf.organization_id
235: and hoinf.org_information_context = 'SE_LOCAL_UNITS'
236: )
240: */
241: CURSOR orglocalunit IS
242: select o.organization_id
243: from hr_organization_units o ,
244: hr_organization_information hoi,
245: hr_organization_information hoinf,
246: FND_SESSIONS s
247: where o.organization_id = hoi.organization_id
248: and o.business_group_id = l_business_group_id
241: CURSOR orglocalunit IS
242: select o.organization_id
243: from hr_organization_units o ,
244: hr_organization_information hoi,
245: hr_organization_information hoinf,
246: FND_SESSIONS s
247: where o.organization_id = hoi.organization_id
248: and o.business_group_id = l_business_group_id
249: and hoi.org_information_context = 'CLASS'
257: /*
258: CURSOR ast_number IS
259: select count(hoi2.org_information1)
260: from HR_ORGANIZATION_UNITS o1
261: , HR_ORGANIZATION_INFORMATION hoi1
262: , HR_ORGANIZATION_INFORMATION hoi2
263: WHERE o1.business_group_id =l_business_group_id
264: and hoi1.organization_id = o1.organization_id
265: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
258: CURSOR ast_number IS
259: select count(hoi2.org_information1)
260: from HR_ORGANIZATION_UNITS o1
261: , HR_ORGANIZATION_INFORMATION hoi1
262: , HR_ORGANIZATION_INFORMATION hoi2
263: WHERE o1.business_group_id =l_business_group_id
264: and hoi1.organization_id = o1.organization_id
265: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
266: and hoi1.org_information_context = 'CLASS'
269: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
270: and hoi1.organization_id in
271: (select hoi1.organization_id
272: from HR_ORGANIZATION_UNITS o1
273: , HR_ORGANIZATION_INFORMATION hoi1
274: , HR_ORGANIZATION_INFORMATION hoi2
275: , HR_ORGANIZATION_INFORMATION hoi3
276: WHERE o1.business_group_id =l_business_group_id
277: and hoi1.organization_id = o1.organization_id
270: and hoi1.organization_id in
271: (select hoi1.organization_id
272: from HR_ORGANIZATION_UNITS o1
273: , HR_ORGANIZATION_INFORMATION hoi1
274: , HR_ORGANIZATION_INFORMATION hoi2
275: , HR_ORGANIZATION_INFORMATION hoi3
276: WHERE o1.business_group_id =l_business_group_id
277: and hoi1.organization_id = o1.organization_id
278: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
271: (select hoi1.organization_id
272: from HR_ORGANIZATION_UNITS o1
273: , HR_ORGANIZATION_INFORMATION hoi1
274: , HR_ORGANIZATION_INFORMATION hoi2
275: , HR_ORGANIZATION_INFORMATION hoi3
276: WHERE o1.business_group_id =l_business_group_id
277: and hoi1.organization_id = o1.organization_id
278: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
279: and hoi1.org_information_context = 'CLASS'
284: and hoi3.org_information1 = 'HR_LEGAL_EMPLOYER'
285: AND hoi3.organization_id IN
286: (select hoi3.organization_id
287: from HR_ORGANIZATION_UNITS o1
288: , HR_ORGANIZATION_INFORMATION hoi1
289: , HR_ORGANIZATION_INFORMATION hoi2
290: , HR_ORGANIZATION_INFORMATION hoi3
291: WHERE o1.business_group_id =l_business_group_id
292: and hoi1.organization_id = o1.organization_id
285: AND hoi3.organization_id IN
286: (select hoi3.organization_id
287: from HR_ORGANIZATION_UNITS o1
288: , HR_ORGANIZATION_INFORMATION hoi1
289: , HR_ORGANIZATION_INFORMATION hoi2
290: , HR_ORGANIZATION_INFORMATION hoi3
291: WHERE o1.business_group_id =l_business_group_id
292: and hoi1.organization_id = o1.organization_id
293: and hoi1.organization_id = p_organization_id
286: (select hoi3.organization_id
287: from HR_ORGANIZATION_UNITS o1
288: , HR_ORGANIZATION_INFORMATION hoi1
289: , HR_ORGANIZATION_INFORMATION hoi2
290: , HR_ORGANIZATION_INFORMATION hoi3
291: WHERE o1.business_group_id =l_business_group_id
292: and hoi1.organization_id = o1.organization_id
293: and hoi1.organization_id = p_organization_id
294: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
304:
305: CURSOR FIND_LEGAL_EMPLOYER IS
306: select hoi3.organization_id
307: from HR_ALL_ORGANIZATION_UNITS o1
308: , HR_ORGANIZATION_INFORMATION hoi1
309: , HR_ORGANIZATION_INFORMATION hoi2
310: , HR_ORGANIZATION_INFORMATION hoi3
311: WHERE o1.business_group_id =l_business_group_id
312: and hoi1.organization_id = o1.organization_id
305: CURSOR FIND_LEGAL_EMPLOYER IS
306: select hoi3.organization_id
307: from HR_ALL_ORGANIZATION_UNITS o1
308: , HR_ORGANIZATION_INFORMATION hoi1
309: , HR_ORGANIZATION_INFORMATION hoi2
310: , HR_ORGANIZATION_INFORMATION hoi3
311: WHERE o1.business_group_id =l_business_group_id
312: and hoi1.organization_id = o1.organization_id
313: and hoi1.organization_id = p_organization_id
306: select hoi3.organization_id
307: from HR_ALL_ORGANIZATION_UNITS o1
308: , HR_ORGANIZATION_INFORMATION hoi1
309: , HR_ORGANIZATION_INFORMATION hoi2
310: , HR_ORGANIZATION_INFORMATION hoi3
311: WHERE o1.business_group_id =l_business_group_id
312: and hoi1.organization_id = o1.organization_id
313: and hoi1.organization_id = p_organization_id
314: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
322: L_LEGAL_EMPLOYER NUMBER;
323: CURSOR ast_number IS
324: select count(hoi2.org_information1)
325: from HR_ALL_ORGANIZATION_UNITS o1
326: , HR_ORGANIZATION_INFORMATION hoi1
327: , HR_ORGANIZATION_INFORMATION hoi2
328: , HR_ORGANIZATION_INFORMATION hoi3
329: , HR_ORGANIZATION_INFORMATION hoi4
330: WHERE o1.business_group_id =l_business_group_id
323: CURSOR ast_number IS
324: select count(hoi2.org_information1)
325: from HR_ALL_ORGANIZATION_UNITS o1
326: , HR_ORGANIZATION_INFORMATION hoi1
327: , HR_ORGANIZATION_INFORMATION hoi2
328: , HR_ORGANIZATION_INFORMATION hoi3
329: , HR_ORGANIZATION_INFORMATION hoi4
330: WHERE o1.business_group_id =l_business_group_id
331: and hoi1.organization_id = o1.organization_id
324: select count(hoi2.org_information1)
325: from HR_ALL_ORGANIZATION_UNITS o1
326: , HR_ORGANIZATION_INFORMATION hoi1
327: , HR_ORGANIZATION_INFORMATION hoi2
328: , HR_ORGANIZATION_INFORMATION hoi3
329: , HR_ORGANIZATION_INFORMATION hoi4
330: WHERE o1.business_group_id =l_business_group_id
331: and hoi1.organization_id = o1.organization_id
332: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
325: from HR_ALL_ORGANIZATION_UNITS o1
326: , HR_ORGANIZATION_INFORMATION hoi1
327: , HR_ORGANIZATION_INFORMATION hoi2
328: , HR_ORGANIZATION_INFORMATION hoi3
329: , HR_ORGANIZATION_INFORMATION hoi4
330: WHERE o1.business_group_id =l_business_group_id
331: and hoi1.organization_id = o1.organization_id
332: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
333: and hoi1.org_information_context = 'CLASS'
343:
344: /* CURSOR main_lc IS
345: select count(hoi2.org_information6)
346: from HR_ORGANIZATION_UNITS o1
347: , HR_ORGANIZATION_INFORMATION hoi1
348: , HR_ORGANIZATION_INFORMATION hoi2
349: WHERE o1.business_group_id =l_business_group_id
350: and hoi1.organization_id = o1.organization_id
351: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
344: /* CURSOR main_lc IS
345: select count(hoi2.org_information6)
346: from HR_ORGANIZATION_UNITS o1
347: , HR_ORGANIZATION_INFORMATION hoi1
348: , HR_ORGANIZATION_INFORMATION hoi2
349: WHERE o1.business_group_id =l_business_group_id
350: and hoi1.organization_id = o1.organization_id
351: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
352: and hoi1.org_information_context = 'CLASS'
355: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
356: and hoi1.organization_id in
357: (select hoi1.organization_id
358: from HR_ORGANIZATION_UNITS o1
359: , HR_ORGANIZATION_INFORMATION hoi1
360: , HR_ORGANIZATION_INFORMATION hoi2
361: , HR_ORGANIZATION_INFORMATION hoi3
362: WHERE o1.business_group_id =l_business_group_id
363: and hoi1.organization_id = o1.organization_id
356: and hoi1.organization_id in
357: (select hoi1.organization_id
358: from HR_ORGANIZATION_UNITS o1
359: , HR_ORGANIZATION_INFORMATION hoi1
360: , HR_ORGANIZATION_INFORMATION hoi2
361: , HR_ORGANIZATION_INFORMATION hoi3
362: WHERE o1.business_group_id =l_business_group_id
363: and hoi1.organization_id = o1.organization_id
364: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
357: (select hoi1.organization_id
358: from HR_ORGANIZATION_UNITS o1
359: , HR_ORGANIZATION_INFORMATION hoi1
360: , HR_ORGANIZATION_INFORMATION hoi2
361: , HR_ORGANIZATION_INFORMATION hoi3
362: WHERE o1.business_group_id =l_business_group_id
363: and hoi1.organization_id = o1.organization_id
364: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
365: and hoi1.org_information_context = 'CLASS'
370: and hoi3.org_information1 = 'HR_LEGAL_EMPLOYER'
371: AND hoi3.organization_id IN
372: (select hoi3.organization_id
373: from HR_ORGANIZATION_UNITS o1
374: , HR_ORGANIZATION_INFORMATION hoi1
375: , HR_ORGANIZATION_INFORMATION hoi2
376: , HR_ORGANIZATION_INFORMATION hoi3
377: WHERE o1.business_group_id =l_business_group_id
378: and hoi1.organization_id = o1.organization_id
371: AND hoi3.organization_id IN
372: (select hoi3.organization_id
373: from HR_ORGANIZATION_UNITS o1
374: , HR_ORGANIZATION_INFORMATION hoi1
375: , HR_ORGANIZATION_INFORMATION hoi2
376: , HR_ORGANIZATION_INFORMATION hoi3
377: WHERE o1.business_group_id =l_business_group_id
378: and hoi1.organization_id = o1.organization_id
379: and hoi1.organization_id = p_organization_id
372: (select hoi3.organization_id
373: from HR_ORGANIZATION_UNITS o1
374: , HR_ORGANIZATION_INFORMATION hoi1
375: , HR_ORGANIZATION_INFORMATION hoi2
376: , HR_ORGANIZATION_INFORMATION hoi3
377: WHERE o1.business_group_id =l_business_group_id
378: and hoi1.organization_id = o1.organization_id
379: and hoi1.organization_id = p_organization_id
380: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
387:
388: CURSOR main_lc IS
389: select count(hoi2.org_information6)
390: from HR_ALL_ORGANIZATION_UNITS o1
391: , HR_ORGANIZATION_INFORMATION hoi1
392: , HR_ORGANIZATION_INFORMATION hoi2
393: , HR_ORGANIZATION_INFORMATION hoi3
394: , HR_ORGANIZATION_INFORMATION hoi4
395: WHERE o1.business_group_id =l_business_group_id
388: CURSOR main_lc IS
389: select count(hoi2.org_information6)
390: from HR_ALL_ORGANIZATION_UNITS o1
391: , HR_ORGANIZATION_INFORMATION hoi1
392: , HR_ORGANIZATION_INFORMATION hoi2
393: , HR_ORGANIZATION_INFORMATION hoi3
394: , HR_ORGANIZATION_INFORMATION hoi4
395: WHERE o1.business_group_id =l_business_group_id
396: and hoi1.organization_id = o1.organization_id
389: select count(hoi2.org_information6)
390: from HR_ALL_ORGANIZATION_UNITS o1
391: , HR_ORGANIZATION_INFORMATION hoi1
392: , HR_ORGANIZATION_INFORMATION hoi2
393: , HR_ORGANIZATION_INFORMATION hoi3
394: , HR_ORGANIZATION_INFORMATION hoi4
395: WHERE o1.business_group_id =l_business_group_id
396: and hoi1.organization_id = o1.organization_id
397: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
390: from HR_ALL_ORGANIZATION_UNITS o1
391: , HR_ORGANIZATION_INFORMATION hoi1
392: , HR_ORGANIZATION_INFORMATION hoi2
393: , HR_ORGANIZATION_INFORMATION hoi3
394: , HR_ORGANIZATION_INFORMATION hoi4
395: WHERE o1.business_group_id =l_business_group_id
396: and hoi1.organization_id = o1.organization_id
397: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
398: and hoi1.org_information_context = 'CLASS'
409: /*
410: CURSOR main_lc_le IS
411: select count(hoi2.org_information6)
412: from HR_ORGANIZATION_UNITS o1
413: , HR_ORGANIZATION_INFORMATION hoi1
414: , HR_ORGANIZATION_INFORMATION hoi2
415: WHERE o1.business_group_id =l_business_group_id
416: and hoi1.organization_id = o1.organization_id
417: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
410: CURSOR main_lc_le IS
411: select count(hoi2.org_information6)
412: from HR_ORGANIZATION_UNITS o1
413: , HR_ORGANIZATION_INFORMATION hoi1
414: , HR_ORGANIZATION_INFORMATION hoi2
415: WHERE o1.business_group_id =l_business_group_id
416: and hoi1.organization_id = o1.organization_id
417: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
418: and hoi1.org_information_context = 'CLASS'
422: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
423: and hoi1.organization_id in
424: (select hoi1.organization_id
425: from HR_ORGANIZATION_UNITS o1
426: , HR_ORGANIZATION_INFORMATION hoi1
427: , HR_ORGANIZATION_INFORMATION hoi2
428: , HR_ORGANIZATION_INFORMATION hoi3
429: WHERE o1.business_group_id =l_business_group_id
430: and hoi1.organization_id = o1.organization_id
423: and hoi1.organization_id in
424: (select hoi1.organization_id
425: from HR_ORGANIZATION_UNITS o1
426: , HR_ORGANIZATION_INFORMATION hoi1
427: , HR_ORGANIZATION_INFORMATION hoi2
428: , HR_ORGANIZATION_INFORMATION hoi3
429: WHERE o1.business_group_id =l_business_group_id
430: and hoi1.organization_id = o1.organization_id
431: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
424: (select hoi1.organization_id
425: from HR_ORGANIZATION_UNITS o1
426: , HR_ORGANIZATION_INFORMATION hoi1
427: , HR_ORGANIZATION_INFORMATION hoi2
428: , HR_ORGANIZATION_INFORMATION hoi3
429: WHERE o1.business_group_id =l_business_group_id
430: and hoi1.organization_id = o1.organization_id
431: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
432: and hoi1.org_information_context = 'CLASS'
438: AND hoi3.organization_id = p_organization_id );
439: */
440: CURSOR main_lc_le IS select count(hoi2.org_information6)
441: from HR_ALL_ORGANIZATION_UNITS o1
442: , HR_ORGANIZATION_INFORMATION hoi1
443: , HR_ORGANIZATION_INFORMATION hoi2
444: , HR_ORGANIZATION_INFORMATION hoi3
445: , HR_ORGANIZATION_INFORMATION hoi4
446: WHERE o1.business_group_id =l_business_group_id
439: */
440: CURSOR main_lc_le IS select count(hoi2.org_information6)
441: from HR_ALL_ORGANIZATION_UNITS o1
442: , HR_ORGANIZATION_INFORMATION hoi1
443: , HR_ORGANIZATION_INFORMATION hoi2
444: , HR_ORGANIZATION_INFORMATION hoi3
445: , HR_ORGANIZATION_INFORMATION hoi4
446: WHERE o1.business_group_id =l_business_group_id
447: and hoi1.organization_id = o1.organization_id
440: CURSOR main_lc_le IS select count(hoi2.org_information6)
441: from HR_ALL_ORGANIZATION_UNITS o1
442: , HR_ORGANIZATION_INFORMATION hoi1
443: , HR_ORGANIZATION_INFORMATION hoi2
444: , HR_ORGANIZATION_INFORMATION hoi3
445: , HR_ORGANIZATION_INFORMATION hoi4
446: WHERE o1.business_group_id =l_business_group_id
447: and hoi1.organization_id = o1.organization_id
448: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
441: from HR_ALL_ORGANIZATION_UNITS o1
442: , HR_ORGANIZATION_INFORMATION hoi1
443: , HR_ORGANIZATION_INFORMATION hoi2
444: , HR_ORGANIZATION_INFORMATION hoi3
445: , HR_ORGANIZATION_INFORMATION hoi4
446: WHERE o1.business_group_id =l_business_group_id
447: and hoi1.organization_id = o1.organization_id
448: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
449: and hoi1.org_information_context = 'CLASS'
461: /*
462: CURSOR ast_number_le IS
463: select count(hoi2.org_information1)
464: from HR_ORGANIZATION_UNITS o1
465: , HR_ORGANIZATION_INFORMATION hoi1
466: , HR_ORGANIZATION_INFORMATION hoi2
467: WHERE o1.business_group_id =l_business_group_id
468: and hoi1.organization_id = o1.organization_id
469: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
462: CURSOR ast_number_le IS
463: select count(hoi2.org_information1)
464: from HR_ORGANIZATION_UNITS o1
465: , HR_ORGANIZATION_INFORMATION hoi1
466: , HR_ORGANIZATION_INFORMATION hoi2
467: WHERE o1.business_group_id =l_business_group_id
468: and hoi1.organization_id = o1.organization_id
469: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
470: and hoi1.org_information_context = 'CLASS'
473: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
474: and hoi2.org_information1 in
475: (select hoi2.org_information1
476: from HR_ORGANIZATION_UNITS o1
477: , HR_ORGANIZATION_INFORMATION hoi1
478: , HR_ORGANIZATION_INFORMATION hoi2
479: WHERE o1.business_group_id =l_business_group_id
480: and hoi1.organization_id = o1.organization_id
481: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
474: and hoi2.org_information1 in
475: (select hoi2.org_information1
476: from HR_ORGANIZATION_UNITS o1
477: , HR_ORGANIZATION_INFORMATION hoi1
478: , HR_ORGANIZATION_INFORMATION hoi2
479: WHERE o1.business_group_id =l_business_group_id
480: and hoi1.organization_id = o1.organization_id
481: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
482: and hoi1.org_information_context = 'CLASS'
486: )
487: and hoi1.organization_id in
488: (select hoi1.organization_id
489: from HR_ORGANIZATION_UNITS o1
490: , HR_ORGANIZATION_INFORMATION hoi1
491: , HR_ORGANIZATION_INFORMATION hoi2
492: , HR_ORGANIZATION_INFORMATION hoi3
493: WHERE o1.business_group_id =l_business_group_id
494: and hoi1.organization_id = o1.organization_id
487: and hoi1.organization_id in
488: (select hoi1.organization_id
489: from HR_ORGANIZATION_UNITS o1
490: , HR_ORGANIZATION_INFORMATION hoi1
491: , HR_ORGANIZATION_INFORMATION hoi2
492: , HR_ORGANIZATION_INFORMATION hoi3
493: WHERE o1.business_group_id =l_business_group_id
494: and hoi1.organization_id = o1.organization_id
495: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
488: (select hoi1.organization_id
489: from HR_ORGANIZATION_UNITS o1
490: , HR_ORGANIZATION_INFORMATION hoi1
491: , HR_ORGANIZATION_INFORMATION hoi2
492: , HR_ORGANIZATION_INFORMATION hoi3
493: WHERE o1.business_group_id =l_business_group_id
494: and hoi1.organization_id = o1.organization_id
495: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
496: and hoi1.org_information_context = 'CLASS'
503: */
504: CURSOR ast_number_le IS
505: select count(hoi2.org_information1)
506: from HR_ALL_ORGANIZATION_UNITS o1
507: , HR_ORGANIZATION_INFORMATION hoi1
508: , HR_ORGANIZATION_INFORMATION hoi2
509: , HR_ORGANIZATION_INFORMATION hoi3
510: , HR_ORGANIZATION_INFORMATION hoi4
511: , HR_ORGANIZATION_INFORMATION hoi5
504: CURSOR ast_number_le IS
505: select count(hoi2.org_information1)
506: from HR_ALL_ORGANIZATION_UNITS o1
507: , HR_ORGANIZATION_INFORMATION hoi1
508: , HR_ORGANIZATION_INFORMATION hoi2
509: , HR_ORGANIZATION_INFORMATION hoi3
510: , HR_ORGANIZATION_INFORMATION hoi4
511: , HR_ORGANIZATION_INFORMATION hoi5
512: WHERE o1.business_group_id =l_business_group_id
505: select count(hoi2.org_information1)
506: from HR_ALL_ORGANIZATION_UNITS o1
507: , HR_ORGANIZATION_INFORMATION hoi1
508: , HR_ORGANIZATION_INFORMATION hoi2
509: , HR_ORGANIZATION_INFORMATION hoi3
510: , HR_ORGANIZATION_INFORMATION hoi4
511: , HR_ORGANIZATION_INFORMATION hoi5
512: WHERE o1.business_group_id =l_business_group_id
513: and hoi1.organization_id = o1.organization_id
506: from HR_ALL_ORGANIZATION_UNITS o1
507: , HR_ORGANIZATION_INFORMATION hoi1
508: , HR_ORGANIZATION_INFORMATION hoi2
509: , HR_ORGANIZATION_INFORMATION hoi3
510: , HR_ORGANIZATION_INFORMATION hoi4
511: , HR_ORGANIZATION_INFORMATION hoi5
512: WHERE o1.business_group_id =l_business_group_id
513: and hoi1.organization_id = o1.organization_id
514: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
507: , HR_ORGANIZATION_INFORMATION hoi1
508: , HR_ORGANIZATION_INFORMATION hoi2
509: , HR_ORGANIZATION_INFORMATION hoi3
510: , HR_ORGANIZATION_INFORMATION hoi4
511: , HR_ORGANIZATION_INFORMATION hoi5
512: WHERE o1.business_group_id =l_business_group_id
513: and hoi1.organization_id = o1.organization_id
514: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
515: and hoi1.org_information_context = 'CLASS'
528:
529: CURSOR tax_lc(l_param1 varchar2,l_param2 number) IS
530: select count(hoi1.org_information1)
531: from HR_ALL_ORGANIZATION_UNITS o1
532: , HR_ORGANIZATION_INFORMATION hoi1
533: , HR_ORGANIZATION_INFORMATION hoi2
534: WHERE o1.business_group_id =l_business_group_id
535: and o1.organization_id=hoi1.organization_id
536: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
529: CURSOR tax_lc(l_param1 varchar2,l_param2 number) IS
530: select count(hoi1.org_information1)
531: from HR_ALL_ORGANIZATION_UNITS o1
532: , HR_ORGANIZATION_INFORMATION hoi1
533: , HR_ORGANIZATION_INFORMATION hoi2
534: WHERE o1.business_group_id =l_business_group_id
535: and o1.organization_id=hoi1.organization_id
536: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
537: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
543:
544: CURSOR absence_cat_limit(l_param1 varchar2) IS
545: select count(hoi1.org_information1)
546: from HR_ALL_ORGANIZATION_UNITS o1
547: , HR_ORGANIZATION_INFORMATION hoi1
548: , HR_ORGANIZATION_INFORMATION hoi2
549: WHERE o1.business_group_id =l_business_group_id
550: and o1.organization_id=hoi1.organization_id
551: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
544: CURSOR absence_cat_limit(l_param1 varchar2) IS
545: select count(hoi1.org_information1)
546: from HR_ALL_ORGANIZATION_UNITS o1
547: , HR_ORGANIZATION_INFORMATION hoi1
548: , HR_ORGANIZATION_INFORMATION hoi2
549: WHERE o1.business_group_id =l_business_group_id
550: and o1.organization_id=hoi1.organization_id
551: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
552: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
557:
558: CURSOR org_number IS
559: select count(hoi2.org_information2)
560: from HR_ALL_ORGANIZATION_UNITS o1
561: , HR_ORGANIZATION_INFORMATION hoi1
562: , HR_ORGANIZATION_INFORMATION hoi2
563: WHERE o1.business_group_id =l_business_group_id
564: and hoi1.organization_id = o1.organization_id
565: and hoi1.org_information_context = 'CLASS'
558: CURSOR org_number IS
559: select count(hoi2.org_information2)
560: from HR_ALL_ORGANIZATION_UNITS o1
561: , HR_ORGANIZATION_INFORMATION hoi1
562: , HR_ORGANIZATION_INFORMATION hoi2
563: WHERE o1.business_group_id =l_business_group_id
564: and hoi1.organization_id = o1.organization_id
565: and hoi1.org_information_context = 'CLASS'
566: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
571:
572: CURSOR main_lc_status IS
573: select hoi2.org_information6
574: from HR_ALL_ORGANIZATION_UNITS o1
575: , HR_ORGANIZATION_INFORMATION hoi1
576: , HR_ORGANIZATION_INFORMATION hoi2
577: WHERE o1.business_group_id =l_business_group_id
578: and hoi1.organization_id = o1.organization_id
579: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
572: CURSOR main_lc_status IS
573: select hoi2.org_information6
574: from HR_ALL_ORGANIZATION_UNITS o1
575: , HR_ORGANIZATION_INFORMATION hoi1
576: , HR_ORGANIZATION_INFORMATION hoi2
577: WHERE o1.business_group_id =l_business_group_id
578: and hoi1.organization_id = o1.organization_id
579: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
580: and hoi1.org_information_context = 'CLASS'
585:
586:
587: CURSOR c_ins_le_ap_dtls IS
588: SELECT COUNT(*)
589: FROM hr_organization_information hoi, hr_all_organization_units ou
590: WHERE (hoi.org_information_context = 'SE_COMPANY_MILEAGE_RATES')
591: AND ou.organization_id = hoi.organization_id
592: AND ou.organization_id = nvl(p_organization_id , 0)
593: AND ou.business_group_id = l_business_group_id
622: l_agreement_meaning varchar2(50);
623:
624: CURSOR csr_year IS
625: SELECT count(*)
626: FROM hr_organization_information hoi, hr_organization_units ou, fnd_sessions s
627: WHERE hoi.org_information_context = 'SE_STD_WORK_DETAILS'
628: AND ou.organization_id = hoi.organization_id
629: AND ou.organization_id = nvl (p_organization_id, 0)
630: AND ou.business_group_id = l_business_group_id
1025: ) IS
1026:
1027: l_count NUMBER ;
1028: l_business_group_id hr_organization_units.business_group_id%TYPE;
1029: l_org_information1 hr_organization_information.org_information1%TYPE;
1030: l_field VARCHAR2(300) := NULL;
1031: l_organization_id hr_organization_information.organization_id%TYPE;
1032: l_main_lc_status hr_organization_information.org_information6%TYPE;
1033:
1027: l_count NUMBER ;
1028: l_business_group_id hr_organization_units.business_group_id%TYPE;
1029: l_org_information1 hr_organization_information.org_information1%TYPE;
1030: l_field VARCHAR2(300) := NULL;
1031: l_organization_id hr_organization_information.organization_id%TYPE;
1032: l_main_lc_status hr_organization_information.org_information6%TYPE;
1033:
1034: l_token varchar2(300);
1035: l_prev_holiday_start varchar2(30);
1028: l_business_group_id hr_organization_units.business_group_id%TYPE;
1029: l_org_information1 hr_organization_information.org_information1%TYPE;
1030: l_field VARCHAR2(300) := NULL;
1031: l_organization_id hr_organization_information.organization_id%TYPE;
1032: l_main_lc_status hr_organization_information.org_information6%TYPE;
1033:
1034: l_token varchar2(300);
1035: l_prev_holiday_start varchar2(30);
1036: l_prev_holiday_end varchar2(30);
1070: where organization_id = l_organization_id;
1071:
1072: CURSOR getorgid IS
1073: SELECT organization_id
1074: FROM hr_organization_information
1075: WHERE org_information_id = p_org_information_id;
1076:
1077: /*
1078: CURSOR orglocalunit IS
1076:
1077: /*
1078: CURSOR orglocalunit IS
1079: SELECT o.organization_id
1080: FROM hr_organization_units o , hr_organization_information hoi , FND_SESSIONS s
1081: WHERE o.organization_id = hoi.organization_id
1082: AND hoi.org_information_context = 'CLASS'
1083: AND hoi.org_information1 = 'SE_LOCAL_UNIT'
1084: AND to_char(o.organization_id) IN
1083: AND hoi.org_information1 = 'SE_LOCAL_UNIT'
1084: AND to_char(o.organization_id) IN
1085: (
1086: SELECT hoinf.org_information1
1087: FROM hr_organization_units org, hr_organization_information hoinf
1088: WHERE org.business_group_id = l_business_group_id
1089: AND org.organization_id = hoinf.organization_id
1090: AND org.organization_id <> l_organization_id
1091: AND hoinf.org_information_context = 'SE_LOCAL_UNITS'
1096: */
1097:
1098: CURSOR orglocalunit IS select o.organization_id
1099: from hr_organization_units o ,
1100: hr_organization_information hoi,
1101: hr_organization_information hoinf,
1102: FND_SESSIONS s
1103: where o.organization_id = hoi.organization_id
1104: and o.business_group_id = l_business_group_id
1097:
1098: CURSOR orglocalunit IS select o.organization_id
1099: from hr_organization_units o ,
1100: hr_organization_information hoi,
1101: hr_organization_information hoinf,
1102: FND_SESSIONS s
1103: where o.organization_id = hoi.organization_id
1104: and o.business_group_id = l_business_group_id
1105: and hoi.org_information_context = 'CLASS'
1113: /*
1114: CURSOR ast_number IS
1115: select count(hoi2.org_information1)
1116: from HR_ORGANIZATION_UNITS o1
1117: , HR_ORGANIZATION_INFORMATION hoi1
1118: , HR_ORGANIZATION_INFORMATION hoi2
1119: WHERE o1.business_group_id =l_business_group_id
1120: and hoi1.organization_id = o1.organization_id
1121: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1114: CURSOR ast_number IS
1115: select count(hoi2.org_information1)
1116: from HR_ORGANIZATION_UNITS o1
1117: , HR_ORGANIZATION_INFORMATION hoi1
1118: , HR_ORGANIZATION_INFORMATION hoi2
1119: WHERE o1.business_group_id =l_business_group_id
1120: and hoi1.organization_id = o1.organization_id
1121: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1122: and hoi1.org_information_context = 'CLASS'
1126: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
1127: and hoi1.organization_id in
1128: (select hoi1.organization_id
1129: from HR_ORGANIZATION_UNITS o1
1130: , HR_ORGANIZATION_INFORMATION hoi1
1131: , HR_ORGANIZATION_INFORMATION hoi2
1132: , HR_ORGANIZATION_INFORMATION hoi3
1133: WHERE o1.business_group_id =l_business_group_id
1134: and hoi1.organization_id = o1.organization_id
1127: and hoi1.organization_id in
1128: (select hoi1.organization_id
1129: from HR_ORGANIZATION_UNITS o1
1130: , HR_ORGANIZATION_INFORMATION hoi1
1131: , HR_ORGANIZATION_INFORMATION hoi2
1132: , HR_ORGANIZATION_INFORMATION hoi3
1133: WHERE o1.business_group_id =l_business_group_id
1134: and hoi1.organization_id = o1.organization_id
1135: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1128: (select hoi1.organization_id
1129: from HR_ORGANIZATION_UNITS o1
1130: , HR_ORGANIZATION_INFORMATION hoi1
1131: , HR_ORGANIZATION_INFORMATION hoi2
1132: , HR_ORGANIZATION_INFORMATION hoi3
1133: WHERE o1.business_group_id =l_business_group_id
1134: and hoi1.organization_id = o1.organization_id
1135: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1136: and hoi1.org_information_context = 'CLASS'
1141: and hoi3.org_information1 = 'HR_LEGAL_EMPLOYER'
1142: AND hoi3.organization_id IN
1143: (select hoi3.organization_id
1144: from HR_ORGANIZATION_UNITS o1
1145: , HR_ORGANIZATION_INFORMATION hoi1
1146: , HR_ORGANIZATION_INFORMATION hoi2
1147: , HR_ORGANIZATION_INFORMATION hoi3
1148: WHERE o1.business_group_id =l_business_group_id
1149: and hoi1.organization_id = o1.organization_id
1142: AND hoi3.organization_id IN
1143: (select hoi3.organization_id
1144: from HR_ORGANIZATION_UNITS o1
1145: , HR_ORGANIZATION_INFORMATION hoi1
1146: , HR_ORGANIZATION_INFORMATION hoi2
1147: , HR_ORGANIZATION_INFORMATION hoi3
1148: WHERE o1.business_group_id =l_business_group_id
1149: and hoi1.organization_id = o1.organization_id
1150: and hoi1.organization_id = l_organization_id
1143: (select hoi3.organization_id
1144: from HR_ORGANIZATION_UNITS o1
1145: , HR_ORGANIZATION_INFORMATION hoi1
1146: , HR_ORGANIZATION_INFORMATION hoi2
1147: , HR_ORGANIZATION_INFORMATION hoi3
1148: WHERE o1.business_group_id =l_business_group_id
1149: and hoi1.organization_id = o1.organization_id
1150: and hoi1.organization_id = l_organization_id
1151: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1158: */
1159: CURSOR FIND_LEGAL_EMPLOYER IS
1160: select hoi3.organization_id
1161: from HR_ALL_ORGANIZATION_UNITS o1
1162: , HR_ORGANIZATION_INFORMATION hoi1
1163: , HR_ORGANIZATION_INFORMATION hoi2
1164: , HR_ORGANIZATION_INFORMATION hoi3
1165: WHERE o1.business_group_id =l_business_group_id
1166: and hoi1.organization_id = o1.organization_id
1159: CURSOR FIND_LEGAL_EMPLOYER IS
1160: select hoi3.organization_id
1161: from HR_ALL_ORGANIZATION_UNITS o1
1162: , HR_ORGANIZATION_INFORMATION hoi1
1163: , HR_ORGANIZATION_INFORMATION hoi2
1164: , HR_ORGANIZATION_INFORMATION hoi3
1165: WHERE o1.business_group_id =l_business_group_id
1166: and hoi1.organization_id = o1.organization_id
1167: and hoi1.organization_id = l_organization_id
1160: select hoi3.organization_id
1161: from HR_ALL_ORGANIZATION_UNITS o1
1162: , HR_ORGANIZATION_INFORMATION hoi1
1163: , HR_ORGANIZATION_INFORMATION hoi2
1164: , HR_ORGANIZATION_INFORMATION hoi3
1165: WHERE o1.business_group_id =l_business_group_id
1166: and hoi1.organization_id = o1.organization_id
1167: and hoi1.organization_id = l_organization_id
1168: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1176: L_LEGAL_EMPLOYER NUMBER;
1177: CURSOR ast_number IS
1178: select count(hoi2.org_information1)
1179: from HR_ALL_ORGANIZATION_UNITS o1
1180: , HR_ORGANIZATION_INFORMATION hoi1
1181: , HR_ORGANIZATION_INFORMATION hoi2
1182: , HR_ORGANIZATION_INFORMATION hoi3
1183: , HR_ORGANIZATION_INFORMATION hoi4
1184: WHERE o1.business_group_id =l_business_group_id
1177: CURSOR ast_number IS
1178: select count(hoi2.org_information1)
1179: from HR_ALL_ORGANIZATION_UNITS o1
1180: , HR_ORGANIZATION_INFORMATION hoi1
1181: , HR_ORGANIZATION_INFORMATION hoi2
1182: , HR_ORGANIZATION_INFORMATION hoi3
1183: , HR_ORGANIZATION_INFORMATION hoi4
1184: WHERE o1.business_group_id =l_business_group_id
1185: and hoi1.organization_id = o1.organization_id
1178: select count(hoi2.org_information1)
1179: from HR_ALL_ORGANIZATION_UNITS o1
1180: , HR_ORGANIZATION_INFORMATION hoi1
1181: , HR_ORGANIZATION_INFORMATION hoi2
1182: , HR_ORGANIZATION_INFORMATION hoi3
1183: , HR_ORGANIZATION_INFORMATION hoi4
1184: WHERE o1.business_group_id =l_business_group_id
1185: and hoi1.organization_id = o1.organization_id
1186: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1179: from HR_ALL_ORGANIZATION_UNITS o1
1180: , HR_ORGANIZATION_INFORMATION hoi1
1181: , HR_ORGANIZATION_INFORMATION hoi2
1182: , HR_ORGANIZATION_INFORMATION hoi3
1183: , HR_ORGANIZATION_INFORMATION hoi4
1184: WHERE o1.business_group_id =l_business_group_id
1185: and hoi1.organization_id = o1.organization_id
1186: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1187: and hoi1.org_information_context = 'CLASS'
1200: /*
1201: CURSOR main_lc IS
1202: select count(hoi2.org_information6)
1203: from HR_ORGANIZATION_UNITS o1
1204: , HR_ORGANIZATION_INFORMATION hoi1
1205: , HR_ORGANIZATION_INFORMATION hoi2
1206: WHERE o1.business_group_id =l_business_group_id
1207: and hoi1.organization_id = o1.organization_id
1208: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1201: CURSOR main_lc IS
1202: select count(hoi2.org_information6)
1203: from HR_ORGANIZATION_UNITS o1
1204: , HR_ORGANIZATION_INFORMATION hoi1
1205: , HR_ORGANIZATION_INFORMATION hoi2
1206: WHERE o1.business_group_id =l_business_group_id
1207: and hoi1.organization_id = o1.organization_id
1208: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1209: and hoi1.org_information_context = 'CLASS'
1213: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
1214: and hoi1.organization_id in
1215: (select hoi1.organization_id
1216: from HR_ORGANIZATION_UNITS o1
1217: , HR_ORGANIZATION_INFORMATION hoi1
1218: , HR_ORGANIZATION_INFORMATION hoi2
1219: , HR_ORGANIZATION_INFORMATION hoi3
1220: WHERE o1.business_group_id =l_business_group_id
1221: and hoi1.organization_id = o1.organization_id
1214: and hoi1.organization_id in
1215: (select hoi1.organization_id
1216: from HR_ORGANIZATION_UNITS o1
1217: , HR_ORGANIZATION_INFORMATION hoi1
1218: , HR_ORGANIZATION_INFORMATION hoi2
1219: , HR_ORGANIZATION_INFORMATION hoi3
1220: WHERE o1.business_group_id =l_business_group_id
1221: and hoi1.organization_id = o1.organization_id
1222: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1215: (select hoi1.organization_id
1216: from HR_ORGANIZATION_UNITS o1
1217: , HR_ORGANIZATION_INFORMATION hoi1
1218: , HR_ORGANIZATION_INFORMATION hoi2
1219: , HR_ORGANIZATION_INFORMATION hoi3
1220: WHERE o1.business_group_id =l_business_group_id
1221: and hoi1.organization_id = o1.organization_id
1222: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1223: and hoi1.org_information_context = 'CLASS'
1228: and hoi3.org_information1 = 'HR_LEGAL_EMPLOYER'
1229: AND hoi3.organization_id IN
1230: (select hoi3.organization_id
1231: from HR_ORGANIZATION_UNITS o1
1232: , HR_ORGANIZATION_INFORMATION hoi1
1233: , HR_ORGANIZATION_INFORMATION hoi2
1234: , HR_ORGANIZATION_INFORMATION hoi3
1235: WHERE o1.business_group_id =l_business_group_id
1236: and hoi1.organization_id = o1.organization_id
1229: AND hoi3.organization_id IN
1230: (select hoi3.organization_id
1231: from HR_ORGANIZATION_UNITS o1
1232: , HR_ORGANIZATION_INFORMATION hoi1
1233: , HR_ORGANIZATION_INFORMATION hoi2
1234: , HR_ORGANIZATION_INFORMATION hoi3
1235: WHERE o1.business_group_id =l_business_group_id
1236: and hoi1.organization_id = o1.organization_id
1237: and hoi1.organization_id = l_organization_id
1230: (select hoi3.organization_id
1231: from HR_ORGANIZATION_UNITS o1
1232: , HR_ORGANIZATION_INFORMATION hoi1
1233: , HR_ORGANIZATION_INFORMATION hoi2
1234: , HR_ORGANIZATION_INFORMATION hoi3
1235: WHERE o1.business_group_id =l_business_group_id
1236: and hoi1.organization_id = o1.organization_id
1237: and hoi1.organization_id = l_organization_id
1238: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1245:
1246: */ CURSOR main_lc IS
1247: select count(hoi2.org_information6)
1248: from HR_ALL_ORGANIZATION_UNITS o1
1249: , HR_ORGANIZATION_INFORMATION hoi1
1250: , HR_ORGANIZATION_INFORMATION hoi2
1251: , HR_ORGANIZATION_INFORMATION hoi3
1252: , HR_ORGANIZATION_INFORMATION hoi4
1253: WHERE o1.business_group_id =l_business_group_id
1246: */ CURSOR main_lc IS
1247: select count(hoi2.org_information6)
1248: from HR_ALL_ORGANIZATION_UNITS o1
1249: , HR_ORGANIZATION_INFORMATION hoi1
1250: , HR_ORGANIZATION_INFORMATION hoi2
1251: , HR_ORGANIZATION_INFORMATION hoi3
1252: , HR_ORGANIZATION_INFORMATION hoi4
1253: WHERE o1.business_group_id =l_business_group_id
1254: and hoi1.organization_id = o1.organization_id
1247: select count(hoi2.org_information6)
1248: from HR_ALL_ORGANIZATION_UNITS o1
1249: , HR_ORGANIZATION_INFORMATION hoi1
1250: , HR_ORGANIZATION_INFORMATION hoi2
1251: , HR_ORGANIZATION_INFORMATION hoi3
1252: , HR_ORGANIZATION_INFORMATION hoi4
1253: WHERE o1.business_group_id =l_business_group_id
1254: and hoi1.organization_id = o1.organization_id
1255: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1248: from HR_ALL_ORGANIZATION_UNITS o1
1249: , HR_ORGANIZATION_INFORMATION hoi1
1250: , HR_ORGANIZATION_INFORMATION hoi2
1251: , HR_ORGANIZATION_INFORMATION hoi3
1252: , HR_ORGANIZATION_INFORMATION hoi4
1253: WHERE o1.business_group_id =l_business_group_id
1254: and hoi1.organization_id = o1.organization_id
1255: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1256: and hoi1.org_information_context = 'CLASS'
1268:
1269: CURSOR main_lc_le IS
1270: select count(hoi2.org_information6)
1271: from HR_ORGANIZATION_UNITS o1
1272: , HR_ORGANIZATION_INFORMATION hoi1
1273: , HR_ORGANIZATION_INFORMATION hoi2
1274: WHERE o1.business_group_id =l_business_group_id
1275: and hoi1.organization_id = o1.organization_id
1276: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1269: CURSOR main_lc_le IS
1270: select count(hoi2.org_information6)
1271: from HR_ORGANIZATION_UNITS o1
1272: , HR_ORGANIZATION_INFORMATION hoi1
1273: , HR_ORGANIZATION_INFORMATION hoi2
1274: WHERE o1.business_group_id =l_business_group_id
1275: and hoi1.organization_id = o1.organization_id
1276: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1277: and hoi1.org_information_context = 'CLASS'
1281: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
1282: and hoi1.organization_id in
1283: (select hoi1.organization_id
1284: from HR_ORGANIZATION_UNITS o1
1285: , HR_ORGANIZATION_INFORMATION hoi1
1286: , HR_ORGANIZATION_INFORMATION hoi2
1287: , HR_ORGANIZATION_INFORMATION hoi3
1288: WHERE o1.business_group_id =l_business_group_id
1289: and hoi1.organization_id = o1.organization_id
1282: and hoi1.organization_id in
1283: (select hoi1.organization_id
1284: from HR_ORGANIZATION_UNITS o1
1285: , HR_ORGANIZATION_INFORMATION hoi1
1286: , HR_ORGANIZATION_INFORMATION hoi2
1287: , HR_ORGANIZATION_INFORMATION hoi3
1288: WHERE o1.business_group_id =l_business_group_id
1289: and hoi1.organization_id = o1.organization_id
1290: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1283: (select hoi1.organization_id
1284: from HR_ORGANIZATION_UNITS o1
1285: , HR_ORGANIZATION_INFORMATION hoi1
1286: , HR_ORGANIZATION_INFORMATION hoi2
1287: , HR_ORGANIZATION_INFORMATION hoi3
1288: WHERE o1.business_group_id =l_business_group_id
1289: and hoi1.organization_id = o1.organization_id
1290: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1291: and hoi1.org_information_context = 'CLASS'
1297: and hoi2.org_information_id <> p_org_information_id
1298: AND hoi3.organization_id = l_organization_id );*/
1299: CURSOR main_lc_le IS select count(hoi2.org_information6)
1300: from HR_ALL_ORGANIZATION_UNITS o1
1301: , HR_ORGANIZATION_INFORMATION hoi1
1302: , HR_ORGANIZATION_INFORMATION hoi2
1303: , HR_ORGANIZATION_INFORMATION hoi3
1304: , HR_ORGANIZATION_INFORMATION hoi4
1305: WHERE o1.business_group_id =l_business_group_id
1298: AND hoi3.organization_id = l_organization_id );*/
1299: CURSOR main_lc_le IS select count(hoi2.org_information6)
1300: from HR_ALL_ORGANIZATION_UNITS o1
1301: , HR_ORGANIZATION_INFORMATION hoi1
1302: , HR_ORGANIZATION_INFORMATION hoi2
1303: , HR_ORGANIZATION_INFORMATION hoi3
1304: , HR_ORGANIZATION_INFORMATION hoi4
1305: WHERE o1.business_group_id =l_business_group_id
1306: and hoi1.organization_id = o1.organization_id
1299: CURSOR main_lc_le IS select count(hoi2.org_information6)
1300: from HR_ALL_ORGANIZATION_UNITS o1
1301: , HR_ORGANIZATION_INFORMATION hoi1
1302: , HR_ORGANIZATION_INFORMATION hoi2
1303: , HR_ORGANIZATION_INFORMATION hoi3
1304: , HR_ORGANIZATION_INFORMATION hoi4
1305: WHERE o1.business_group_id =l_business_group_id
1306: and hoi1.organization_id = o1.organization_id
1307: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1300: from HR_ALL_ORGANIZATION_UNITS o1
1301: , HR_ORGANIZATION_INFORMATION hoi1
1302: , HR_ORGANIZATION_INFORMATION hoi2
1303: , HR_ORGANIZATION_INFORMATION hoi3
1304: , HR_ORGANIZATION_INFORMATION hoi4
1305: WHERE o1.business_group_id =l_business_group_id
1306: and hoi1.organization_id = o1.organization_id
1307: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1308: and hoi1.org_information_context = 'CLASS'
1320: /*
1321: CURSOR ast_number_le IS
1322: select count(hoi2.org_information1)
1323: from HR_ORGANIZATION_UNITS o1
1324: , HR_ORGANIZATION_INFORMATION hoi1
1325: , HR_ORGANIZATION_INFORMATION hoi2
1326: WHERE o1.business_group_id =l_business_group_id
1327: and hoi1.organization_id = o1.organization_id
1328: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1321: CURSOR ast_number_le IS
1322: select count(hoi2.org_information1)
1323: from HR_ORGANIZATION_UNITS o1
1324: , HR_ORGANIZATION_INFORMATION hoi1
1325: , HR_ORGANIZATION_INFORMATION hoi2
1326: WHERE o1.business_group_id =l_business_group_id
1327: and hoi1.organization_id = o1.organization_id
1328: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1329: and hoi1.org_information_context = 'CLASS'
1332: and hoi2.ORG_INFORMATION_CONTEXT='SE_LOCAL_UNIT_DETAILS'
1333: and hoi2.org_information1 in
1334: (select hoi2.org_information1
1335: from HR_ORGANIZATION_UNITS o1
1336: , HR_ORGANIZATION_INFORMATION hoi1
1337: , HR_ORGANIZATION_INFORMATION hoi2
1338: WHERE o1.business_group_id =l_business_group_id
1339: and hoi1.organization_id = o1.organization_id
1340: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1333: and hoi2.org_information1 in
1334: (select hoi2.org_information1
1335: from HR_ORGANIZATION_UNITS o1
1336: , HR_ORGANIZATION_INFORMATION hoi1
1337: , HR_ORGANIZATION_INFORMATION hoi2
1338: WHERE o1.business_group_id =l_business_group_id
1339: and hoi1.organization_id = o1.organization_id
1340: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1341: and hoi1.org_information_context = 'CLASS'
1345: )
1346: and hoi1.organization_id in
1347: (select hoi1.organization_id
1348: from HR_ORGANIZATION_UNITS o1
1349: , HR_ORGANIZATION_INFORMATION hoi1
1350: , HR_ORGANIZATION_INFORMATION hoi2
1351: , HR_ORGANIZATION_INFORMATION hoi3
1352: WHERE o1.business_group_id =l_business_group_id
1353: and hoi1.organization_id = o1.organization_id
1346: and hoi1.organization_id in
1347: (select hoi1.organization_id
1348: from HR_ORGANIZATION_UNITS o1
1349: , HR_ORGANIZATION_INFORMATION hoi1
1350: , HR_ORGANIZATION_INFORMATION hoi2
1351: , HR_ORGANIZATION_INFORMATION hoi3
1352: WHERE o1.business_group_id =l_business_group_id
1353: and hoi1.organization_id = o1.organization_id
1354: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1347: (select hoi1.organization_id
1348: from HR_ORGANIZATION_UNITS o1
1349: , HR_ORGANIZATION_INFORMATION hoi1
1350: , HR_ORGANIZATION_INFORMATION hoi2
1351: , HR_ORGANIZATION_INFORMATION hoi3
1352: WHERE o1.business_group_id =l_business_group_id
1353: and hoi1.organization_id = o1.organization_id
1354: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1355: and hoi1.org_information_context = 'CLASS'
1363: */
1364: CURSOR ast_number_le IS
1365: select count(hoi2.org_information1)
1366: from HR_ALL_ORGANIZATION_UNITS o1
1367: , HR_ORGANIZATION_INFORMATION hoi1
1368: , HR_ORGANIZATION_INFORMATION hoi2
1369: , HR_ORGANIZATION_INFORMATION hoi3
1370: , HR_ORGANIZATION_INFORMATION hoi4
1371: , HR_ORGANIZATION_INFORMATION hoi5
1364: CURSOR ast_number_le IS
1365: select count(hoi2.org_information1)
1366: from HR_ALL_ORGANIZATION_UNITS o1
1367: , HR_ORGANIZATION_INFORMATION hoi1
1368: , HR_ORGANIZATION_INFORMATION hoi2
1369: , HR_ORGANIZATION_INFORMATION hoi3
1370: , HR_ORGANIZATION_INFORMATION hoi4
1371: , HR_ORGANIZATION_INFORMATION hoi5
1372: WHERE o1.business_group_id =l_business_group_id
1365: select count(hoi2.org_information1)
1366: from HR_ALL_ORGANIZATION_UNITS o1
1367: , HR_ORGANIZATION_INFORMATION hoi1
1368: , HR_ORGANIZATION_INFORMATION hoi2
1369: , HR_ORGANIZATION_INFORMATION hoi3
1370: , HR_ORGANIZATION_INFORMATION hoi4
1371: , HR_ORGANIZATION_INFORMATION hoi5
1372: WHERE o1.business_group_id =l_business_group_id
1373: and hoi1.organization_id = o1.organization_id
1366: from HR_ALL_ORGANIZATION_UNITS o1
1367: , HR_ORGANIZATION_INFORMATION hoi1
1368: , HR_ORGANIZATION_INFORMATION hoi2
1369: , HR_ORGANIZATION_INFORMATION hoi3
1370: , HR_ORGANIZATION_INFORMATION hoi4
1371: , HR_ORGANIZATION_INFORMATION hoi5
1372: WHERE o1.business_group_id =l_business_group_id
1373: and hoi1.organization_id = o1.organization_id
1374: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1367: , HR_ORGANIZATION_INFORMATION hoi1
1368: , HR_ORGANIZATION_INFORMATION hoi2
1369: , HR_ORGANIZATION_INFORMATION hoi3
1370: , HR_ORGANIZATION_INFORMATION hoi4
1371: , HR_ORGANIZATION_INFORMATION hoi5
1372: WHERE o1.business_group_id =l_business_group_id
1373: and hoi1.organization_id = o1.organization_id
1374: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1375: and hoi1.org_information_context = 'CLASS'
1389:
1390: CURSOR tax_lc(l_param1 varchar2,l_param2 number) IS
1391: select count(hoi1.org_information1)
1392: from HR_ALL_ORGANIZATION_UNITS o1
1393: ,HR_ORGANIZATION_INFORMATION hoi1
1394: ,HR_ORGANIZATION_INFORMATION hoi2
1395: WHERE o1.business_group_id =l_business_group_id
1396: and o1.organization_id=hoi1.organization_id
1397: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
1390: CURSOR tax_lc(l_param1 varchar2,l_param2 number) IS
1391: select count(hoi1.org_information1)
1392: from HR_ALL_ORGANIZATION_UNITS o1
1393: ,HR_ORGANIZATION_INFORMATION hoi1
1394: ,HR_ORGANIZATION_INFORMATION hoi2
1395: WHERE o1.business_group_id =l_business_group_id
1396: and o1.organization_id=hoi1.organization_id
1397: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
1398: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
1405:
1406: CURSOR absence_cat_limit(l_param1 varchar2) IS
1407: select count(hoi1.org_information1)
1408: from HR_ALL_ORGANIZATION_UNITS o1
1409: ,HR_ORGANIZATION_INFORMATION hoi1
1410: ,HR_ORGANIZATION_INFORMATION hoi2
1411: WHERE o1.business_group_id =l_business_group_id
1412: and o1.organization_id=hoi1.organization_id
1413: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
1406: CURSOR absence_cat_limit(l_param1 varchar2) IS
1407: select count(hoi1.org_information1)
1408: from HR_ALL_ORGANIZATION_UNITS o1
1409: ,HR_ORGANIZATION_INFORMATION hoi1
1410: ,HR_ORGANIZATION_INFORMATION hoi2
1411: WHERE o1.business_group_id =l_business_group_id
1412: and o1.organization_id=hoi1.organization_id
1413: and hoi1.ORG_INFORMATION_CONTEXT='CLASS'
1414: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
1420:
1421: CURSOR org_number IS
1422: select count(hoi2.org_information2)
1423: from HR_ALL_ORGANIZATION_UNITS o1
1424: , HR_ORGANIZATION_INFORMATION hoi1
1425: , HR_ORGANIZATION_INFORMATION hoi2
1426: WHERE o1.business_group_id =l_business_group_id
1427: and hoi1.organization_id = o1.organization_id
1428: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
1421: CURSOR org_number IS
1422: select count(hoi2.org_information2)
1423: from HR_ALL_ORGANIZATION_UNITS o1
1424: , HR_ORGANIZATION_INFORMATION hoi1
1425: , HR_ORGANIZATION_INFORMATION hoi2
1426: WHERE o1.business_group_id =l_business_group_id
1427: and hoi1.organization_id = o1.organization_id
1428: and hoi1.org_information1 = 'HR_LEGAL_EMPLOYER'
1429: and hoi1.org_information_context = 'CLASS'
1435:
1436: CURSOR main_lc_status IS
1437: select hoi2.org_information6
1438: from HR_ALL_ORGANIZATION_UNITS o1
1439: , HR_ORGANIZATION_INFORMATION hoi1
1440: , HR_ORGANIZATION_INFORMATION hoi2
1441: WHERE o1.business_group_id =l_business_group_id
1442: and hoi1.organization_id = o1.organization_id
1443: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1436: CURSOR main_lc_status IS
1437: select hoi2.org_information6
1438: from HR_ALL_ORGANIZATION_UNITS o1
1439: , HR_ORGANIZATION_INFORMATION hoi1
1440: , HR_ORGANIZATION_INFORMATION hoi2
1441: WHERE o1.business_group_id =l_business_group_id
1442: and hoi1.organization_id = o1.organization_id
1443: and hoi1.org_information1 = 'SE_LOCAL_UNIT'
1444: and hoi1.org_information_context = 'CLASS'
1451:
1452:
1453: CURSOR c_upd_le_ap_dtls IS
1454: SELECT COUNT(*)
1455: FROM hr_organization_information hoi, hr_all_organization_units ou
1456: WHERE (hoi.org_information_context = 'SE_COMPANY_MILEAGE_RATES')
1457: AND ou.organization_id = hoi.organization_id
1458: AND ou.organization_id = nvl(l_organization_id , 0)
1459: AND ou.business_group_id = l_business_group_id
1469:
1470: CURSOR c_legal IS
1471: SELECT ORG_INFORMATION1,ORG_INFORMATION2,
1472: ORG_INFORMATION3,ORG_INFORMATION4
1473: FROM hr_organization_information
1474: WHERE org_information_id=p_org_information_id;
1475:
1476: CURSOR csr_global(csr_v_global VARCHAR2 )IS
1477: SELECT nvl(global_value,0) FROM ff_globals_f,
1494: l_agreement_meaning varchar2(50);
1495:
1496: CURSOR csr_year IS
1497: SELECT count(*)
1498: FROM hr_organization_information hoi, hr_organization_units ou, fnd_sessions s
1499: WHERE hoi.org_information_context = 'SE_STD_WORK_DETAILS'
1500: AND ou.organization_id = hoi.organization_id
1501: AND ou.organization_id = nvl (l_organization_id, 0)
1502: AND ou.business_group_id = l_business_group_id