681: , per_addresses addr
682: , per_all_people_f ppf
683: , fnd_territories_tl fttl
684: , fnd_territories ftt
685: , hr_lookups hrt
686: where ASSIGN.assignment_id = c_assignment_id
687: and c_effective_date BETWEEN ASSIGN.effective_start_date
688: AND ASSIGN.effective_end_date
689: and assign.person_id = ppf.person_id
726: , per_addresses ADDR
727: , per_all_people_f PPF
728: , fnd_territories_tl fttl
729: , fnd_territories ftt
730: , hr_lookups hrt
731: where ASSIGN.assignment_id = c_assignment_id
732: and ASSIGN.person_id = ppf.person_id
733: and assign.assignment_type = 'E'
734: and ADDR.person_id = ASSIGN.person_id
767: FROM per_addresses ADDR
768: , per_all_people_f PPF
769: , fnd_territories_tl fttl
770: , fnd_territories ftt
771: , hr_lookups hrt
772: where ppf.person_id = c_person_id
773: and c_effective_date BETWEEN ppf.effective_start_date
774: AND ppf.effective_end_date
775: and ADDR.person_id = ppf.person_id
808: FROM per_addresses addr
809: , per_all_people_f ppf
810: , fnd_territories_tl fttl
811: , fnd_territories ftt
812: , hr_lookups hrt
813: where ppf.person_id = c_person_id
814: and addr.person_id = ppf.person_id
815: and addr.primary_flag = 'Y'
816: and NVL(addr.country,'US') = ftt.territory_code
1012: hl.region_1,
1013: hl.region_2,
1014: 'Y' valid_address
1015: FROM hr_locations_all hl,
1016: hr_lookups hrl,
1017: hr_all_organization_units hou
1018: WHERE hou.organization_id = c_organization_id
1019: AND hl.location_id = hou.location_id
1020: AND nvl(hl.inactive_date,end_date)>= c_effective_date