Hi all,
I a customers database, there are a few occasions where the posted quantities of a shipment are not equal to the shipped quantity; for instance 5 items are shipped to a client but 7 are posted to the item ledger!
The problem starts in the registered picks. There are a few picks in the table "registered whse. activity line", where the "quantity"does not match the "qty (base)". When the shipment for such a pick is posted, the sales order line will show that 5 items are shipped (as well as the posted sales shipment). As said above, the item ledger entry will show 7!
The sales line still holds an open quantity. Let's say, the client ordered 20 pieces. In that case the sales line will show an open quantity of 15.
The problem seems to be caused by the difference in quantity and quantity (base). But all the items in the customers database have the same UOM for sales/purchasing/inventory. I have checked the code on the "wharehouse activity line" table: both columns are validated correctly. I have tried to create a pick with a different figure in the quantity/quantity(base), but NAV updates the other field as soon as you change either of the fields in the pick.
Does anyone have an idea about the cause of this problem?
Rgds,
Ramon
0
Answers
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The problem in a nutshell is that the fields "Quantity" and "Qty. (Base)" in the "Warehouse Entry" table differs. Sometimes wildly, like 4 vs -17. The error exists in both v4 and v5.
Here's how you reproduce the error (the rest of this post is more or less copy/paste from my exchange with Microsoft):
In a standard CRONUS database do the following:
1) Create a Purchase Order for Item LS-120, Location Code WHITE, Quantity 100. 2) Release it. 3) Create Warehouse Receipt. 4) Post the Receipt. 5) The second and last line of the Put-away is disastrously wrong.
From this point on no checks/recalculation of "Quantity" and "Qty. (Base)" takes place which means the Warehouse Entries end up a complete mess.Consider this code from codeunit 7313: In the reproducible example shown above, the first Place line yields the following result:
BinContentQty = 8
BinContentQtyBase = 10
Obviously wrong. The error stems from the fact that the two values are calculated in wildly different ways probably due to bad database design.
[Original code fix removed. See the Microsoft approved code fix here: http://www.mibuso.com/forum/viewtopic.php?p=122270#122270]
In addition, we've investigated what could be done with the f**ked up Warehouse Entries. We're currently leaning towards a very basic solution which is to simply copy the "Quantity" fields to the "Quantity Base" fields.
So, there you go. This took forever and a day to unearth so I hope somebody can use it. Please note that I'm basically a developer that knows nothing about Warehouse so please don't ask any complicated questions
Brian Rocatis
Senior NAV Developer
Tectura (Denmark)
Senior NAV Developer
Elbek & Vejrup
The database we're using is SQL2005 in version 5.0.
Brian,
Thanks a lot for sharing your findings. We ended up writing a process that finds these entries instead of changing the code because I'm afraid it may f**k up something else. So the users are trained to run the process whenever the quantity is wierd.
This is definately a huge problem with WHM in 5.0. I hope MSFT fixes this in 5.1...
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
After an analysis of the problem entries, I noticed that the errors were happening on the receicing side as Brian described. We've implemented the code Brian provided to see how it will work out.
Will keep you guys posted, but I do believe Brian has solved this problem. =D> =D> =D>
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I'm assuming that you're repopulating "Qty.(Base)" from "Quantity" in the "Warehouse Entry" table?
BTW, Microsoft has awoken (apparently my postings weren't added to the case #-o ) and I expect to have my resolution validated shortly along with my suggestion of how to fix the problem.
The problem is that it's so elusive. I mean, it's existed since v4 apparently without anybody reacting to it. Anyways, I'm pretty certain it won't be in SP1 (too close to shipping) but it definately should be made available as a hotfix.
Brian Rocatis
Senior NAV Developer
Tectura (Denmark)
Senior NAV Developer
Elbek & Vejrup
Yep, that's exactly what I'm doing. But I've put in your code and hopefully, that will address the problem.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
I hope so too, but in the meanwhile we have a couple of thousand f**ked up Warehouse Entries which we would like to correct...
You're just confirming my hunch that the fix is to repopulate "Qty.(Base)" from "Quantity".
Brian Rocatis
Senior NAV Developer
Tectura (Denmark)
Senior NAV Developer
Elbek & Vejrup
Also, make sure they're all using the Base UOM for the entries.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
The approved solution is this:
Table 7302:
Codeunit 7313:
I've tested it and it seems to do the trick \:D/
Senior NAV Developer
Elbek & Vejrup
This is what our developper found out:
Solution:
The problem was caused by the calling the function CheckReservation in Procedure CreateTempLine of Codeunit 7312 Create Pick. The function reduces the TotalQtytoPick with the Quantity reserved on non "Item Ledger Entry". Obviously after modifying the TotalQtytoPick the TotalQtyPickBase should also be modified! The issue is solved by adding one line of code as illustrated in the code snippet below:
CreateTempLine(LocationCode : Code[10];ItemNo : Code[20];VariantCode : Code[10];UnitofMeasureCode : Code[10];FromBinCode : Code[20];ToB CheckReservation(
LocationCode,SourceType,SourceSubType,SourceNo,SourceLineNo,SourceSubLineNo,
QtyPerUnitofMeasure,TotalQtytoPick);
TotalQtytoPickBase:=TotalQtytoPick*QtyPerUnitofMeasure; //FIX-007B.ns
RemQtyToPick := TotalQtytoPick;
RemQtyToPickBase := TotalQtytoPickBase;
Will be fun fixing these entries... \:D/
"Profanity is the one language all programmers know best."
Implement the fix for your clients if you plan to use WHM!!!
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
"Profanity is the one language all programmers know best."
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
And if they've actually modified the code without fixing the bug, they're simply adding insult to injury. We are not amused.
Senior NAV Developer
Elbek & Vejrup
Things that are fundamental problems that causes number discrepancies I'd assume would be top priority and addressed in new versions.
Here's a blog on it:
http://www.dynamicsnavconsultant.com/20 ... -away-nav/
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book