524: INTO l_chk_done
525: FROM DUAL
526: WHERE EXISTS ( select 'Y'
527: from hz_relationships hzr
528: where hzr.subject_table_name = 'HZ_PARTIES'
529: and hzr.object_table_name = 'HZ_PARTIES'
530: and hzr.relationship_type = 'GLOBAL_ULTIMATE'
531: and hzr.relationship_code = 'GLOBAL_ULTIMATE_OF'
532: and hzr.status = 'A'
525: FROM DUAL
526: WHERE EXISTS ( select 'Y'
527: from hz_relationships hzr
528: where hzr.subject_table_name = 'HZ_PARTIES'
529: and hzr.object_table_name = 'HZ_PARTIES'
530: and hzr.relationship_type = 'GLOBAL_ULTIMATE'
531: and hzr.relationship_code = 'GLOBAL_ULTIMATE_OF'
532: and hzr.status = 'A'
533: and sysdate between hzr.start_date and nvl(hzr.end_date, sysdate)
549: INTO l_chk_done
550: FROM DUAL
551: WHERE EXISTS ( select 'Y'
552: from hz_relationships hzr
553: where hzr.subject_table_name = 'HZ_PARTIES'
554: and hzr.object_table_name = 'HZ_PARTIES'
555: and hzr.relationship_type = 'DOMESTIC_ULTIMATE'
556: and hzr.relationship_code = 'DOMESTIC_ULTIMATE_OF'
557: and hzr.status = 'A'
550: FROM DUAL
551: WHERE EXISTS ( select 'Y'
552: from hz_relationships hzr
553: where hzr.subject_table_name = 'HZ_PARTIES'
554: and hzr.object_table_name = 'HZ_PARTIES'
555: and hzr.relationship_type = 'DOMESTIC_ULTIMATE'
556: and hzr.relationship_code = 'DOMESTIC_ULTIMATE_OF'
557: and hzr.status = 'A'
558: and sysdate between hzr.start_date and nvl(hzr.end_date, sysdate)
573:
574: select lkp.lookup_code
575: into l_site_type_code
576: from fnd_lookups lkp,
577: hz_parties hzp
578: where lkp.lookup_type = 'JTF_TTY_SITE_TYPE_CODE'
579: and hzp.hq_branch_ind = lkp.lookup_code
580: and hzp.party_id = p_party_id;
581: