agritheory / beam

General Purpose 2D barcode scanning for ERPNext
https://agritheory.com/documentation/beam/
Other
20 stars 9 forks source link

Add validation to disallow overconsumption of qty in a handling unit #42

Closed agritheory closed 10 months ago

agritheory commented 11 months ago

Assume the Handling Unit has a qty of 40. The follow transaction should fail:

Item Warehouse Handling Unit Quantity
Cocoplum Storeroom 123 41 Ea
agritheory commented 10 months ago

Reopening as this current implementation is a little off the mark. It's passes the specific xfail test, but also fails a bunch of other tests, conflicting with net quantity features.

Update: we want to throw a negative inventory error here, but have it specific to the handling unit. There is some code in the ERPNext repo to base this on - we need to detect if the transaction is incoming or outgoing and switch the greater than/ less than operator appropriately.