Enhanced Dynamics GP Payables Workflow Reporting

A couple days ago, Gina left a comment on my 3 Secrets To An Awesome ERP System! blog post. She was wondering if it was possible on the Payables Transaction Workflow to include Document Type, Document Date, Document Number, Transaction Description, Vendor Name and Amount. The answer is YES, it is possible. The below SQL view only works with the Payables Transaction Workflow but can be modified to work with other transactional workflows. It will not work with batch workflows because batch IDs lack an unique ID to create the relationship against. Here is the modified SQL view to complete the request:

GO
SET QUOTED_IDENTIFIER OFF
GO


CREATE VIEW [dbo].[vw_WorkFlow_Status]

AS

 WITH CTE_FINAL (WorkflowInstanceID, Workflow_Name, Workflow_Step_Name, Approver, Workflow_Action, Completion_Date, Completion_Time, Comments  )
AS
(select  d.WorkflowInstanceID, 
       d.Workflow_Name, 
       d.Workflow_Step_Name,
       CASE WHEN a.ADDisplayName is null THEN ''
          ELSE a.ADDisplayName
          END as [Assigned Approver],
       CASE WHEN d.Workflow_Action = 1 THEN 'Submit'
          WHEN d.Workflow_Action = 2 THEN 'Resubmit'
          WHEN d.Workflow_Action = 3 THEN 'Approve'
          WHEN d.Workflow_Action = 4 THEN 'Task Complete'
          WHEN d.Workflow_Action = 5 THEN 'Reject'
          WHEN d.Workflow_Action = 6 THEN 'Delegate'
          WHEN d.Workflow_Action = 7 THEN 'Recall'
          WHEN d.Workflow_Action = 8 THEN 'Escalate'
          WHEN d.Workflow_Action = 9 THEN 'Edit'
          ELSE 'Final Approve'
          END as Workflow_Action,
       convert(varchar(10),d.Workflow_Completion_Date, 101) as [Completion_Date],
       right('0'+LTRIM(right(convert(varchar,d.Workflow_Completion_Time,100),8)),7) as Completion_Time,
       d.Workflow_Comments
         from dbo.WF30100 d
LEFT JOIN WF40200 a ON d.Workflow_Step_Assign_To = a.UsersListGuid
WHERE d.Workflow_Action = 10), CTE_PM as (SELECT    P.VENDORID Vendor_ID,
    V.VENDNAME Vendor_Name,
    P.VCHRNMBR Voucher,
    CASE P.DOCTYPE
         WHEN 1 THEN 'Invoice'
         WHEN 2 THEN 'Finance Charge'
             WHEN 3 THEN 'Misc Charge'
             WHEN 4 THEN 'Return'
             WHEN 5 THEN 'Credit Memo'
         WHEN 6 THEN 'Payment'
         END Document_Type,
    P.DOCDATE Document_Date,
    P.PSTGDATE GL_Posting_Date,
    P.DUEDATE Due_Date,
    P.DOCNUMBR Document_Number,
    P.DOCAMNT Document_Amount,
    P.CURTRXAM Unapplied_Amount,
    P.TRXDSCRN [Description],
    CASE P.VOIDED
         WHEN 0 THEN 'No'
         WHEN 1 THEN 'Yes'
         END Voided

FROM    (SELECT VENDORID, VCHRNMBR, DOCTYPE, DOCDATE, PSTGDATE,
     DUEDATE, DOCNUMBR, DOCAMNT, CURTRXAM, TRXDSCRN, VOIDED
     FROM PM20000
    UNION ALL
     SELECT VENDORID, VCHRNMBR, DOCTYPE, DOCDATE, PSTGDATE,
     DUEDATE, DOCNUMBR, DOCAMNT, CURTRXAM, TRXDSCRN, VOIDED
     FROM PM30200
     UNION ALL
     SELECT VENDORID, VCHRNMBR, DOCTYPE, DOCDATE, PSTGDATE,
     DUEDATE, DOCNUMBR, DOCAMNT, CURTRXAM, TRXDSCRN, 0 as VOIDED
     FROM PM10000) P

     INNER JOIN
    PM00200 V
    ON V.VENDORID = P.VENDORID)
 
 Select  WF.* 
        ,coalesce(pm.Document_Type,'') as Document_Type
        ,coalesce(pm.Document_Date,'') as Document_Date
        ,coalesce(pm.Document_Number, '') as Document_Number
        ,pm.Voucher
        ,coalesce(pm.Description, '') as Description
        ,coalesce(pm.Vendor_Name,'') as Vendor_Name
        ,coalesce(pm.Document_Amount,0) as Document_Amount 
