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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)
Active Discussion

Item purchase price

(0) ShareShare
ReportReport
Posted on by 85

  

*This post is locked for comments

  • Brandon Wiese Profile Picture
    17,790 on at

    Table InventTable, method updateLastPurchPrice(). 

    That method is called from Class PurchInvoiceJourPost, method calcLastPurchPrice().

  • AamirKhan Profile Picture
    85 on at

       

  • Brandon Wiese Profile Picture
    17,790 on at

    If you look at my original answer, I already gave you that information too.

  • AamirKhan Profile Picture
    85 on at

    -

  • Brandon Wiese Profile Picture
    17,790 on at

    The class is actually PurchInvoiceJournalPost (not PurchInvoiceJourPost from my original post, but that's close enough you should have found it).

    Here's the method I referenced.

    protected void  calcLastPurchPrice()
    {
        Debug::assert(!vendInvoiceInfoLine.isNonPO());
    
        if (!vendInvoiceInfoLine.PurchPrice)
        {
            vendInvoiceInfoLine.PurchPrice = PriceDisc::amount2Price(vendInvoiceInfoLine.LineAmount,
                                                               vendInvoiceInfoLine.discPercent(),
                                                               vendInvoiceInfoLine.PurchMarkup,
                                                               vendInvoiceInfoLine.ReceiveNow,
                                                               vendInvoiceInfoLine.discAmount(),
                                                               vendInvoiceInfoLine.PriceUnit,
                                                               vendInvoiceInfoLine.purchLine().CurrencyCode,
                                                               vendInvoiceInfoLine.PurchPrice);
        }
    
        vendInvoiceInfoLine.inventTable().updateLastPurchPrice(vendInvoiceInfoTable.TransDate,
                                                         vendInvoiceInfoTable.CurrencyCode,
                                                         vendInvoiceInfoLine.PurchPrice,
                                                         vendInvoiceInfoLine.PriceUnit,
                                                         vendInvoiceInfoLine.PurchMarkup,
                                                         purchLine.PurchUnit,
                                                         purchLine.inventDim());
    }


  • AamirKhan Profile Picture
    85 on at
  • Brandon Wiese Profile Picture
    17,790 on at

    The method InventTable::updateLastCostPrice() is called from multiple places.

    These are the main ones to focus on.

    Class InventtUpd_Financial method updateFinancialReceipt().

    Class ProdUpdHistoricalCost method updateProduction().

    Class InventModelType method postUpdateFinancialAdjustment().

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Sanhthosh.Kumar.K Profile Picture

Sanhthosh.Kumar.K 2

#2
Raed Salah Bzour Profile Picture

Raed Salah Bzour 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans