APOP_APPRVCH_VW(SQL View) |
Index Back |
---|---|
Approval Vchr ViewCopy of MV - APOP_APPRVCH_MV MV used to get the Submitted and Approval Dates. UNION for the different approval types: - Pre-Approved � - Virtual-Approver - Approval Framework |
SELECT TMP.BUSINESS_UNIT , TMP.VOUCHER_ID , TMP.INVOICE_ID , TMP.INVOICE_DT , TMP.ENTERED_DT , TMP.MINDATE , TMP.MAXDATE , %DateDiff(TMP.MINDATE, TMP.MAXDATE) , TMP.GROSS_AMT , TMP.TXN_CURRENCY_CD , TMP.VENDOR_SETID , TMP.VENDOR_ID , TMP.OPRID , TMP.BUSINESS_UNIT_PO , TMP.PO_ID , TMP.ACCOUNTING_DT , TMP.VCHR_SRC , TMP.VOUCHER_STYLE , TMP.ENTRY_STATUS , TMP.ORIGIN FROM ( SELECT A.BUSINESS_UNIT , A.VOUCHER_ID , A.INVOICE_ID , A.INVOICE_DT , A.ENTERED_DT , A.APPR_INSTANCE , CASE WHEN A.VCHR_APPRVL_FLG = 'P' THEN A.ENTERED_DT WHEN A.VCHR_APPRVL_FLG = 'S' THEN ( SELECT %DatePart(MIN(INI.DTTM_STAMP)) FROM PS_APPR_INST_LOG INI WHERE INI.APPR_INST_STATUS = 'I' AND INI.APPR_INSTANCE = A.APPR_INSTANCE ) WHEN A.VCHR_APPRVL_FLG = 'W' THEN ( SELECT %DatePart(MIN(USR.DTTM_CREATED)) FROM PS_EOAW_USERINST USR , PS_VCHR_AF_XREF XREF , PS_EOAW_STEPINST STP WHERE XREF.BUSINESS_UNIT= A.BUSINESS_UNIT AND XREF.VOUCHER_ID=A.VOUCHER_ID AND XREF.EOAWTHREAD_ID = ( SELECT MAX(XREF2.EOAWTHREAD_ID) FROM PS_VCHR_AF_XREF XREF2 WHERE XREF2.BUSINESS_UNIT= XREF.BUSINESS_UNIT AND XREF2.VOUCHER_ID =XREF.VOUCHER_ID) AND STP.EOAWTHREAD_ID = XREF.EOAWTHREAD_ID AND STP.EOAWPRCS_ID = XREF.EOAWPRCS_ID AND STP.EOAWDEFN_ID = XREF.EOAWDEFN_ID AND USR.EOAWSTEP_INSTANCE = STP.EOAWSTEP_INSTANCE ) ELSE NULL END MINDATE , CASE WHEN A.VCHR_APPRVL_FLG = 'P' THEN A.ENTERED_DT WHEN A.VCHR_APPRVL_FLG = 'S' THEN ( SELECT %DatePart(MAX(APR.DTTM_STAMP)) FROM PS_APPR_INST_LOG APR WHERE APR.APPR_INST_STATUS='A' AND APR.APPR_INSTANCE = A.APPR_INSTANCE) WHEN A.VCHR_APPRVL_FLG = 'W' THEN ( SELECT %DatePart(MAX(USR.EOAWDTTM_MODIFIED)) FROM PS_EOAW_USERINST USR , PS_VCHR_AF_XREF XREF , PS_EOAW_STEPINST STP WHERE XREF.BUSINESS_UNIT= A.BUSINESS_UNIT AND XREF.VOUCHER_ID=A.VOUCHER_ID AND XREF.EOAWTHREAD_ID = ( SELECT MAX(XREF2.EOAWTHREAD_ID) FROM PS_VCHR_AF_XREF XREF2 WHERE XREF2.BUSINESS_UNIT= XREF.BUSINESS_UNIT AND XREF2.VOUCHER_ID =XREF.VOUCHER_ID) AND STP.EOAWTHREAD_ID = XREF.EOAWTHREAD_ID AND STP.EOAWPRCS_ID = XREF.EOAWPRCS_ID AND STP.EOAWDEFN_ID = XREF.EOAWDEFN_ID AND USR.EOAWSTEP_INSTANCE = STP.EOAWSTEP_INSTANCE ) ELSE NULL END MAXDATE , A.GROSS_AMT , A.TXN_CURRENCY_CD , A.VENDOR_SETID , A.VENDOR_ID , A.OPRID , A.BUSINESS_UNIT_PO , A.PO_ID , A.ACCOUNTING_DT , A.VCHR_SRC , A.VOUCHER_STYLE , A.ENTRY_STATUS , A.ORIGIN FROM PS_APOP_INVOICE_VW A WHERE A.APPR_STATUS = 'A' AND A.VCHR_APPRVL_FLG IN ('P','S','W') ) TMP WHERE (TMP.MINDATE IS NOT NULL AND TMP.MAXDATE IS NOT NULL) |
# | PeopleSoft Field Name | PeopleSoft Field Type | Database Column Type | Description |
---|---|---|---|---|
1 | Character(5) | VARCHAR2(5) NOT NULL | Business Unit | |
2 | Character(8) | VARCHAR2(8) NOT NULL | Voucher ID | |
3 | INVOICE_ID | Character(30) | VARCHAR2(30) NOT NULL | Invoice Number |
4 | INVOICE_DT | Date(10) | DATE | Invoice Date |
5 | ENTERED_DT | Date(10) | DATE | Entered on |
6 | SUBMIT_DT | Date(10) | DATE | Date Submitted |
7 | APPROVAL_DATE | Date(10) | DATE | Approval Date |
8 | AP_DAYSBETWEEN | Number(12,0) | DECIMAL(12) NOT NULL | Used to keep the difference between 2 dates. |
9 | GROSS_AMT | Signed Number(28,3) | DECIMAL(26,3) NOT NULL | Gross Invoice Amount |
10 | TXN_CURRENCY_CD | Character(3) | VARCHAR2(3) NOT NULL | Transaction Currency |
11 | VENDOR_SETID | Character(5) | VARCHAR2(5) NOT NULL | Vendor SetID |
12 | VENDOR_ID | Character(10) | VARCHAR2(10) NOT NULL | Vendor Identifier |
13 | OPRID | Character(30) | VARCHAR2(30) NOT NULL | A user's ID (see PSOPRDEFN). |
14 | BUSINESS_UNIT_PO | Character(5) | VARCHAR2(5) NOT NULL | PO Business Unit |
15 | PO_ID | Character(10) | VARCHAR2(10) NOT NULL | Purchase Order |
16 | ACCOUNTING_DT | Date(10) | DATE | The accounting entry construction date for a given transaction (a generic field that crosses multiple |
17 | VCHR_SRC | Character(4) | VARCHAR2(4) NOT NULL | Voucher Source |
18 | VOUCHER_STYLE | Character(4) | VARCHAR2(4) NOT NULL |
Voucher Style
ADJ=Adjustments AMR=Amortization Voucher CLBK=Claim Voucher CORR=Reversal Voucher JRNL=Journal Voucher PPAY=Prepaid Voucher REG=Regular Voucher RGTR=Register Voucher SGLP=Single Payment Voucher THRD=Third Party Voucher TMPL=Template Voucher |
19 | ENTRY_STATUS | Character(1) | VARCHAR2(1) NOT NULL |
If translate values are added or changed, modify the following code to make sure the values appear accurately in the dropdown list in the search dialog: VCHR_SRCH_DEL.ENTRY_STATUS.SearchInit. Template Voucher status should not be visibile in the drop down.
C=Complete D=Through batch defaults E=Edited by Batch Voucher Module L=Reviewed through Maintenance M=Modified O=Open P=Postable R=Recycle S=Scheduled for Payment T=Template Voucher X=Deleted |
20 | ORIGIN | Character(3) | VARCHAR2(3) NOT NULL | Origin |