-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finalise stocktake making invalid stock adjustments (into negative on ledger) #629
Comments
Yah I also faced this problem in medical action myanmar with negative stock which is creating ledger problem. Sorry i didnot made the issue but i informed to andrei about it. |
@Chris-Petty I like your fix: #634 , I think it can be extended, after checking 'checkForFinaliseError' and before record.finalise.. call checkForFinalisationError again. |
I had a further look into this issue, first assumption was incorrect, it's nothing to do with realm.. It seems that onEndEditing is called after the button click, it's called just after the modal is shown. If you create a simple react native app with just a button and a text input, when button is pressed the text is still in focus. We can call Keyboard.dismiss() to un-focus the text input, and only after that try to open the finalisation modal. I've tested the code below, it works, but the timeout of 1 second might not be sufficient in all cases:
|
Yea I also tested keyboard.dismiss to try and get onEndEditing to run before the modal did it's thing, but it wasn't quick enough. The setTimeout is a bit of a hack/dirty I thought and potentially flawed as you mentioned. I did try to think if there was a way to use |
…djustments Looks good to me, I've tested both reducing below minimum in stocktake and finalising 0 quantity in customer invoice. Both times a valid message appears after pressing confirm.
Build Number: 2.1.0-rc8
Description:
Through a fun sequence of editing you can make stocktakes that show a negative ledger total for an item but show's "fine" on mobile. Both are wrong. Fortunately it's not totally easy to achieve.
Reproducible: Yes
Reproduction Steps:
In mSupply mobile, it'll say there is 0 stock. In mSupply Desktop for that store it'll say 0 stock too, but by the ledger it should have -100 stock.
(I've done it a couple times here, so -250)
Comments: 🙈
The text was updated successfully, but these errors were encountered: