FA Reserve Detail - draft

Description
Categories: BI Publisher
Application: Assets
Source: Reserve Detail Report (XML) - Not Supported: Reserved For Future Use
Short Name: FASRSVED_XML
DB package: FA_FASRSVED_XMLP_PKG
SELECT
	&ACCT_FLEX_BAL_SEG					COMP_CODE,
	NVL (&ACCT_FLEX_ACCT_SEG, BAL.Category_Books_Account)	ACCOUNT,
	&ACCT_FLEX_COST_SEG					COST_CTR,
	AD.Asset_Number						ASSET,	
	SUM (DECODE (BAL.Source_Type_Code, 
		'BEGIN', NVL(BAL.Amount,0), NULL)) 			BEGIN,
	SUM (DECODE (BAL.Source_Type_Code, 
		'ADDITION', NVL(BAL.Amount,0), NULL)) 			ADDITION,
	SUM (DECODE (BAL.Source_Type_Code, 
		'DEPRECIATION', NVL(BAL.Amount,0), NULL)) 		DEPRECIATION,
	SUM (DECODE (BAL.Source_Type_Code, 
		'RECLASS', NVL(BAL.Amount,0), NULL)) 			RECLASS,
	SUM (DECODE (BAL.Source_Type_Code, 
		'RETIREMENT', -NVL(BAL.Amount,0), NULL))			RETIREMENT,
	SUM (DECODE (BAL.Source_Type_Code, 
		'REVALUATION', NVL(BAL.Amount,0), NULL)) 			REVALUATION,
	SUM (DECODE (BAL.Source_Type_Code, 
		'TAX', NVL(BAL.Amount,0), NULL)) 				TAX,
	SUM (DECODE (BAL.Source_Type_Code, 
		'TRANSFER', NVL(BAL.Amount,0), NULL)) 			TRANSFER,
	SUM (DECODE (BAL.Source_Type_Code, 
		'END', NVL(BAL.Amount,0), NULL)) 				END, 
	--fnd_flex_xml_publisher_apis.process_kff_combination_1('comp_code_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE') COMP_CODE_DSP, 
	fnd_flex_xml_publisher_apis.process_kff_combination_1('comp_code_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_BALANCING', 'Y', 'VALUE') COMP_CODE_DSP1, 
	FA_FASRSVED_XMLP_PKG.bal_out_of_balanceformula(:BAL_BEGIN, :BAL_ADD, :BAL_DEPRN, :BAL_RECLASS, :BAL_RETIRE, :BAL_ADJUST, :BAL_TRANS, :BAL_END) BAL_OUT_OF_BALANCE, 
	--fnd_flex_xml_publisher_apis.process_kff_combination_1('account_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE') ACCOUNT_DSP, 
	fnd_flex_xml_publisher_apis.process_kff_combination_1('account_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE') ACCOUNT_DSP1, 
	FA_FASRSVED_XMLP_PKG.acct_out_of_balanceformula(:ACCT_BEGIN, :ACCT_ADD, :ACCT_DEPRN, :ACCT_RECLASS, :ACCT_RETIRE, :ACCT_ADJUST, :ACCT_TRANS, :ACCT_END) ACCT_OUT_OF_BALANCE, 
	--fnd_flex_xml_publisher_apis.process_kff_combination_1('cost_ctr_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE') COST_CTR_DSP, 
	fnd_flex_xml_publisher_apis.process_kff_combination_1('cost_ctr_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE') COST_CTR_DSP1, 
	FA_FASRSVED_XMLP_PKG.ctr_out_of_balanceformula(:CTR_BEGIN, :CTR_ADD, :CTR_DEPRN, :CTR_RECLASS, :CTR_RETIRE, :CTR_ADJUST, :CTR_TRANS, :CTR_END) CTR_OUT_OF_BALANCE, 
	FA_FASRSVED_XMLP_PKG.adjustformula(SUM ( DECODE ( BAL.Source_Type_Code , 'TAX' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'REVALUATION' , NVL ( BAL.Amount , 0 ) , NULL ) )) ADJUST, 
	FA_FASRSVED_XMLP_PKG.out_of_balanceformula(SUM ( DECODE ( BAL.Source_Type_Code , 'BEGIN' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'ADDITION' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'DEPRECIATION' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'RECLASS' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'RETIREMENT' , - NVL ( BAL.Amount , 0 ) , NULL ) ), :ADJUST, SUM ( DECODE ( BAL.Source_Type_Code , 'TRANSFER' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'END' , NVL ( BAL.Amount , 0 ) , NULL ) )) OUT_OF_BALANCE, 
	FA_FASRSVED_XMLP_PKG.reval_tax_flagformula(SUM ( DECODE ( BAL.Source_Type_Code , 'REVALUATION' , NVL ( BAL.Amount , 0 ) , NULL ) ), SUM ( DECODE ( BAL.Source_Type_Code , 'TAX' , NVL ( BAL.Amount , 0 ) , NULL ) )) REVAL_TAX_FLAG
FROM
	FA_BALANCES_REPORT_GT BAL,
	FA_ADDITIONS AD,
	GL_CODE_COMBINATIONS DHCC,
	GL_CODE_COMBINATIONS AJCC
WHERE
	AD.Asset_ID	= BAL.Asset_ID
AND
	DHCC.Code_Combination_ID	= BAL.Distribution_CCID
AND	
	AJCC.Code_Combination_ID (+)	= BAL.Adjustment_CCID
AND
	:DO_INSERT = 1
GROUP BY
	&ACCT_FLEX_BAL_SEG,
	NVL (&ACCT_FLEX_ACCT_SEG, BAL.Category_Books_Account),
	&ACCT_FLEX_COST_SEG,
	AD.ASSET_NUMBER
--Added during DT Fix
	,fnd_flex_xml_publisher_apis.process_kff_combination_1('comp_code_dsp', '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('account_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'VALUE')
	,fnd_flex_xml_publisher_apis.process_kff_combination_1('cost_ctr_dsp', 'SQLGL', 'GL#', dhcc.CHART_OF_ACCOUNTS_ID, NULL, dhcc.CODE_COMBINATION_ID, 'FA_COST_CTR', 'Y', 'VALUE')
--End of DT Fix
ORDER BY 1 ASC,2 ASC,3 ASC , 1 , 2 , 3 , 
  4
Parameter Name SQL text Validation
Report Type
 
To Period
 
LOV Oracle
From Period
 
LOV Oracle
Set of Books Currency
 
LOV Oracle
Book
 
LOV Oracle