Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

Adjust cost during invoice posting using .Net or SQL

Posted on by Microsoft Employee

How to adjust item current cost during invoice posting using .Net or SQL?

For example, adjust rebate amount from cost of goods.

In the step of posting reading current cost, can I capture that event and change the amount?

thanks in advance.

*This post is locked for comments

  • sandipdjadhav Profile Picture
    sandipdjadhav 18,265 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    HI,

    I will suggest you to pass line item as 'Rebate' with negative cost ,price is 0 and Qty 1. This way you don't have to re-calculate cost. System will take care of actual costing.

    Thanks

    Sandip

  • Verified answer
    Frank Hamelly | MVP, MCP, CSA Profile Picture
    Frank Hamelly | MVP... 4,029 Super User 2024 Season 2 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    I fully agree with Richard's advice.  The Binary Stream product was developed for GP for exactly what your client is attempting to do via a customization.  And, as Richard points out and you astutely agreed, altering the results coming from GP's logic around product costing is fraught with potential unintended consequences.  

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    You may want to check out this ISV solution to account for rebates. There is nothing in GP that allows for that.

    www.binarystream.com/vendor_contracts.asp

  • Verified answer
    Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    The IV00103 has the Last_Originating_Cost field. GP will use that when entering a new PO. However, for  what you are asking is much more complicated. GP will grab the current cost of at item at the time the invoice is posted. This will be dependent upon the inventory valuation method being used for that item and then what receipts layers are still available.  If you are using FIFO Perpetual it will go back to the earliest receipt layer that still has quantity available and use that cost.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adjust cost during invoice posting using .Net or SQL

    The client want net cost of goods (current - rebate) be posted because they get rebate for certain customer and item.

    What's the correct way to accomplish this automatically assume we can set up rebate per customer and item. Thanks

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adjust cost during invoice posting using .Net or SQL

    I am so glad to get expert's advice. Thanks.

    I am not a GP person at all. I am a .Net developer and GP internal process rules are new to me.

    I will check the suggested solution.

    One last request. What I mean to change unit cost is not try to reset unitcost in IV00100.

    I am trying to find out which GP procedure reads that value in IV posting. Perhaps when that even is happening, I can alter the read value in memory before next process start pick them up?

    If that will throw the physical inventory value out of balance with the general ledger, I will abandon the idea.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,730 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    Frank is 100% correct. There is a utility for this in GP. Tools->Utilities->Inventory->Adjust Unit Cost. Making back-end adjustments should be done when no other solution is available.

  • Frank Hamelly | MVP, MCP, CSA Profile Picture
    Frank Hamelly | MVP... 4,029 Super User 2024 Season 2 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    Why do you want to do this?  You run the risk of throwing your physical inventory value out of balance with the general ledger.  Advise you have a very detailed discussion with your accounting department, if you have not yet done so.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Adjust cost during invoice posting using .Net or SQL

    Right, after some testing, I found the posting always use item unit cost as cost of goods calculation.

    do you which procedure I should call in .net  to change item current cost manually?

    I still have to adjust unit cost at beginning of posting process. thanks

  • Verified answer
    soma Profile Picture
    soma 24,406 on at
    RE: Adjust cost during invoice posting using .Net or SQL

    While posting transactions for items, GP not only consider the item current cost. It is validating the unit cost of the items based on the Item valuation methods and current cost.

    You can write a script to capture the current cost of the items before posting the transactions and pass your manual current cost. But, I would not recommend you to change the GP logic.

    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