ZX_TRL_ESL_VAT_NO_V

Details

  • Schema: FUSION

  • Object owner: FND

  • Object type: VIEW

Columns

Name

TAX_REGISTRATION_NUMBER

LEGAL_ESTB_PTP_ID

ESTABLISHMENT_NAME

LEGAL_ENTITY_NAME

LEGAL_ENTITY_ID

ORGANIZATION_NUMBER

ADDRESS_LINE_1

ADDRESS_LINE_2

TOWN_OR_CITY

REGION_1

POSTAL_CODE

GEOGRAPHY_NAME

ESTB_ADDRESS

Query

SQL_Statement

SELECT DISTINCT

zreg.registration_number tax_registration_number,

ptp.party_tax_profile_id legal_estb_ptp_id,

etbp.name establishment_name,

le.name legal_entity_name ,

le.legal_entity_id legal_entity_id,

hp.party_number organization_number,

hrl.address_line_1 address_line_1,

hrl.address_line_2 address_line_2,

hrl.town_or_city town_or_city,

hrl.region_1 region_1,

hrl.postal_code postal_code,

geo.geography_name geography_name,

Decode(hrl.address_line_1, NULL, '', hrl.address_line_1 || ', ') ||

Decode(hrl.address_line_2, NULL, '', hrl.address_line_2 || ', ') ||

Decode(hrl.town_or_city, NULL, '', hrl.town_or_city ||

Decode (hrl.region_1, NULL, '', ', ')) || Nvl(hrl.region_1, '') ||

Decode(hrl.postal_code, NULL, '', ' - ' || hrl.postal_code) ||

Decode(geo.geography_name, NULL, '', ', ' || geo.geography_name) estb_address

FROM zx_registrations zreg,

zx_party_tax_profile ptp,

XLE_ETB_PROFILES etbp,

XLE_REGISTRATIONS reg,

XLE_LOCATIONS_V hrl,

xle_firstparty_information_v le,

hz_parties hp,

hz_geographies geo

WHERE ptp.party_type_code = 'LEGAL_ESTABLISHMENT'

AND zreg.party_tax_profile_id = ptp.party_tax_profile_id

AND zreg.registration_number IS NOT NULL

AND ptp.party_id = etbp.party_id

AND etbp.legal_entity_id = le.legal_entity_id

AND etbp.party_id = hp.party_id

AND etbp.GEOGRAPHY_ID = geo.GEOGRAPHY_ID

AND etbp.establishment_id = reg.source_id

AND reg.source_table = 'XLE_ETB_PROFILES'

AND hrl.location_id = reg.location_id

AND reg.identifying_flag = 'Y'