158: -- l_header_note_to_vendor varchar2(240);
159:
160: x_pb_count number;
161:
162: l_hrl_location hr_locations_all.location_code%TYPE;
163: l_hrl_description hr_locations_all.description%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
159:
160: x_pb_count number;
161:
162: l_hrl_location hr_locations_all.location_code%TYPE;
163: l_hrl_description hr_locations_all.description%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
167: l_hrl_town_or_city hr_locations_all.town_or_city%TYPE;
160: x_pb_count number;
161:
162: l_hrl_location hr_locations_all.location_code%TYPE;
163: l_hrl_description hr_locations_all.description%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
167: l_hrl_town_or_city hr_locations_all.town_or_city%TYPE;
168: l_hrl_postal_code hr_locations_all.postal_code%TYPE;
161:
162: l_hrl_location hr_locations_all.location_code%TYPE;
163: l_hrl_description hr_locations_all.description%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
167: l_hrl_town_or_city hr_locations_all.town_or_city%TYPE;
168: l_hrl_postal_code hr_locations_all.postal_code%TYPE;
169: -- EMAILPO FPH START--
162: l_hrl_location hr_locations_all.location_code%TYPE;
163: l_hrl_description hr_locations_all.description%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
167: l_hrl_town_or_city hr_locations_all.town_or_city%TYPE;
168: l_hrl_postal_code hr_locations_all.postal_code%TYPE;
169: -- EMAILPO FPH START--
170: l_hrl_to_region1 fnd_lookup_values.meaning%TYPE;
163: l_hrl_description hr_locations_all.description%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
167: l_hrl_town_or_city hr_locations_all.town_or_city%TYPE;
168: l_hrl_postal_code hr_locations_all.postal_code%TYPE;
169: -- EMAILPO FPH START--
170: l_hrl_to_region1 fnd_lookup_values.meaning%TYPE;
171: l_hrl_to_region2 fnd_lookup_values.meaning%TYPE;
164: l_hrl_address_line_1 hr_locations_all.address_line_1%TYPE;
165: l_hrl_address_line_2 hr_locations_all.address_line_2%TYPE;
166: l_hrl_address_line_3 hr_locations_all.address_line_3%TYPE;
167: l_hrl_town_or_city hr_locations_all.town_or_city%TYPE;
168: l_hrl_postal_code hr_locations_all.postal_code%TYPE;
169: -- EMAILPO FPH START--
170: l_hrl_to_region1 fnd_lookup_values.meaning%TYPE;
171: l_hrl_to_region2 fnd_lookup_values.meaning%TYPE;
172: l_hrl_to_region3 fnd_lookup_values.meaning%TYPE;
815: /* Bug 2766736. Changed ftv.nls_territory to ftv.territory_short_name in
816: the select statement */
817:
818: -- Bug 3574886: Query from base tables in case the session context is not set correctly
819: -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
820: select distinct
821: hlt.location_code,
822: hlt.description,
823: hrl.address_line_1,
839: l_hrl_town_or_city,
840: l_hrl_postal_code,
841: l_hrl_country,
842: l_hrl_to_region1
843: from hr_locations_all hrl,
844: hr_locations_all_tl hlt,
845: fnd_territories_vl ftv,
846: fnd_lookup_values_vl flv1,
847: fnd_lookup_values_vl flv2,
840: l_hrl_postal_code,
841: l_hrl_country,
842: l_hrl_to_region1
843: from hr_locations_all hrl,
844: hr_locations_all_tl hlt,
845: fnd_territories_vl ftv,
846: fnd_lookup_values_vl flv1,
847: fnd_lookup_values_vl flv2,
848: fnd_lookup_values_vl flv3
2361:
2362: l_document VARCHAR2(32000) := '';
2363: x_display_type varchar2(60);
2364:
2365: l_operating_unit_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2366: l_operating_unit_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2367: l_operating_unit_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2368: l_operating_unit_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2369: l_operating_unit_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2362: l_document VARCHAR2(32000) := '';
2363: x_display_type varchar2(60);
2364:
2365: l_operating_unit_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2366: l_operating_unit_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2367: l_operating_unit_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2368: l_operating_unit_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2369: l_operating_unit_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2370: l_operating_unit_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2363: x_display_type varchar2(60);
2364:
2365: l_operating_unit_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2366: l_operating_unit_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2367: l_operating_unit_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2368: l_operating_unit_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2369: l_operating_unit_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2370: l_operating_unit_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2371: -- EMAILPO FPH START--
2364:
2365: l_operating_unit_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2366: l_operating_unit_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2367: l_operating_unit_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2368: l_operating_unit_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2369: l_operating_unit_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2370: l_operating_unit_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2371: -- EMAILPO FPH START--
2372: /* Bug 2766736. Changed nls_territory to territory_short_name */
2365: l_operating_unit_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2366: l_operating_unit_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2367: l_operating_unit_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2368: l_operating_unit_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2369: l_operating_unit_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2370: l_operating_unit_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2371: -- EMAILPO FPH START--
2372: /* Bug 2766736. Changed nls_territory to territory_short_name */
2373: l_operating_unit_country FND_TERRITORIES_VL.TERRITORY_SHORT_NAME%TYPE;
2366: l_operating_unit_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2367: l_operating_unit_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2368: l_operating_unit_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2369: l_operating_unit_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2370: l_operating_unit_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2371: -- EMAILPO FPH START--
2372: /* Bug 2766736. Changed nls_territory to territory_short_name */
2373: l_operating_unit_country FND_TERRITORIES_VL.TERRITORY_SHORT_NAME%TYPE;
2374: l_operating_unit_state FND_LOOKUP_VALUES.MEANING%TYPE;
2377: -- EMAILPO FPH END--
2378: l_operating_unit_id NUMBER;
2379:
2380:
2381: l_ship_to_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2382: l_ship_to_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2383: l_ship_to_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2384: l_ship_to_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2385: l_ship_to_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2378: l_operating_unit_id NUMBER;
2379:
2380:
2381: l_ship_to_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2382: l_ship_to_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2383: l_ship_to_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2384: l_ship_to_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2385: l_ship_to_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2386: l_ship_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2379:
2380:
2381: l_ship_to_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2382: l_ship_to_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2383: l_ship_to_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2384: l_ship_to_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2385: l_ship_to_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2386: l_ship_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2387: -- EMAILPO FPH START--
2380:
2381: l_ship_to_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2382: l_ship_to_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2383: l_ship_to_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2384: l_ship_to_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2385: l_ship_to_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2386: l_ship_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2387: -- EMAILPO FPH START--
2388: /* Bug 2766736. Changed nls_territory to territory_short_name */
2381: l_ship_to_desc HR_LOCATIONS_ALL.DESCRIPTION%TYPE;
2382: l_ship_to_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2383: l_ship_to_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2384: l_ship_to_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2385: l_ship_to_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2386: l_ship_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2387: -- EMAILPO FPH START--
2388: /* Bug 2766736. Changed nls_territory to territory_short_name */
2389: l_ship_to_country FND_TERRITORIES_VL.TERRITORY_SHORT_NAME%TYPE;
2382: l_ship_to_add1 HR_LOCATIONS_ALL.address_line_1%TYPE;
2383: l_ship_to_add2 HR_LOCATIONS_ALL.address_line_2%TYPE;
2384: l_ship_to_add3 HR_LOCATIONS_ALL.address_line_3%TYPE;
2385: l_ship_to_city HR_LOCATIONS_ALL.town_or_city%TYPE;
2386: l_ship_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2387: -- EMAILPO FPH START--
2388: /* Bug 2766736. Changed nls_territory to territory_short_name */
2389: l_ship_to_country FND_TERRITORIES_VL.TERRITORY_SHORT_NAME%TYPE;
2390: l_ship_to_region1 FND_LOOKUP_VALUES.MEANING%TYPE;
2404: l_vendor_site_id NUMBER;
2405:
2406: l_vendor_id NUMBER;
2407:
2408: l_bill_to_desc hr_locations_all.description%TYPE;
2409: l_bill_to_add1 hr_locations_all.address_line_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2405:
2406: l_vendor_id NUMBER;
2407:
2408: l_bill_to_desc hr_locations_all.description%TYPE;
2409: l_bill_to_add1 hr_locations_all.address_line_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2406: l_vendor_id NUMBER;
2407:
2408: l_bill_to_desc hr_locations_all.description%TYPE;
2409: l_bill_to_add1 hr_locations_all.address_line_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2414: /* Bug 2766736. Changed hr_locations_all.country to
2407:
2408: l_bill_to_desc hr_locations_all.description%TYPE;
2409: l_bill_to_add1 hr_locations_all.address_line_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2414: /* Bug 2766736. Changed hr_locations_all.country to
2415: fnd_territories_vl.territory_short_name */
2408: l_bill_to_desc hr_locations_all.description%TYPE;
2409: l_bill_to_add1 hr_locations_all.address_line_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2414: /* Bug 2766736. Changed hr_locations_all.country to
2415: fnd_territories_vl.territory_short_name */
2416: l_bill_to_country fnd_territories_vl.territory_short_name%TYPE;
2409: l_bill_to_add1 hr_locations_all.address_line_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2414: /* Bug 2766736. Changed hr_locations_all.country to
2415: fnd_territories_vl.territory_short_name */
2416: l_bill_to_country fnd_territories_vl.territory_short_name%TYPE;
2417: l_bill_to_region1 hr_locations_all.region_1%TYPE;
2410: l_bill_to_add2 hr_locations_all.address_line_2%TYPE;
2411: l_bill_to_add3 hr_locations_all.address_line_3%TYPE;
2412: l_bill_to_city hr_locations_all.town_or_city%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2414: /* Bug 2766736. Changed hr_locations_all.country to
2415: fnd_territories_vl.territory_short_name */
2416: l_bill_to_country fnd_territories_vl.territory_short_name%TYPE;
2417: l_bill_to_region1 hr_locations_all.region_1%TYPE;
2418: l_bill_to_region2 hr_locations_all.region_2%TYPE;
2413: l_bill_to_postal_code HR_LOCATIONS_ALL.postal_code%TYPE;
2414: /* Bug 2766736. Changed hr_locations_all.country to
2415: fnd_territories_vl.territory_short_name */
2416: l_bill_to_country fnd_territories_vl.territory_short_name%TYPE;
2417: l_bill_to_region1 hr_locations_all.region_1%TYPE;
2418: l_bill_to_region2 hr_locations_all.region_2%TYPE;
2419: l_bill_to_region3 hr_locations_all.region_3%TYPE;
2420: l_bill_to_id NUMBER;
2421:
2414: /* Bug 2766736. Changed hr_locations_all.country to
2415: fnd_territories_vl.territory_short_name */
2416: l_bill_to_country fnd_territories_vl.territory_short_name%TYPE;
2417: l_bill_to_region1 hr_locations_all.region_1%TYPE;
2418: l_bill_to_region2 hr_locations_all.region_2%TYPE;
2419: l_bill_to_region3 hr_locations_all.region_3%TYPE;
2420: l_bill_to_id NUMBER;
2421:
2422:
2415: fnd_territories_vl.territory_short_name */
2416: l_bill_to_country fnd_territories_vl.territory_short_name%TYPE;
2417: l_bill_to_region1 hr_locations_all.region_1%TYPE;
2418: l_bill_to_region2 hr_locations_all.region_2%TYPE;
2419: l_bill_to_region3 hr_locations_all.region_3%TYPE;
2420: l_bill_to_id NUMBER;
2421:
2422:
2423: l_po_number PO_HEADERS_ALL.SEGMENT1%TYPE;
2700: /* Bug 2766736. Changed ftv.nls_territory to ftv.territory_short_name in
2701: the select statement. */
2702:
2703: -- Bug 3574886: Query from base tables in case the session context is not set correctly
2704: -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
2705: select distinct hlt.description,
2706: hrl.address_line_1,
2707: hrl.address_line_2,
2708: hrl.address_line_3,
2722: l_ship_to_city,
2723: l_ship_to_postal_code,
2724: l_ship_to_country,
2725: l_ship_to_region2
2726: FROM hr_locations_all hrl,
2727: hr_locations_all_tl hlt,
2728: fnd_territories_vl ftv,
2729: fnd_lookup_values_vl flv1,
2730: fnd_lookup_values_vl flv2,
2723: l_ship_to_postal_code,
2724: l_ship_to_country,
2725: l_ship_to_region2
2726: FROM hr_locations_all hrl,
2727: hr_locations_all_tl hlt,
2728: fnd_territories_vl ftv,
2729: fnd_lookup_values_vl flv1,
2730: fnd_lookup_values_vl flv2,
2731: fnd_lookup_values_vl flv3
2911: /* Bug 2766736. Changed ftv.nls_territory to ftv.territory_short_name in
2912: the select statement. */
2913:
2914: -- Bug 3574886: Query from base tables in case the session context is not set correctly
2915: -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
2916: select distinct hlt.description,
2917: hrl.address_line_1,
2918: hrl.address_line_2,
2919: hrl.address_line_3,
2933: l_ship_to_city,
2934: l_ship_to_postal_code,
2935: l_ship_to_country,
2936: l_ship_to_region2
2937: FROM hr_locations_all hrl,
2938: hr_locations_all_tl hlt,
2939: fnd_territories_vl ftv,
2940: fnd_lookup_values_vl flv1,
2941: fnd_lookup_values_vl flv2,
2934: l_ship_to_postal_code,
2935: l_ship_to_country,
2936: l_ship_to_region2
2937: FROM hr_locations_all hrl,
2938: hr_locations_all_tl hlt,
2939: fnd_territories_vl ftv,
2940: fnd_lookup_values_vl flv1,
2941: fnd_lookup_values_vl flv2,
2942: fnd_lookup_values_vl flv3
3201: the select statement. */
3202: begin
3203:
3204: -- Bug 3574886: Query from base tables in case the session context is not set correctly
3205: -- when this SQL is executed; fetch translated columns from hr_locations_all_tl
3206: select distinct hlt.description,
3207: hrl.address_line_1,
3208: hrl.address_line_2,
3209: hrl.address_line_3,
3222: l_bill_to_city,
3223: l_bill_to_country,
3224: l_bill_to_postal_code,
3225: l_bill_to_region2
3226: from hr_locations_all hrl,
3227: hr_locations_all_tl hlt,
3228: fnd_territories_vl ftv,
3229: fnd_lookup_values_vl flv1,
3230: fnd_lookup_values_vl flv2,
3223: l_bill_to_country,
3224: l_bill_to_postal_code,
3225: l_bill_to_region2
3226: from hr_locations_all hrl,
3227: hr_locations_all_tl hlt,
3228: fnd_territories_vl ftv,
3229: fnd_lookup_values_vl flv1,
3230: fnd_lookup_values_vl flv2,
3231: fnd_lookup_values_vl flv3