Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Blank Apply Details in AP Apply Screens

Posted on by 9,142

Hi

One of our more technical consultants has dealt with the following situation a number of times and wondered if others have been dealing with it and if there are some better options.

Situation:  An invoice or payment is showing as history and zero amount remaining and when you drill into the apply details it is blank.  The apply details also do not exist in the Apply table.  This can happen in both AR and AP, however the solution in AR is no issue because of functions in the PSTL.

Because there is no record of the apply, it becomes difficult to track down what it relates to.  Sometimes this manifests because there is an out of balance in the system and that is how it is tracked down.  Other times it may be that someone is looking at details and finds a blank screen and there is no obvious out of balance.

Does anyone know whether there is a way to look across the database for these missing apply records?  And a really good way to fix.  In AP, you need to do the identification of both sides of it and then bring them back from History in SQL and do a reapply.  In AR, you can use the PSTL to bring back from history and then do the reallocation.

Cheers

Heather

*This post is locked for comments

  • L Vail Profile Picture
    L Vail 65,271 on at
    RE: Blank Apply Details in AP Apply Screens

    Hi Heather,

    I do not have a query to find missing apply docs in RM.

    Kind regards,

    Leslie

  • Suggested answer
    L Vail Profile Picture
    L Vail 65,271 on at
    RE: Blank Apply Details in AP Apply Screens

    Hi Heather,

    I think David Musgrave gave me this query several years ago. This one will search PM for missing apply records. I'll check to see if I have one for Receivables.  If this doesn't paste well, shoot me an e-mail (leslievail@earthlink.net) and I'll send the file to you.

    Kind regards,

    Leslie

    /* SQL PM Find Missing Apply Records

    This statement goes through the pm30200 table and looks for any record that does

    not have a matching apply document(s) to satisfy the balance*/

    SET quoted_identifier OFF

    SET nocount ON

    PRINT "Deleting Temp tables (if they exist)"

    go

    IF EXISTS (SELECT *

    FROM tempdb.dbo.sysobjects

    WHERE id = Object_id('tempdb..#PMTrans')

    AND type = 'U')

    DROP TABLE #pmtrans

    go

    IF EXISTS (SELECT *

    FROM tempdb.dbo.sysobjects

    WHERE id = Object_id('tempdb..#PMApply')

    AND type = 'U')

    DROP TABLE #pmapply

    /* Create the table used to hold PM30200 Info */

    PRINT "Creating Temp tables"

    go

    CREATE TABLE #pmtrans

    (

    vchrnmbr# CHAR (21) NULL

    , docnumbr# CHAR (21) NULL

    , doctype# SMALLINT NULL

    , billmode# TINYINT NULL

    , vendor CHAR (15) NULL

    , DocAmtAfterWriteOff NUMERIC(19, 5) NULL

    , docdate DATETIME NULL

    )

    CREATE INDEX #pmtrans_pk

    ON #pmtrans (vchrnmbr#, doctype#, billmode#, vendor,

    DocAmtAfterWriteOff)

    /* Create the table used to hold Sum of Apply Records from PM30300 */

    go

    CREATE TABLE #pmapply

    (

    vchrnmbr# CHAR (21) NULL

    , doctype# SMALLINT NULL

    , billmode# TINYINT NULL

    , vendor CHAR (15) NULL

    , totalappliedamt NUMERIC(19, 5) NULL

    , writeoffamt NUMERIC(19, 5) NULL

    , discountamt NUMERIC(19, 5) NULL

    , realizedamt NUMERIC(19, 5) NULL

    , origcurrency INT NULL

    )

    CREATE INDEX #pmapply_pk

    ON #pmapply (vchrnmbr#, doctype#, billmode#, vendor, totalappliedamt,

    writeoffamt, discountamt, realizedamt, origcurrency)

    PRINT "Selecting Bills in History"

    go

    INSERT #pmtrans

    (vchrnmbr#

    , docnumbr#

    , doctype#

    , billmode#

    , vendor

    , DocAmtAfterWriteOff

    , docdate)

    SELECT vchrnmbr

    , docnumbr

    , doctype

    , 0

    , vendorid

    , ( docamnt - distknam )

    , docdate

    FROM pm30200

    WHERE doctype < 4

    AND voided = 0

    AND ( docamnt - distknam ) <> 0.0 -- Zero Value Documents

    ORDER BY vchrnmbr

    INSERT #pmtrans

    (vchrnmbr#

    , docnumbr#

    , doctype#

    , billmode#

    , vendor

    , DocAmtAfterWriteOff

    , docdate)

    SELECT vchrnmbr

    , docnumbr

    , doctype

    , 1

    , vendorid

    , ( docamnt - distknam )

    , docdate

    FROM pm30200

    WHERE doctype >= 4

    AND voided = 0

    AND ( docamnt - distknam ) <> 0.0 -- Zero Value Documents

    AND NOT ( doctype = 4

    AND ttlpymts = docamnt ) -- Remove fully paid returns

    ORDER BY vchrnmbr

    PRINT "Selecting Apply Records and Totally Apply Credits in History"

    go

    /* Get Functional Currency ID */

    DECLARE @FUNC VARCHAR(5)

    SELECT TOP 1 @FUNC = funlcurr

    FROM mc40000

    INSERT #pmapply

    (vchrnmbr#

    , doctype#

    , billmode#

    , vendor

    , totalappliedamt

    , writeoffamt

    , discountamt

    , realizedamt

    , origcurrency)

    SELECT aptvchnm

    , aptodcty

    , 0

    , vendorid

    , Sum(appldamt)

    , Sum(wrofamnt)

    , 0

    , 0

    , Sum (CASE

    WHEN @FUNC != ''

    AND @FUNC != curncyid THEN 1

    ELSE 0

    END)

    FROM pm30300

    GROUP BY aptvchnm

    , aptodcty

    , vendorid

    ORDER BY aptvchnm

    INSERT #pmapply

    (vchrnmbr#

    , doctype#

    , billmode#

    , vendor

    , totalappliedamt

    , writeoffamt

    , discountamt

    , realizedamt

    , origcurrency)

    SELECT vchrnmbr

    , doctype

    , 1

    , vendorid

    , Sum(appldamt)

    , 0

    , Sum(distknam)

    , Sum(rlganlos)

    , Sum (CASE

    WHEN @FUNC != ''

    AND @FUNC != curncyid THEN 1

    ELSE 0

    END)

    FROM pm30300

    GROUP BY vchrnmbr

    , doctype

    , vendorid

    ORDER BY vchrnmbr

    PRINT "Entries that are missing apply records"

    go

    SELECT a.billmode#

    , a.vchrnmbr#

    , a.docnumbr#

    , a.doctype#

    , a.vendor

    , a.docdate

    , a.DocAmtAfterWriteOff

    , Isnull(b.totalappliedamt, 0)

    AS TotalAppliedAmt

    , Isnull(( a.DocAmtAfterWriteOff - (

    b.totalappliedamt + b.writeoffamt -

    b.discountamt

    - b.realizedamt ) ), 0) AS

    Differ

    FROM #pmtrans a

    LEFT OUTER JOIN #pmapply b

    ON a.vchrnmbr# = b.vchrnmbr#

    AND a.doctype# = b.doctype#

    AND a.billmode# = b.billmode#

    AND a.vendor = b.vendor

    WHERE ( ( Isnull(( a.DocAmtAfterWriteOff - (

    b.totalappliedamt + b.writeoffamt -

    b.discountamt

    -

    b.realizedamt ) ), 0) <> 0 )

    OR ( b.vendor IS NULL ) )

    AND ( a.billmode# = 0

    OR Isnull(b.origcurrency, 0) = 0

    OR ( Abs(Isnull(( a.DocAmtAfterWriteOff - (

    b.totalappliedamt + b.writeoffamt

    -

    b.discountamt

    -

    b.realizedamt ) ), 0)) > (

    Isnull(b.origcurrency, 0) / 100.0 )

    ) ) -- Rounding on Credit Documents

    ORDER BY a.vendor

    PRINT "Removing Temp tables"

    go

    DROP TABLE #pmtrans

    DROP TABLE #pmapply

  • Barb Kotsatos Profile Picture
    Barb Kotsatos 120 on at
    RE: Blank Apply Details in AP Apply Screens

    No there is nothing attached to these invoices just a blank apply screen and amount remaining is zero.

  • GP for JP Profile Picture
    GP for JP 100 on at
    RE: Blank Apply Details in AP Apply Screens

    Do you have credit notes?  Perhaps you have a REMIT00000000000 line showing up on this account with a balance of zero?  If the REMIT0000000000 is in a fiscal period still open, you can void the REMIT000000000000 and it will free up whatever GP played up.

  • Barb Kotsatos Profile Picture
    Barb Kotsatos 120 on at
    RE: Blank Apply Details in AP Apply Screens

    Hi Heather,

    I was wondering if you got this resolved yet.  I just ran into this in our A/P module where many invoices have posted to history with a zero remaining balance but they have never been paid.  I was hoping to bring them back from history so I can void them.  They are appearing on the PM Historical trial balance and this is how we found that they are in history with no payment.  How can I get them off of our report so we can balance to G/L correctly?

     

    Does anyone have any ideas?  I have run checklinks and reconcile and it doesn't change anything.


    Thanks,

    Barb

  • soma Profile Picture
    soma 24,406 on at
    RE: Blank Apply Details in AP Apply Screens

    Have you tried to run Reconcile?

  • Heather Roggeveen Profile Picture
    Heather Roggeveen 9,142 on at
    RE: Blank Apply Details in AP Apply Screens

    Hi Soma

    Thanks for replying.  Unfortunately neither of those ones helped.  The transactions are not voided and check links doesn't correct.

    Cheers

    Heather

  • soma Profile Picture
    soma 24,406 on at
    RE: Blank Apply Details in AP Apply Screens

    1. Check whether the payments or invoices are voided.

    2. Try to run Check Links and Reconcile to verify whether the applied details get back to the apply inquiry window.

    Hope this helps!!!

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

Featured topics

Product updates

Dynamics 365 release plans