FROM 
 (SELECT    ROW_NUMBER() OVER ( ORDER BY A.DEX_ROW_ID ) RecordSequence ,
            ISNULL(C.WfBusObjKey, '') WFBusObjKey ,
            LEFT(WfBusObjKey, ISNULL(NULLIF(CHARINDEX('~', WFBusObjKey) - 1, -1), LEN(WfBusObjKey))) as Split,
            Workflow_History_User ,
            C.Workflow_Type_Name,
            A.Workflow_Name ,
            A.Workflow_Step_Name ,
            ISNULL(B.WorkflowTaskAssignedTo, '') WorkflowTaskAssignedTo ,
            CASE C.Workflow_Status
              WHEN 1 THEN 'Not Submitted'
              WHEN 2 THEN 'Submitted (Deprecated)'
              WHEN 3 THEN 'No Action Needed'
              WHEN 4 THEN 'Pending User Action'
              WHEN 5 THEN 'Recalled'
              WHEN 6 THEN 'Completed'
              WHEN 7 THEN 'Rejected'
              WHEN 8 THEN 'Workflow Ended (Depricated)'
              WHEN 9 THEN 'Not Activated'
              WHEN 10 THEN 'Deactivated (Depricated)'
              ELSE ''
            END AS WORKFLOW_STATUS ,
            CASE A.Workflow_Action
              WHEN 1 THEN 'Submit'
              WHEN 2 THEN 'Resubmit'
              WHEN 3 THEN 'Approve'
              WHEN 4 THEN 'Task Complete'
              WHEN 5 THEN 'Reject'
              WHEN 6 THEN 'Delegate'
              WHEN 7 THEN 'Recall'
              WHEN 8 THEN 'Escalate'
              WHEN 9 THEN 'Edit'
              WHEN 10 THEN 'Final Approve'
              ELSE ''
            END AS Workflow_Action ,
            A.Workflow_Due_Date ,
            A.Workflow_Completion_Date ,
            A.DEX_ROW_ID ,
            Workflow_Comments,
        CASE WHEN d.Approver is null THEN ''
          ELSE d.Approver
       END as Approver,
       CASE WHEN d.Completion_Date is null THEN ''
          ELSE d.Completion_Date
       END as Completion_Date,
       CASE WHEN d.Completion_Time is null THEN ''
          ELSE d.Completion_Time
       END as Completion_Time,
       CASE WHEN d.Comments is null THEN ''
          ELSE d.Comments
       END as Comments
    FROM    WF30100 AS A
            LEFT OUTER JOIN WFI10004 AS B ON A.WorkflowInstanceID = B.WorkflowInstanceID
            AND A.WorkflowStepInstanceID = B.WorkflowStepInstanceID
            LEFT OUTER JOIN WFI10002 AS C ON C.WorkflowInstanceID = A.WorkflowInstanceID
            LEFT OUTER JOIN CTE_FINAL d ON D.WorkflowInstanceID = c.WorkflowInstanceID) WF
            LEFT OUTER JOIN CTE_PM pm on pm.Voucher = WF.Split
GO

Until next time. Enjoy the code!

Advertisements

3 Secrets To An Awesome ERP System!

Part of being a Microsoft Dynamics Consultant is seeing all the inventive ways clients use the software we deploy and take that knowledge and provide best practices to everyone! Here are just some of the things to enhance your system processes:

  • Best Practices
  • Customization and Modifications
  • Reporting Enhancements

Best Practices

Customization, Modifications and Third Party Add-ins

  • General Ledger, Sales Distribution, and Payables Distribution intercompany Excel paste – James Lyn’s Excel Paste add-in. is great at extending Dynamics GP’s out of the box functionality. While you’re on his site, check out his other add-ins like GP batch attach for Payables.
  • Create Dynamics GP Marcos or use PowerShell scripts to automate tasks – i.e. Macro to log into Dynamics GP and run inventory reconcile process or reboot your web client servers to remove hung processes.
  • Custom workflows and reporting – reporting to provide detail information on current/open and historical/approved workflows. Find out how to do that here.

