VCHR_AF_HDR_VW2

(SQL View)
Index Back

Voucher Approval Search

Voucher Approval Search Record

SELECT a.business_unit , a.voucher_id , a.appr_status , a.oprid , a.oprid_last_updt FROM PS_VOUCHER a , ps_set_cntrl_rec b , ps_bus_unit_opt_ap c WHERE a.appr_status = 'P' AND a.voucher_style <> 'TMPL' AND a.vchr_apprvl_flg = 'W' AND a.close_status <> 'C' AND a.process_man_close <> 'Y' AND a.entry_status = 'P' AND A.MATCH_STATUS_VCHR IN ('N','M') AND B.SETCNTRLVALUE = A.BUSINESS_UNIT AND B.RECNAME = 'BUS_UNIT_OPT_AP' AND B.REC_GROUP_ID = 'AP_01' AND B.SETID = C.SETID AND ((C.REQ_VALID_KKDT = 'N') OR (C.REQ_VALID_KKDT = 'Y' AND a.doc_tol_hdr_status = 'V' AND a.budget_hdr_status = 'V' AND a.budget_misc_status = 'V')) AND c.effdt = ( SELECT MAX(cc.effdt) FROM ps_bus_unit_opt_ap cc WHERE cc.setid = c.setid AND cc.effdt <= a.invoice_dt) AND c.eff_status = 'A' AND NOT EXISTS ( SELECT 'X' FROM PS_VCHR_AF_XREF XREF WHERE XREF.BUSINESS_UNIT = a.BUSINESS_UNIT AND XREF.VOUCHER_ID = a.VOUCHER_ID AND XREF.EOAWTHREAD_STATUS = 'P') AND (((a.vchr_src IN ('AMLS', 'ARCR', 'BILL', 'CLBK', 'CNTR', 'CONS', 'EDI', 'FRE', 'MTCH', 'NERS', 'ONL', 'PAYR', 'PBIL', 'PERS', 'PPAY', 'PROC', 'QUCK', 'RBCR', 'RETL', 'RPOV', 'RTV', 'SAD', 'SPRO', 'TRPM', 'XLS','PRQ')) OR (A.vchr_src IN ('XML','DCM') AND NOT EXISTS ( SELECT 'X' FROM PS_EM_BUY_REG_TBL H , PS_EM_AGREEMENT g , PS_SET_CNTRL_REC i WHERE i.setcntrlvalue = a.business_unit AND i.rec_group_id = 'EM_01' AND i.recname = 'EM_AGREEMENT' AND i.setid = g.SETID AND H.BUSINESS_UNIT = a.BUSINESS_UNIT AND a.vendor_setid = g.vendor_setid AND a.vendor_id = g.vendor_id AND a.vndr_loc = g.vndr_loc))) OR a.vchr_src IN ('SSI','XML','DCM','EXL') AND EXISTS ( SELECT 'X' FROM PS_EM_BUY_REG_TBL HH WHERE HH.BUSINESS_UNIT = A.BUSINESS_UNIT AND HH.EM_USE_AP_APPROVAL = 'Y'))

# PeopleSoft Field Name PeopleSoft Field Type Database Column Type Description
1 BUSINESS_UNIT Character(5) VARCHAR2(5) NOT NULL Business Unit

Default Value: OPR_DEF_TBL_FS.BUSINESS_UNIT

Prompt Table: SP_BU_AP_NONVW

2 VOUCHER_ID Character(8) VARCHAR2(8) NOT NULL Voucher ID

Default Value: NEXT

3 APPR_STATUS Character(1) VARCHAR2(1) NOT NULL Approval status flag used on appr_inst_log and derived records to track virtual approver status
A=Approved
D=Denied
P=Pending
4 OPRID Character(30) VARCHAR2(30) NOT NULL A user's ID (see PSOPRDEFN).
5 OPRID_LAST_UPDT Character(30) VARCHAR2(30) NOT NULL Last User to Update