Skip to content

Commit

Permalink
Add some documentation for stock control feature. Fixes #169
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdoug committed Jan 20, 2020
1 parent d41c261 commit 460ca45
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/advanced-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,17 @@ Example - don't allow batteries to be stacked
return true;
}
}
Limited supply boxes
--------------------

In standard/basic use, BoxPacker will assume you have an adequate enough supply of each box type on hand to cover all
eventualities i.e. your warehouse will be very well stocked and the concept of "running low" is not applicable.

However, if you only have limited quantities of boxes available and you have accurate stock control information, you can
feed this information into BoxPacker which will then take it into account so that it won't suggest a packing which would
take you into negative stock.

To do this, have your box objects implement the ``BoxPacker\LimitedSupplyBox`` interface which has a single additional method
over the standard ``BoxPacker\Box`` namely ``getQuantityAvailable()``. The library will automatically detect this and
use the information accordingly.

0 comments on commit 460ca45

Please sign in to comment.