web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

taCalcDueDatePM stored procedure is not calculating the due date and discount date properly

(0) ShareShare
ReportReport
Posted on by 4

Hello,

I've configured the payment terms as shown below, and when I utilize the /Calculate/ feature within the Payment Term setup window, it correctly computes the Due Date and discount date. However, when I employ the Dynamic GP stored procedure [taCalcDueDatePM] to perform the same calculation, it does not yield the correct results.





 

USE [TWO]
GO
DECLARE    @return_value int,
        @O_dDISCDATE datetime,
        @O_dDUEDATE datetime,
        @O_iErrorState int,
        @oErrString varchar(255)
EXEC    @return_value = [dbo].[taCalcDueDatePM]
        @I_vVENDORID = N'DM',
        @I_vPYMTRMID = N'2% 10TH',
        @I_vDOCDATE = N'10/19/2023',
        @O_dDISCDATE = @O_dDISCDATE OUTPUT,
        @O_dDUEDATE = @O_dDUEDATE OUTPUT,
        @O_iErrorState = @O_iErrorState OUTPUT,
        @oErrString = @oErrString OUTPUT
SELECT    @O_dDISCDATE as N'@O_dDISCDATE',
        @O_dDUEDATE as N'@O_dDUEDATE',
        @O_iErrorState as N'@O_iErrorState',
        @oErrString as N'@oErrString'
SELECT    'Return Value' = @return_value
GO

I have the same question (0)
  • Suggested answer
    sandipdjadhav Profile Picture
    18,333 on at
    Hello,
    You are missing the Due Days.
     
     
    Thanks much
    Sandip
  • Suggested answer
    Mick Egan Profile Picture
    3,561 on at
    Just to add to the Post:
     
    The Stored Procedure's - Discount Date only works when "Discount - Days, Date or EOM" are selected, the other options return Blank.
     
    The Discount is caluclated from the "Due Date" settings, so even though the Payment Terms Example screen returned results, these are not in line with the Stored Procedures caluclations.
     
    We have found the Due Date "EOM" can calculate the current Month's last day instead of the next Month when using "Calculate Days from : Transaction Date"a so you may need to add a Calculation to your returned date to fix this issue, only if using EOM for Due Date.  I think you will be fine, as using Discount Date seems to fix the issue.
     
    Mick
     
     
     
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 699

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 582 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 493

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans