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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Accounts Payable, Purchase Order with negative quantity is creating wrong transactions in LedgerTrans, when posting the invoicing

(0) ShareShare
ReportReport
Posted on by

After updating the Ax 2009  application to 5.0.1600.3735 the class InventMov_Purch.updateLedgerAdjust was changed and the purchase post invoice process is wrong.

Is there already an hotfix, to solve this issue ?

Note: The same update for Ax 2009 (5.0.1600.3735) in a Localized version: Eastern Europe, the method was not changed and its working as before.

Tech Details:

 

Check enclosed method (blue tag // INESF) where you can see the original code after the hot fix update, creating the ledgertrans problem

 

void updateLedgerAdjust(LedgerVoucher           _ledgerVoucher,
                        InventUpd_Financial      updateNow,
                        CostAmount               costAmount,
                        ProjAdjustRefId         _projAdjustRefId = '',
                        ProjTransDate           _projTransDate  = dateNull()
                        )
{
    // <GSA>
    InventJournalTrans  inventJournalTransLoc;
    // </GSA>
    ;

    if (this.mustBeBookedFinancially())
    {
        if (!this.checkInventSiteDimension(this.inventdim()))
        {
            throw error("@SYS18447");
        }

        if (!costAmount)
        {
            return;
        }

        if (this.mustBeBookedBalanceSheet())
        {
            // <GSA>
            if (LedgerParameters::find().EnableZakatReports_SA)
            {
                if (buffer.TableId == tablenum(InventJournalTrans)
                    && this.projId())
                {
                    inventJournalTransLoc = buffer;
                    if (inventJournalTransLoc.JournalType == InventJournalType::project)
                    {
                        _ledgerVoucher.findLedgerVoucherObject().parmProjId_SA(this.projId());
                    }
                }
            }
            // </GSA>

            _ledgerVoucher.addTrans(
                LedgerVoucherTransObject::newCreateTrans(
                    _ledgerVoucher.findLedgerVoucherObject(),
                    this.postingBalanceSheet(),
                    this.accountBalanceSheet(),
                    this.dimension(),
                    CompanyInfo::standardCurrency(),
                    costAmount,
                    0,
                    0
                   ));

            _ledgerVoucher.addTrans(
                LedgerVoucherTransObject::newCreateTrans(
                    _ledgerVoucher.findLedgerVoucherObject(),
                    // INESF -begin-
                    /*
                    this.postingBalanceSheet(),
                    this.accountBalanceSheet(),
                    */
                    this.postingOperations(),
                    this.accountOperations(),
                    // INESF -end-
                    this.dimension(),
                    CompanyInfo::standardCurrency(),
                    -costAmount,
                    0,
                    0
                   ));
             updateNow.updCostAmountLedger(updateNow.updCostAmountLedger() + costAmount);
        }
        else if (this.mustBeBookedOperations())
        {
            _ledgerVoucher.addTrans(
                LedgerVoucherTransObject::newCreateTrans(
                    _ledgerVoucher.findLedgerVoucherObject(),
                    this.postingOperations(),
                    this.accountOperations(),
                    this.dimension(),
                    CompanyInfo::standardCurrency(),
                    -costAmount,
                    0,
                    0,
                    0,0,0,UnknownNoYes::Unknown,false,
                    ProjLedger::newInventCost(this.projId(),
                                              this.activityNumber(),
                                              this.projCategoryId(),
                                              this.transId(),
                                              _projAdjustRefId,
                                              this.projTransactionOrigin(),
                                              this.projLedgerOrigin(),
                                              this.itemId(),
                                              false,
                                              _projTransDate,
                                              ProjItemTransCostType::Cost)));

             _ledgerVoucher.addTrans(
                LedgerVoucherTransObject::newCreateTrans(
                    _ledgerVoucher.findLedgerVoucherObject(),
                    this.postingOperations(),
                    this.accountOperations(),
                    this.dimension(),
                    CompanyInfo::standardCurrency(),
                    costAmount,
                    0,
                    0));

            updateNow.updOperationsAmountLedger(updateNow.updOperationsAmountLedger() - costAmount);
        }
        else
        {
            // Never expect to be executed.
            // Must be update financial is checking if mustBeBookedOperations OR mustBeBookedBalanceSheet is true
            throw error(Error::wrongUseOfFunction(funcname()));
        }
    }
}

 

*This post is locked for comments

I have the same question (0)
  • Ludwig Reinhard Profile Picture
    Microsoft Employee on at

    Hi,

    Can you let us know what is wrong with the purchase post invoice process in your opinion?

    Best regards,

    Ludwig

  • FilipeInes Profile Picture
    on at

    Hello Ludwig,

    Thanks for your time helping us, here is the detailed answer from my financial colleague Markus Kraeuter. 

     

    we experienced differences between General Ledger and the Inventory module which can be clearly identified by the reconciliation report from the GL.

     

    The differences are coming from purchase credit notes (or at least invoices which include credit lines) and they started after installing the hotfix and updating the application to 5.0.1600.3735.

    The problem is, that the same account is used, once with positive cost amount and the second time with the negative cost amount.

     

    3582.2.png

     

     

    This leads to a wrong GL posting due to the account and posting type selection.

     

    Simplified Example:

     

    • Item ABC is rated at weighted average cost with current cost amount 10 EUR.

    • The item is send back to the vendor for 0 EUR. (Just to simplify the voucher)

    • No taxes.

    • Direct Invoice posting (no packing slip reversal in voucher)

     

     

    • Expected ledger posting:

    Purchase consumption account             10

                Inventory account                      -10

               

     

    The problem is that no voucher at all gets posted in GL as the positive and the negative cost amount should be posted to the same account with the same posting type which sums up to 0 EUR.

     

    The correct transactions with correct amounts, accounts and posting types are created in the InventTrans as well as the InventTransPosting.

     

    InventTrans:

    3582.2.png

     

    InventTransPosting:

    8372.3.png

     

    But no entry in LedgerTrans. -> Financial Voucher was not created properly.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans