Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

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

$
0
0

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()));
        }
    }
}

 


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>