Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / Getting error when app...
Finance forum
Unanswered

Getting error when applying prepayment for 1 vendor only

Posted on by 352
Hello,
 
im getting this error recently:You have marked prepayment application or reversal transactions in closed period, please unmark them before applying prepayment
its when i try to apply prepayment for a puchase order for a certain vendor. this error only occurs for this vendor, also it shows when January 2022 ledger calendar is closed, when  i open it, its working fine, i need to know why this error is showing only if january 2022 is closed and only for this vendor. please note that this vendor has one PO in jan 2023. so lets say i create a new PO in july 2024 with this vendor, the error is showing also, but if i open Jan 2022 ledger calendar, its working fine.
I also checked under the backend the code related to this error:
   private void checkExistingVendAdvanceTransInOpenPeriod(VendInvoiceAccount _invoiceAccount)
        {
            VendInvoiceJour vendInvoiceJour;
            VendAdvanceApplicationTrans vendAdvanceApplicationTrans;
            RecId calendarRecId = CompanyInfoHelper::fiscalCalendarRecId();
            while select vendAdvanceApplicationTrans
            join vendInvoiceJour
                where vendAdvanceApplicationTrans.PostedInvoiceRecId == vendInvoiceJour.RecId
                    && vendInvoiceJour.InvoiceAccount == _invoiceAccount
            {
                if (!LedgerFiscalCalendar::checkDateIsValid(calendarRecId, vendAdvanceApplicationTrans.SettlementPostingDate, FiscalPeriodType::Operating, false))
                {
                    throw warning("@AccountsPayable:MarkedPrepaymentInClosedPeriod");
                }
         
i need to know why this is happening.
 
thanks
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,263 Super User 2024 Season 2 on at
    Getting error when applying prepayment for 1 vendor only
    Hi Mario,
     
    I'm not able to suggest what to do next. I don't have a reproducible scenario, so don't know what options there are now in the standard application. When you open the period and perform the posting, it is then generating accounting entries in 2022 or the data you provided for the update? Test this in a non-prod environment first. If it is creating entries in 2022, then I suggest to log an incident for Microsoft Support.
  • Mario Barnaba Profile Picture
    Mario Barnaba 19 on at
    Getting error when applying prepayment for 1 vendor only
    Dear Andre, as per what you said before,
     
    we debuged the code and it turned out that this invoice is taking a settlement posting date as in 18/02/2022. It is not taking the settlement posting date I am selecting under the vendor.
     
    can you advise please on how we can solve this in code or the issue by system?
  • Mario Barnaba Profile Picture
    Mario Barnaba 19 on at
    Getting error when applying prepayment for 1 vendor only
    Hello Andre, following your response,

    I am navigating to all vendors, selecting the vendor and I select the settlement posting date in 2023, when I click the apply prepayment button, an error is showing stating: "fiscal period 18/2/2022 is not open".

    I checked in this vendor transactions, this date is related to an old PO with applied prepayment (18/2/2022)
    so, how do I get rid of this error? because I need to apply this prepayment in 2023.
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,263 Super User 2024 Season 2 on at
    Getting error when applying prepayment for 1 vendor only
    Hi Mario, D365 Dev,

    Have you checked what date is stored in the field SettlementPostingDate in the VendAdvanceApplicationTrans record(s)? A wrong date might be stored or a wrong record can be retrieved. Potentially, in a non-production environment, you can use the debugger to check what exact record is being retrieved in the method that checks the open period.
  • Mario Barnaba Profile Picture
    Mario Barnaba 19 on at
    Getting error when applying prepayment for 1 vendor only
    I found that there is something related to February 2022.
    that some PO with prepayment causing this issue.
    however, this is nothing wrong with the PO.
  • D365FO DEV Profile Picture
    D365FO DEV 352 on at
    Getting error when applying prepayment for 1 vendor only
    Hi Andre,
     
    my scenario is same as Mario's scenario. same issue with different dates
  • Mario Barnaba Profile Picture
    Mario Barnaba 19 on at
    Getting error when applying prepayment for 1 vendor only
    this PO is issued in November 2023, this issue is only available for one vendor which is using this purchase order.
     
    when I open February 2022 in ledger calendar, I can apply this prepayment even though in February 2022, we have only 1 transaction for this vendor which is also a Purchase order with a prepayment fully applied.

    and as we searched for this error, it is standard and the meaning of it is that we need to have the fiscal period of both prepayment and PO open which they are (November 2023), but why when I open February 2022 only, I can apply this prepayment?

  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 290,263 Super User 2024 Season 2 on at
    D365fo - getting error when applying prepayment for 1 vendor only!!!
    Hi D365 FO Developer,
     
    Can you tell what date is used for the pre-payment? Can you share a screenshot?

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,263 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,112 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans