FA Tax Preference - draft

Description
Categories: BI Publisher
Application: Assets
Source: Tax Preference Report (XML) - Not Supported: Reserved For Future Use
Short Name: FASTXPRF_XML
DB package: FA_FASTXPRF_XMLP_PKG
SELECT
	FR.COMP_CODE			COMP_CODE,
	FR.DEPRN_METHOD			FED_METHOD,
	FR.ASSET_ACCOUNT			ASSET_ACCOUNT,
	fnd_flex_xml_publisher_apis.process_kff_combination_1('cat_flex_all_seg', 'OFA', 'CAT#', 101, NULL, cat.CATEGORY_ID, 'ALL', 'Y', 'VALUE')			CATEGORY,
	AD.ASSET_NUMBER			ASSET_NUMBER,
	FR.FED_YTD_DEPRN			FED_YTD_DEPRN,
	SUM(DD_CORP.DEPRN_AMOUNT)	CORP_YTD_DEPRN,
	DECODE(SIGN(FR.FED_YTD_DEPRN - SUM(DD_CORP.DEPRN_AMOUNT)), -1, 0,
                        FR.FED_YTD_DEPRN - SUM(DD_CORP.DEPRN_AMOUNT))   DIFFERENCE, 
	--fnd_flex_xml_publisher_apis.process_kff_combination_1('d_comp_code', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE') D_COMP_CODE, 
	--fnd_flex_xml_publisher_apis.process_kff_combination_1('d_category', 'OFA', 'CAT#', 101, NULL, cat.CATEGORY_ID, 'ALL', 'Y', 'VALUE') D_CATEGORY
	fnd_flex_xml_publisher_apis.process_kff_combination_1('d_comp_code', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE') D_COMP_CODE1, 
	fnd_flex_xml_publisher_apis.process_kff_combination_1('d_category', 'OFA', 'CAT#', 101, NULL, cat.CATEGORY_ID, 'ALL', 'Y', 'VALUE') D_CATEGORY1
FROM    
	FA_TAX_REPORT			FR,
 	FA_DEPRN_PERIODS			DP,
 	FA_DEPRN_DETAIL			DD_CORP,
                  FA_ASSET_HISTORY             AH,
	FA_CATEGORY_BOOKS		CB_CORP,
	FA_CATEGORIES			CAT,
	FA_ADDITIONS			AD,
	FA_DISTRIBUTION_HISTORY		DH,
	GL_CODE_COMBINATIONS		DHCC
WHERE	FR.REQUEST_ID			= :P_CONC_REQUEST_ID
AND	FR.ASSET_ID			= DD_CORP.ASSET_ID
and     fr.asset_id = ah.asset_id
and         AH.DATE_EFFECTIVE <= DP.PERIOD_CLOSE_DATE
and         NVL(AH.DATE_INEFFECTIVE, DP.PERIOD_CLOSE_DATE+1) > DP.PERIOD_CLOSE_DATE
and        CB_CORP.CATEGORY_ID             = AH.CATEGORY_ID
AND	DD_CORP.BOOK_TYPE_CODE		= :DISTRIBUTION_SOURCE_BOOK
AND	DD_CORP.PERIOD_COUNTER BETWEEN :min_corp_pc 
		AND  :corp_end_pc
AND	CB_CORP.BOOK_TYPE_CODE		= DD_CORP.BOOK_TYPE_CODE
AND	CB_CORP.ASSET_COST_ACCT BETWEEN NVL(:P_FROM_ACCT, CB_CORP.ASSET_COST_ACCT)
		AND NVL(:P_TO_ACCT, CB_CORP.ASSET_COST_ACCT)
AND	CB_CORP.CATEGORY_ID		= CAT.CATEGORY_ID
AND	DP.BOOK_TYPE_CODE		= :P_BOOK
AND	DP.PERIOD_COUNTER		= :max_fed_pc
AND	FR.ASSET_ID			= AD.ASSET_ID
and	DH.ASSET_ID			= DD_CORP.ASSET_ID		AND
	DH.DISTRIBUTION_ID		= DD_CORP.DISTRIBUTION_ID	AND
	DH.CODE_COMBINATION_ID          = DHCC.CODE_COMBINATION_ID(+) and
	fr.comp_code =fnd_flex_xml_publisher_apis.process_kff_combination_1('acct_flex_bal_seg', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE')
GROUP BY 
	FR.COMP_CODE,
	FR.DEPRN_METHOD,
	FR.ASSET_ACCOUNT,
	fnd_flex_xml_publisher_apis.process_kff_combination_1('cat_flex_all_seg', 'OFA', 'CAT#', 101, NULL, cat.CATEGORY_ID, 'ALL', 'Y', 'VALUE'),
	AD.ASSET_NUMBER,
	FR.FED_YTD_DEPRN
--Added during DT Fix
	,fnd_flex_xml_publisher_apis.process_kff_combination_1('d_comp_code', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE')
	,fnd_flex_xml_publisher_apis.process_kff_combination_1('d_category', 'OFA', 'CAT#', 101, NULL, cat.CATEGORY_ID, 'ALL', 'Y', 'VALUE')
order by 1, 2, 3, 4, 5, 6, 7, 8
--End of DT Fix
Parameter Name SQL text Validation
To Account
 
From Account
 
Tax Period
 
LOV Oracle
Book
 
LOV Oracle