Purchase order approval details

Purchase order approval details



SELECT po.POCUSTOMID AS "PO Number",
       max(po.PONAME) AS "PO Name",
       max(poa.FIRST_NAME) AS "Purchase Requester",
       longtodate(max(po.DATEORDERED)) AS "Ordered Date",
       longtodate(max(po.DATEREQUIRED)) AS "Required Date",
       max(pos.STATUSNAME) AS "PO Status",
       max(po.TOTALPRICE) AS "Total Price",
       max(resource.RESOURCENAME) AS "Asset Name",
       max(state.DISPLAYSTATE) AS "Asset State",
       max(rCategory.CATEGORY) AS "Asset Category",
       max(rtype.TYPE) AS "Asset Type",
       max(aaa.FIRST_NAME) "Approver",
       max(pos1.STATUSNAME) "PO Approval Status",
       LONGTODATE(max(poa1.APPROVAL_DATE)) "Approval Date" FROM PurchaseOrder po
LEFT JOIN POStatus pos ON po.STATUSID=pos.STATUSID
LEFT JOIN SDUser por ON po.REQUESTERID=por.USERID
LEFT JOIN AaaUser poa ON por.USERID=poa.USER_ID
LEFT JOIN Purchaseorderitem pxt ON po.PURCHASEORDERID=pxt.PURCHASEORDERID
LEFT JOIN PurchaseLot plot ON pxt.PURCHASEORDERitemID=plot.PURCHASEORDERitemID
LEFT JOIN Resources RESOURCE ON plot.PURCHASELOTID=resource.PURCHASELOTID
LEFT JOIN ComponentDefinition product ON resource.COMPONENTID=product.COMPONENTID
LEFT JOIN ComponentType productType ON product.COMPONENTTYPEID=productType.COMPONENTTYPEID
LEFT JOIN ResourceType rtype ON productType.RESOURCETYPEID=rtype.RESOURCETYPEID
LEFT JOIN ResourceCategory rCategory ON productType.RESOURCECATEGORYID=rCategory.RESOURCECATEGORYID
LEFT JOIN ResourceState state ON resource.RESOURCESTATEID=state.RESOURCESTATEID
LEFT JOIN POLevelInfo pol ON po.PURCHASEORDERID=pol.PURCHASEORDERID
LEFT JOIN PurchaseApprovalDetails poa1 ON pol.LEVELINFOID=poa1.LEVELINFOID
LEFT JOIN AaaUser aaa ON poa1.APPROVERID=aaa.USER_ID
LEFT JOIN levelinfo li ON pol.LEVELINFOID=li.LEVELINFOID
LEFT JOIN POApprovalStatus pos1 ON li.LEVELSTATUSID=pos1.STATUSID
GROUP BY po.POCUSTOMID
ORDER BY 1




                  New to ADSelfService Plus?

                    • Related Articles

                    • Purchase details

                      SELECT po.POCUSTOMID "PO Number", max(po.PONAME) "PO Name", max(po.TERMS) "PO Terms", LONGTODATE(max(po.DATEORDERED)) "Ordered Date", max(pos.STATUSNAME) "PO Status", max(poa.FIRST_NAME) "Purchase Requester", max(po.SHIPTO) "Ship To", max(paao.NAME) ...
                    • Query to show purchase order full details (PGSQL)

                      Tested in PGSQL build (14300) SELECT po.POCUSTOMID AS "Order No.",poi.serialno "S.No", poaddfield.UDF_CHAR1 AS "Legal Entity", po.PONAME AS "PO Name", pos.STATUSNAME AS "PO Status", cy.currencyname "Currency", paao.NAME AS "Vendor Name", po.SHIPTO AS ...
                    • Purchase Request Approval

                      SELECT pr.Requestid "Requestid", pr.Subject "Subject", pr.Description "Description", longtodate(pr.Requesteddate) "Requesteddate", longtodate(pr.Daterequired) "Daterequired", longtodate(pr.createddate) "createddate", pr.Shipping_details ...
                    • Purchase Request details

                      Select pr.REQUESTID AS "Request Id", pr.SUBJECT AS "PR Subject", pr.DESCRIPTION AS "Description", LONGTODATE(pr.REQUESTEDDATE) AS "Requested Date", LONGTODATE(pr.DATEREQUIRED) AS "Date Required", LONGTODATE(pr.CREATEDDATE) AS "Created Date", ...
                    • Query Reports on Purchase Order Items (MSSQL)

                      Tested in build MSSQL (14306) MSSQL: 1. Login to SDP MSP as administrator 2. Execute this from SDP MSP application -> Reports -> New Query report Execute below query SELECT "po"."POCUSTOMID" AS "PO Number", "po"."PONAME" AS "PO Name", ...