Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Unanswered

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

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

  • Suggested answer
    Mick Egan Profile Picture
    Mick Egan 3,557 on at
    taCalcDueDatePM stored procedure is not calculating the due date and discount date properly
    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
     
     
     
     
  • Suggested answer
    sandipdjadhav Profile Picture
    sandipdjadhav 18,265 on at
    taCalcDueDatePM stored procedure is not calculating the due date and discount date properly
    Hello,
    You are missing the Due Days.
     
     
    Thanks much
    Sandip

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans