74: /*Bug 5084855 Adding the NVL to get the Country value for Generic Address Style */
75: SELECT hrl.address_line_1
76: , hrl.address_line_2
77: , hrl.address_line_3
78: --, hrl.town_or_city -- bug#15993315 commented to take town_or_city from fnd_lookup_values
79: , Decode(hrl.town_or_city,flv4.lookup_code,flv4.meaning,hrl.town_or_city)
80: , NVL(DECODE(hrl.region_1,NULL,hrl.region_2,
81: DECODE(flv1.meaning,NULL,
82: DECODE(flv2.meaning,NULL,flv3.meaning,flv2.lookup_code)
94: , x_iso_territory_code
95: FROM hr_locations_all hrl
96: , fnd_territories fte
97: , fnd_territories_tl ftel
98: , fnd_lookup_values flv1
99: , fnd_lookup_values flv2
100: , fnd_lookup_values flv3
101: , fnd_lookup_values flv4
102: WHERE hrl.location_id = p_location_id
95: FROM hr_locations_all hrl
96: , fnd_territories fte
97: , fnd_territories_tl ftel
98: , fnd_lookup_values flv1
99: , fnd_lookup_values flv2
100: , fnd_lookup_values flv3
101: , fnd_lookup_values flv4
102: WHERE hrl.location_id = p_location_id
103: AND hrl.country = fte.territory_code (+)
96: , fnd_territories fte
97: , fnd_territories_tl ftel
98: , fnd_lookup_values flv1
99: , fnd_lookup_values flv2
100: , fnd_lookup_values flv3
101: , fnd_lookup_values flv4
102: WHERE hrl.location_id = p_location_id
103: AND hrl.country = fte.territory_code (+)
104: AND hrl.country = ftel.territory_code (+)
97: , fnd_territories_tl ftel
98: , fnd_lookup_values flv1
99: , fnd_lookup_values flv2
100: , fnd_lookup_values flv3
101: , fnd_lookup_values flv4
102: WHERE hrl.location_id = p_location_id
103: AND hrl.country = fte.territory_code (+)
104: AND hrl.country = ftel.territory_code (+)
105: AND DECODE(ftel.territory_code, NULL, '1', ftel.language) =
187: , x_iso_territory_code
188: FROM hz_locations hzl
189: , fnd_territories fte
190: , fnd_territories_tl ftel
191: , fnd_lookup_values flv1
192: , fnd_lookup_values flv2
193: , fnd_lookup_values flv3
194: WHERE hzl.location_id = p_location_id
195: AND hzl.country = fte.territory_code (+)
188: FROM hz_locations hzl
189: , fnd_territories fte
190: , fnd_territories_tl ftel
191: , fnd_lookup_values flv1
192: , fnd_lookup_values flv2
193: , fnd_lookup_values flv3
194: WHERE hzl.location_id = p_location_id
195: AND hzl.country = fte.territory_code (+)
196: AND hzl.country = ftel.territory_code (+)
189: , fnd_territories fte
190: , fnd_territories_tl ftel
191: , fnd_lookup_values flv1
192: , fnd_lookup_values flv2
193: , fnd_lookup_values flv3
194: WHERE hzl.location_id = p_location_id
195: AND hzl.country = fte.territory_code (+)
196: AND hzl.country = ftel.territory_code (+)
197: AND DECODE(ftel.territory_code, NULL, '1', ftel.language) =
402: x_contact_fax
403: FROM
404: HR_LOCATIONS HLC,
405: FND_TERRITORIES_TL FTE,
406: FND_LOOKUP_VALUES FCL1,
407: FND_LOOKUP_VALUES FCL2,
408: FND_LOOKUP_VALUES FCL3,
409: FND_LOOKUP_VALUES FCL4
410: Where
403: FROM
404: HR_LOCATIONS HLC,
405: FND_TERRITORIES_TL FTE,
406: FND_LOOKUP_VALUES FCL1,
407: FND_LOOKUP_VALUES FCL2,
408: FND_LOOKUP_VALUES FCL3,
409: FND_LOOKUP_VALUES FCL4
410: Where
411: HLC.LOCATION_ID = p_location_id AND
404: HR_LOCATIONS HLC,
405: FND_TERRITORIES_TL FTE,
406: FND_LOOKUP_VALUES FCL1,
407: FND_LOOKUP_VALUES FCL2,
408: FND_LOOKUP_VALUES FCL3,
409: FND_LOOKUP_VALUES FCL4
410: Where
411: HLC.LOCATION_ID = p_location_id AND
412: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
405: FND_TERRITORIES_TL FTE,
406: FND_LOOKUP_VALUES FCL1,
407: FND_LOOKUP_VALUES FCL2,
408: FND_LOOKUP_VALUES FCL3,
409: FND_LOOKUP_VALUES FCL4
410: Where
411: HLC.LOCATION_ID = p_location_id AND
412: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
413: DECODE(FTE.TERRITORY_CODE, NULL, '1', FTE.LANGUAGE) =
501: x_address_line_4
502: FROM
503: HZ_LOCATIONS HLC,
504: FND_TERRITORIES_TL FTE,
505: FND_LOOKUP_VALUES FCL1,
506: FND_LOOKUP_VALUES FCL2,
507: FND_LOOKUP_VALUES FCL3
508: WHERE
509: HLC.LOCATION_ID = p_location_id AND
502: FROM
503: HZ_LOCATIONS HLC,
504: FND_TERRITORIES_TL FTE,
505: FND_LOOKUP_VALUES FCL1,
506: FND_LOOKUP_VALUES FCL2,
507: FND_LOOKUP_VALUES FCL3
508: WHERE
509: HLC.LOCATION_ID = p_location_id AND
510: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
503: HZ_LOCATIONS HLC,
504: FND_TERRITORIES_TL FTE,
505: FND_LOOKUP_VALUES FCL1,
506: FND_LOOKUP_VALUES FCL2,
507: FND_LOOKUP_VALUES FCL3
508: WHERE
509: HLC.LOCATION_ID = p_location_id AND
510: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
511: DECODE(FTE.TERRITORY_CODE, NULL, '1', FTE.LANGUAGE) =
722: /*Bug 5084855 Adding the NVL to get the Country value for Generic Address Style */
723: Select HLC.ADDRESS_LINE_1,
724: HLC.ADDRESS_LINE_2,
725: HLC.ADDRESS_LINE_3,
726: -- HLC.TOWN_OR_CITY, --bug#15993315 commented to fetch town_or_city from fnd_lookup_values
727: Decode(HLC.TOWN_OR_CITY,FCL4.lookup_code,FCL4.meaning,HLC.TOWN_OR_CITY),
728: NVL(DECODE(HLC.REGION_1, NULL, HLC.REGION_2,
729: DECODE(FCL1.MEANING, NULL,
730: DECODE(FCL2.MEANING, NULL,FCL3.MEANING, FCL2.LOOKUP_CODE),
747: x_contact_fax
748: FROM
749: HR_LOCATIONS HLC,
750: FND_TERRITORIES_TL FTE,
751: FND_LOOKUP_VALUES FCL1,
752: FND_LOOKUP_VALUES FCL2,
753: FND_LOOKUP_VALUES FCL3,
754: FND_LOOKUP_VALUES FCL4
755: Where
748: FROM
749: HR_LOCATIONS HLC,
750: FND_TERRITORIES_TL FTE,
751: FND_LOOKUP_VALUES FCL1,
752: FND_LOOKUP_VALUES FCL2,
753: FND_LOOKUP_VALUES FCL3,
754: FND_LOOKUP_VALUES FCL4
755: Where
756: HLC.LOCATION_ID = p_location_id AND
749: HR_LOCATIONS HLC,
750: FND_TERRITORIES_TL FTE,
751: FND_LOOKUP_VALUES FCL1,
752: FND_LOOKUP_VALUES FCL2,
753: FND_LOOKUP_VALUES FCL3,
754: FND_LOOKUP_VALUES FCL4
755: Where
756: HLC.LOCATION_ID = p_location_id AND
757: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
750: FND_TERRITORIES_TL FTE,
751: FND_LOOKUP_VALUES FCL1,
752: FND_LOOKUP_VALUES FCL2,
753: FND_LOOKUP_VALUES FCL3,
754: FND_LOOKUP_VALUES FCL4
755: Where
756: HLC.LOCATION_ID = p_location_id AND
757: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
758: DECODE(FTE.TERRITORY_CODE, NULL, '1', FTE.LANGUAGE) =
1027: l_style_code
1028: FROM
1029: HZ_LOCATIONS HLC,
1030: FND_TERRITORIES_TL FTE,
1031: FND_LOOKUP_VALUES FCL1,
1032: FND_LOOKUP_VALUES FCL2,
1033: FND_LOOKUP_VALUES FCL3
1034: WHERE
1035: HLC.LOCATION_ID = p_location_id AND
1028: FROM
1029: HZ_LOCATIONS HLC,
1030: FND_TERRITORIES_TL FTE,
1031: FND_LOOKUP_VALUES FCL1,
1032: FND_LOOKUP_VALUES FCL2,
1033: FND_LOOKUP_VALUES FCL3
1034: WHERE
1035: HLC.LOCATION_ID = p_location_id AND
1036: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
1029: HZ_LOCATIONS HLC,
1030: FND_TERRITORIES_TL FTE,
1031: FND_LOOKUP_VALUES FCL1,
1032: FND_LOOKUP_VALUES FCL2,
1033: FND_LOOKUP_VALUES FCL3
1034: WHERE
1035: HLC.LOCATION_ID = p_location_id AND
1036: HLC.COUNTRY = FTE.TERRITORY_CODE (+) AND
1037: DECODE(FTE.TERRITORY_CODE, NULL, '1', FTE.LANGUAGE) =