Reporting Enhancements

Dynamics GP comes with some good reporting capabilities:

  • Management Reporter.
  • Excel refreshable reports.
  • SmartList.
  • Jet Express for Dynamics GP.
  • Solver’s BI360.
  • Power BI.

With Dynamics GP 2018 you can now deploy Power BI GP content pack or embedded Power BI visual inside of Dynamics GP. So what do the Power BI content pack visuals look like and how do we get them installed? As of Microsoft Dynamics GP 2018, the GP OData service was updated to OData version 4. This redesign also brought on paging and filtering of OData requests. This will create a more stable and robust platform for delivering Microsoft Dynamics GP content to authenticated users. The Power BI content pack features sample reports for Financial, Sales, Purchasing and Inventory data. Each report utilizes relationships built between GP tables and various Filters that can be used to display the information that is important to you. You can also review the included Calculated Columns as examples for including calculations on your Power BI reports such as Net Debit/Credit, Profit, and Item Sales amounts.

In order to use the Power BI Content Pack with Dynamics GP, install OData Services. Once this is complete, you will have to publish the following Data Sources inside Dynamics GP. (Administration > System > OData > Data Sources) The following Data Sources will need to be published for the GP content pack.

  • Accounts
  • Account Transactions
  • Customers
  • Inventory Sales Summary Period History
  • Inventory Transactions
  • Item Quantities
  • Purchase Line Items
  • Purchase Requisition Lines
  • Purchase Requisitions
  • Receiving Line Items
  • Sales Line Items
  • Vendors

The Power BI Content Pack will also have to be configured to point to you’re existing Microsoft Dynamics GP OData Service. This can be done by modifying the existing Data source in Power BI, or by creating a new data source and configuring the content to use the new source. The screenshots below show what the GP content pack sample reports look like.

Finance Dashboard

Finance

Sales Dashboard

Sales

Purchasing Dashboard

Purchasing

Inventory Dashboard

Inventory

Enhancing Our Dashboards

These GP content pack reports are a good starting point and can speed up the process of implementing a Power BI solution. With a little work from your Microsoft Dynamics Consultant, we can provide you so much more. In February of 2017, I started a blog series that provided a “how to” on building a Finance, Sales, Customer, Product, and Inventory dashboard. Since my main goal was to show an update of the Excel multi-company dashboard, I choose to first build a small DataMart and integrate the data from Dynamics GP databases before building my visuals. Follow the links below to find out how I built each one of the enhanced dashboards.

Enhanced Finance Dashboard

The finance dashboard, from the blog series, now provides a summary profit & loss statement that you can drill down into line level detail. Additionally, you see total sales by inventory class and customer class and a weekly moving average.

Enhanced Finance Dashboard

Enhanced Sales Dashboard

The sales summary dashboard provides an analysis of sales by inventory item class, customer class and weekly moving averages for total sales dollars and transactions. The report also includes a cumulative sales and cost comparison.

Enhanced Sales

Product Performance and Inventory Reorder Dashboard

In the product performance dashboard, I’ve added to compare total profits and profit margin, cost by warehouse and ABC segmentation analysis. Additionally, there is a weekly moving average cost comparison chart at the bottom of the report.

Enhanced Product Performance

For my inventory reorder analysis report, I’m using some discussed by Belinda Allen in her, Inventory Item Reorder Dashboard. I converted it to Power BI to help your procurement manager evaluate what’s on hand, allocated to open orders and items sold within a given time period.

Enhanced Inventory Dashboard

Future Developments

Returns are generally thought of a loses and return percentages can be dependent both the type of product and the company’s returns policy. While the average industry rate is four percent, consumer durable goods can range from two to 10 percent and apparel can be in excess of 20 percent. There are several reasons for merchandise returns and tracking the costs and reasons associated with them can increase revenues, lower costs, improved profitability and enhanced levels of customer service. Using Dynamics GP’s RMA module can help and analyze that data in Power BI is one of the things that I’m currently working on. Below is a screenshot of that analysis and a subject of a future blog post.

Sales Returns Dashboard

Ready to Do Even More with Dynamics and Power BI?

Stay tuned for more help in lead your organization into becoming data-driven organization by exploring your Business Intelligence, BI360, Power BI, Microsoft Dynamics GP journey.