SELECT
bc.book_type_code Book,
fama.feeder_system_name Feeder_System,
fnduu.user_name Update_By,
PO_VENDORS.vendor_name Vendor,
fama.invoice_number INVNO,
fama.invoice_date INVDATE,
fama.mass_addition_id Asset,
fama.description Description,
fama.fixed_assets_cost Cost
--Added during DT Fix
,FA_FAS828_XMLP_PKG.D_COSTFormula(fama.feeder_system_name)
,FA_FAS828_XMLP_PKG.currency_codeformula(bc.book_type_code) currency_code
--End of DT Fix
FROM
FA_MASS_ADDITIONS fama,
FA_BOOK_CONTROLS_SEC bc, fnd_user_view fnduu,
po_vendors
WHERE
fama.POSTING_STATUS = 'DELETE'
and fama.book_type_code = bc.book_type_code
and bc.date_ineffective is null
and fnduu.user_id(+) = fama.invoice_updated_by
and po_vendors.vendor_id (+) = fama.po_vendor_id
UNION
SELECT
bc.book_type_code Book,
fama.feeder_system_name Feeder_System,
fnduu.user_name Update_By,
PO_VENDORS.vendor_name Vendor,
fama.invoice_number INVNO,
fama.invoice_date INVDATE,
fama.mass_addition_id Asset,
fama.description Description,
fama.fixed_assets_cost Cost
--Added during DT Fix
,FA_FAS828_XMLP_PKG.D_COSTFormula(fama.feeder_system_name)
,FA_FAS828_XMLP_PKG.currency_codeformula(bc.book_type_code) currency_code
--End of DT Fix
FROM
FA_MASS_ADDITIONS famap,
FA_MASS_ADDITIONS fama,
FA_BOOK_CONTROLS_SEC bc, fnd_user_view fnduu,
po_vendors
WHERE
famap.mass_addition_id = fama.parent_mass_addition_id
and famap.POSTING_STATUS = 'DELETE'
and fama.book_type_code = bc.book_type_code
and famap.book_type_code = bc.book_type_code
and fama.split_merged_code = 'MC'
and bc.date_ineffective is null
and fnduu.user_id(+) = fama.invoice_updated_by
and po_vendors.vendor_id (+) = fama.po_vendor_id
--ORDER BY 1,2,3,4,5,7
ORDER BY 1,2,4,3,5,6,7,8,9 |