SQL Scripts for Microsoft Dynamics GP: List of PM Invoices for Vendors with POs

Microsoft Dynamics GPThis script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posted the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.

This script returns a list of payables management invoices for vendors who also have purchase orders.

/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk) This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int). */
SELECT ['Payables Transactions'].VENDORID AS 'Control Type' ,['Payables Transactions'].VENDORID AS 'Vendor ID' ,['Payables Transactions'].VCHRNMBR AS 'Voucher Number' ,['Payables Transactions'].DOCTYPE AS 'Document Type' ,['Payables Transactions'].TRXDSCRN AS 'Description' ,['Payables Transactions'].DOCDATE AS 'Document Date' ,['Payables Transactions'].DOCNUMBR AS 'Document Number' ,['Payables Transactions'].DOCAMNT AS 'Document Amount' ,['Purchase Orders'].POCOUNT AS 'Count of POs' FROM ( SELECT CNTRLTYP ,DOCTYPE ,VCHRNMBR ,TRXDSCRN ,VENDORID ,DOCDATE ,DOCNUMBR ,DOCAMNT ,PORDNMBR ,BCHSOURC FROM PM20000 AS PM WITH (NOLOCK) WHERE DOCTYPE = 1 AND BCHSOURC = 'PM_Trxent' UNION ALL SELECT CNTRLTYP ,DOCTYPE ,VCHRNMBR ,TRXDSCRN ,VENDORID ,DOCDATE ,DOCNUMBR ,DOCAMNT ,PORDNMBR ,BCHSOURC FROM PM30200 AS PM WITH (NOLOCK) WHERE DOCTYPE = 1 AND BCHSOURC = 'PM_Trxent' ) AS ['Payables Transactions'] INNER JOIN ( SELECT VENDORID ,SUM(POCOUNT) AS POCOUNT FROM ( SELECT VENDORID ,COUNT(PONUMBER) AS POCOUNT FROM POP10100 WITH (NOLOCK) GROUP BY VENDORID UNION SELECT VENDORID ,COUNT(PONUMBER) AS POCOUNT FROM POP30100 WITH (NOLOCK) GROUP BY VENDORID ) AS ['Purchase Orders'] GROUP BY VENDORID ) AS ['Purchase Orders'] ON ['Purchase Orders'].VENDORID = ['Payables Transactions'].VENDORID WHERE ['Purchase Orders'].POCOUNT > 0 GO

Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index

In Microsoft Dynamics 365 Business Central (Financial), how do I… Configure Dimension Restrictions

Microsoft Dynamics 365 Business CentralThis post is part of the In Microsoft Dynamics 365 Business Central (Financial), how do I… series and of the wider In Microsoft Dynamics 365 Business Central, how do I… series which I am posting as I familiarise myself with Microsoft Dynamics 365 Business Central.

As part of explaining default dimensions and priorities there is another piece of functionality which should be covered and that is dimension restrictions, especially as the restrictions are configured within the Default Dimensions window.

In the previous post of this series, I showed how default dimensions can be entered; while doing so you can also enter the restrictions:

Default Dimensions window with some dimension restrictions entered.

Continue reading “In Microsoft Dynamics 365 Business Central (Financial), how do I… Configure Dimension Restrictions”