Error "warehouse does not allow negative inventory" in physical inventory if m_storage ASI_ID > 1

Description

There are situations when the same ASI_ID/LotNr. exists more than once in m_storage, for example if there multiple, partial vendor deliveries with different material policy dates:

MR 1 ASI_ID=123 (LotNr 999) Qty=10 Material policy date= 1/1/2018
MR 2 ASI_ID=123 (LotNr 999) Qty=5 Material policy date= 5/1/2018

Sales order/Customer shipment ASI_ID=123 Qty=10

M_Storage now looks like this:
ASI_ID=123 (LotNr. 999) Qty=0 Material policy date=1/1/2018
ASI_ID=123 (LotNr. 999) Qty=5 Material policy date=5/1/2018

When performing a physical inventory to write off the remaining quantity of 5 (e.g. because they can no longer be located), the system throws error message "warehouse does not allow negative inventory".

On the other hand, sales Order and customer shipment for ASI_ID=123 and remaining qty of is successful.

I can't say for sure if this a bug, limitation or a feature but it does look like as if it's a bug.

Cheers,
Michael

Environment

None

Activity

Show:
Hiep Lq
March 14, 2018, 3:44 AM

hi if your code isn't up to date, you can try IDEMPIERE-3624.
it look same my situation at

Michael Powacht
March 14, 2018, 6:04 AM

Thank you Hiep. We are in progress of upgrading to 5.1 but not done yet so we haven't deployed the latest code changes.

I think you are right that this issue gets resolved in the current version although we only use 1 locator, not multiple locators (as stated in the referenced JIRA). I simulated our issue in Carlos' 5.1 demo system and the write-off works with multiple m_storage records with identical ASI_IDs: https://demo.globalqss.com/webui/index.zul
Here is the test scenario in Carlos' demo system:
Product=ASI
Product=>Located At (m_storage):
ASI_ID=1000001 (Lot=«LOT-1»_12/31/2018) Qty=0 Material policy date=03/13/2018 (mm/dd/yyyy)
ASI_ID=1000001 (Lot=«LOT-1»_12/31/2018) Qty=10 Material policy date=03/10/2018 (mm/dd/yyyy)

Physical inventory document 10000000.

I'll re-test in our environment once we have completed our upgrade to 5.1

Thanks,
Michael

Murilo Habermann Torquato
June 25, 2020, 2:58 PM

hi

I also had a lot of headache with ASI and negative inventory on the past, but now it looks like solved on newest versions.

I’ll mark this ticket as resolved as not reproducible on 7.1z version, but maybe I’m missing something and then fell free to add more information and reopen the issue if needed.

Michael Powacht
June 26, 2020, 2:48 AM

Thanks Murilo! Back when i raised the ticket under 4.1, I made a note that this issue may have been resolved under 5.1. I am going to verify it under 7.1 and let u know should there still be any issue.

Michael Powacht
June 27, 2020, 10:11 AM

Hello Murilo, I just successfully simulated the transactions described above in our 7.1 instance and the issue has indeed been resolved. Thanks for your support!

Assignee

Unassigned

Reporter

Michael Powacht

Labels

Tested By

None

Components

Fix versions

Affects versions

Priority

Minor
Configure