Prevent Negative stock. Navision 3.70

steveinlondonsteveinlondon Member Posts: 5
We have negative stock quantities in inventory. Can this be prevented by configuration? If not, does anybody have any solutions or workarounds to prvent negative inventory being created?

Ive seen posts advising to sort the problem out using journals, we want to prevent it happening in the first place.

:-k

Comments

  • KowaKowa Member Posts: 925
    edited 2005-05-06
    The only way to prevent this is to post the purchases/ positve adjustments before the sales.

    Navison creates Item Ledgers entries for every item posting, and the inventory you see is simply the sum of these entries. There is no inventory stored anywhere in the database, the "Amount" field in the item ledger entries is summed up using the SIFT Technology when the record is displayed on the form.
    Kai Kowalewski
  • steveinlondonsteveinlondon Member Posts: 5
    Thats great, really helped clear this up. We will go to our NSC and have them quote for a code change to catch the negative invetory scenario before postings.
  • krikikriki Member, Moderator Posts: 9,118
    You can create a test in Codeunit 22 in function "Code" AFTER locking table 32:"Item Ledger Entry".
    Why after locking? Because if you do it before and 2 sessions are posting a negative entry on the same item, it is possible that when the the test is done, it is OK for both, but afterwards, the stock will be negative. Eg. you have a stock of 10 items and 2 sessions want to post a negative entry of 8 items. Independant of each other it is possible because the remaining stock will be 2, but if BOTH are posted, there is a problem:you will have a stock of -6! If you do it AFTER locking the table, the second session waits before testing the stock and the problem will not occur.

    You have to write some testing code (if "Entry Type"::"Negative Adjmt.", "Quantity" will be positive anyway), you have to check the location code, bin code (if used), serial no, lot no.

    ...OR to make programming a bit easier : You can write the test AFTER the posting has been done. In that case you don't have to test the "Entry Type", just test on the item no, location code, bin code, serial code, lot no. Put those filters on a T32:"Item Ledger Entry"-record and do a CALCSUMS(Quantity) and give an error if the result is negative. The negative of this is that if it gives an error, you blocked the table to post it for nothing while you could have avoided the blocking time. If negative stock don't happen a lot, this is not a problem.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • KowaKowa Member Posts: 925
    If any additional programming is do be done, please observe that the inventory is easy to calculate (posting date is irrelevant), but the inventory cost adjustment routine (Report 795) depends on the usage of the actual posting dates for it to function properly.
    Kai Kowalewski
  • safindleysafindley Member Posts: 13
    We have negative stock quantities in inventory. Can this be prevented by configuration?

    The "Stockout Warning" field in Sales & Receivables Setup can be used to display a warning when a sale will result in negative inventory.
Sign In or Register to comment.