Customization DS1510
Coupa-GP Apply PM Credits
Problem Definition:
ACME is implementing Coupa’s Spend Management software, with an integration into Dynamics GP.
The SmartConnect integration creates and posts PM Credits in GP, and also PM Invoices and Payments and applies the payments to the invoices. Applying open payments to open invoices is done during the integration through a product from Precipio. However, because the Credit documents may be created and posted well in advance of the Invoice, the Precipio software cannot apply the posted documents.
ACME needs a way to automate applying posted PM Credits to Invoices.
A SQL view will be created that provides the following information from Coupa:
- Credit Document Number
- Amount to Apply
- PM Invoice Document Number
All validation will occur in Coupa/SQL so that the view contains only documents that can be applied to each other and valid amounts.
ACME has Multi-Currency turned on, but only use USD. They use Taxes and Payment Terms. The Payment Terms ID assigned to integrated documents will have settings in GP that mirror those in Coupa, so that GP will calculate the correct Terms Discount. When documents are applied it is assumed that terms discounts will always be taken if applicable.
Solution Overview:
WilloWare will create an enhancement for Dynamics GP that will run automatically once per day to apply PM Credits to Invoices using the information provided from Coupa.
Design Features:
Setup
Navigation: Tools >> Setup >> Company >> Auto-Apply Credits Setup

This window is used to specify users whose log-in activity will trigger the AutoApply PM Credits utility to run. Users in this window will also have the ability to run the utility manually.
| Field | Function |
| User ID | Enter a GP User ID or select one from the lookup. To ensure that users have the necessary permissions to apply payables documents, users added to this list should have GP security to use the Apply Payables Documents window. |
| User Name | Displays the GP User Name |
AutoApply PM Credits
Navigation: Transactions >> Purchasing >> AutoApply Credits

NOTE: Using the window to manually run the AutoApply routine is NOT required. The AutoApply process described below will run automatically when one of the users specified in Setup logs in to GP.
| Field | Function |
| Credit Doc | Shows the GP Voucher Number of the PM Credit |
| Apply Amount | Shows the amount from the PM Credit to be applied |
| Apply to Doc | Shows the GP Voucher Number of the PM Invoice to which the Credit will be applied |
| REFRESH | Redisplays the window |
| PROCESS | Runs the AutoApply routine described below |
The window (and routine below) will run based on documents in a SQL View. The view will be created so that it shows only documents that can be (and need to be) applied to each other.
View Name: wvPMApply
Columns:
- VENDORID (Vendor ID)
- VENDNAME (Vendor Name)
- APFVCHNM (Apply From Vendor Number)
- APFRMAPLYAMT (Apply From Apply Amount)
- APTVCHNM (Apply To Voucher Number
NOTE: The column names must match the CAPITALIZED column names listed above.
AutoApply Routine
When one of the “auto apply” users logs in to GP, it will trigger the AutoApply routine to run. It can also be run manually at any time by clicking the PROCESS button.
When run automatically during log-in, if there are credits that need to be applied, the user will be asked:
Coupa PM Credits need to be applied. Do you want to do this now?
If the user answers NO, the process will be skipped until the next log-in, or the routine is run manually.
Using the information provided in the SQL VIEW, documents will be applied to each other one at a time. This process will have the same effect as if they were manually applied in the Apply Payables Documents window.
A progress window will open during the process to show users information about the process.
Assumptions/Requirements:
- The functionality described above will not work with eConnect, any software that uses eConnect, or any software that directly writes to, updates, or deletes from SQL tables.
- The functionality described above is intended for the GP Desktop client.
- National Accounts functionality is NOT used.
- Advanced Distribution functionality is NOT used.
- Unless otherwise noted in this document, reporting is not included in this estimate.
- Unless otherwise noted in this document, Word Template functionality is not addressed.
- Unless otherwise noted in this document, the enhancement will not integrate with 3rd party products. Some examples of 3rd party products would be:
- An ISV plug-in product including WilloWare products
- A dexterity customization designed by another developer
- Dynamics GP Modules including, but not limited to:
- Project Accounting
- MDA
- Analytical Accounting
- Copy functionality found in SOP, POP and Inventory
- Field Service
- Extended Pricing
- Manufacturing
For information on this design, or any other WilloWare customization or product, please contact us:
