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




          • 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) ...
          • 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 "Requestid", pr.Subject "Subject", pr.Description "Description", longtodate(pr.Requesteddate) "Requesteddate", longtodate(pr.Daterequired) "Daterequired", longtodate(pr.createddate) "createddate", pr.Shipping_details ...
          • Request Approval Details

            This report is used to view the historical details of Approved and Denied approval processes and their individual steps.We can also use this report to display all details for which an approval decision is pending.   To make any changes to a query, ...
          • Contract Details

            SELECT mcdt.Contractid "Contract ID", mcdt.CONTRACTNAME "Contract Name", mcdt.comments "Description", contractcategory.Categoryname "Contract Type", LONGTODATE(mcdt.CREATEDDATE) "Created Time", LONGTODATE(mcdt.FROMDATE) "From Date", ...