Deleted Invoice Voucher Num
select dsa.SET_OF_BOOKS_ID,aud.doc_sequence_value,
aud.doc_sequence_id,
aud.creation_date,
fu.USER_NAME,
decode(i.doc_sequence_value, null, 'Deleted', '') status,
dsc.name category,
-- v.segment1 vendor_num,
--hp.party_name,
i.invoice_num,
i.invoice_currency_code,
i.invoice_amount,
dsa.CATEGORY_CODE
--l.displayed_field paid
from --ap_lookup_codes l,
ap_doc_sequence_audit aud,
fnd_doc_sequence_assignments dsa,
fnd_doc_sequence_categories dsc,
-- hz_parties hp,
-- ap_suppliers v,
ap_invoices_all i,
fnd_user fu
where 1=1 --aud.doc_sequence_id = :C_sequence_id --Commented
and aud.doc_sequence_id = i.doc_sequence_id(+)
and aud.doc_sequence_value = i.doc_sequence_value(+)
-- and aud.doc_sequence_value between :P_sequence_from and :P_sequence_to -Commented
and aud.doc_sequence_assignment_id = dsa.doc_sequence_assignment_id
and dsa.category_code = dsc.code
and dsa.application_id = dsc.application_id
and fu.USER_ID=aud.CREATED_BY
-- and i.party_id = hp.party_id(+)
-- and hp.party_id = v.party_id(+)
-- and l.lookup_type(+) = 'INVOICE PAYMENT STATUS'
-- and l.lookup_code(+) = i.payment_status_flag
and i.doc_sequence_value is null
and dsc.NAME like '%Invoices%'
and dsa.SET_OF_BOOKS_ID = NVL('&Ledger_id',DSA.SET_OF_BOOKS_ID)
order by aud.doc_sequence_value
--------------------------------------------------------------------------------------------------------------------------
Deleted Payments Voucher Num
select dsa.SET_OF_BOOKS_ID,aud.doc_sequence_value,
aud.doc_sequence_id,
aud.creation_date,
fu.USER_NAME,
decode(i.doc_sequence_value,null,'Deleted','') status,
dsc.name category
-- v.segment1 vendor_num,
--hp.party_name,
--i.invoice_num,
--i.invoice_currency_code,
--i.invoice_amount,
--l.displayed_field paid
from -- ap_lookup_codes l,
ap_doc_sequence_audit aud,
fnd_doc_sequence_assignments dsa,
fnd_doc_sequence_categories dsc,
-- hz_parties hp,
-- ap_suppliers v,
ap_checks_all i,
FND_User fu
where
-- aud.doc_sequence_id = :C_sequence_id
aud.doc_sequence_id = i.doc_sequence_id(+)
and aud.doc_sequence_value = i.doc_sequence_value(+)
--and aud.doc_sequence_value between :P_sequence_from and :P_sequence_to
and aud.doc_sequence_assignment_id = dsa.doc_sequence_assignment_id
and dsa.category_code = dsc.code
and dsa.application_id = dsc.application_id
and aud.CREATED_BY=fu.USER_ID
--and i.party_id = hp.party_id (+)
--and hp.party_id = v.party_id(+)
--and l.lookup_type(+) = 'INVOICE PAYMENT STATUS'
--and l.lookup_code(+) = i.payment_status_flag
and dsc.NAME like '%Payments%'
and i.DOC_SEQUENCE_VALUE is null
and dsa.SET_OF_BOOKS_ID=NVL('&Ledger_id',dsa.SET_OF_BOOKS_ID)
order by aud.doc_sequence_value
I have used the same for the Audit Purpose!
ReplyDelete