View: dbo.Tax_Code_Full_View
View definition
-- DESCRIPTION
-- This view flattens the contents of the Tax Code table, the Tax Code N Ultra Tax Tax
-- Code table and the Ultra Tax Tax Code table into a comprehensive list of all tax code
-- per entity per code year. This includes global tax codes.
-- When using this view, it is usually necessary to limit the result set by:
-- a) Client (filter by client_KEY)
-- b) Code year (filter by code_year; usually the current period's year if tax codes)
-- c) Entity (filter by ultra_tax_entity_type_KEY)
--drop view dbo.Tax_Code_Full_View
create view dbo.Tax_Code_Full_View
as
select
-- This is the unique key for the view.
tcnuttc.tax_code_n_ultra_tax_tax_code_KEY
, tc.client_KEY
, tc.tax_code_KEY
, uttc.ultra_tax_tax_code_KEY
, uttc.ultra_tax_entity_type_KEY
, uttc.code_year
, tc.tax_code
, tc.tax_subcode
, uttc.description as tax_code_description
, tcnuttc.tax_subcode_description
, uttc.ultra_tax_category_type_KEY
, uttc.gl_account_type_KEY
from
dbo.Tax_Code as tc
inner join dbo.Tax_Code_N_Ultra_Tax_Tax_Code as tcnuttc
on tc.tax_code_KEY = tcnuttc.tax_code_KEY
inner join dbo.Ultra_Tax_Tax_Code as uttc
on tcnuttc.ultra_tax_tax_code_KEY = uttc.ultra_tax_tax_code_KEY