PO Approval History

Description

Categories
Enginatics
Repository
GitHub
Approval and action history of purchase orders, releases, agreements and requisitions: one row per entry of the document's action history (submit, forward, approve, reject, return, reserve, cancel, close, hold), in sequence.

The pending step of a document awaiting approval is shown with action Pending and the current approver as performer. Days Since Previous Action is measured from the previous history entry, for a pending step until today. Submitted Date is the latest submission up to that step.

For a release, Document Number is the number of its blanket agreement.

SQL 70 lines

Parameters 9

ParameterTypeList of values SQL
Operating UnitLOV
haouv.name=:operating_unit
Document TypeLOV
x.document_type=:document_type
Document NumberChar
coalesce(pha.segment1,pha_rel.segment1,prha.segment1)=:document_number
SupplierLOV
coalesce(pha.vendor_id,pha_rel.vendor_id) in (select aps.vendor_id from ap_suppliers aps where aps.vendor_name=:supplier)
PerformerLOV
x.performer=:performer
ActionLOV
x.action_code=xxen_util.lookup_code(:action,'APPR_HIST_ACTIONS',201)
Action Date FromDate
x.action_date>=:action_date_from
Action Date ToDate
x.action_date<:action_date_to+1
Pending OnlyLOV
x.action_code is null