agritheory/beam

Add validation to disallow overconsumption of qty in a handling unit

Closed this issue · 1 comments

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

Item Warehouse Handling Unit Quantity
Cocoplum Storeroom 123 41 Ea
  • Add validation function that throws an error when this is the case
  • Add test case that confirms that an error is being raised (@pytest.mark.xfail())

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.