Certain large customers (a bank, an airline) had contracts where they would order large batches of printed forms, luggage tickets, sick bags, etc, at some negotiated quantity / price (taking into account the size of the print run, our capacity at the time, etc.). We (the print company) would then print it and warehouse it, and ship it directly to their individual locations in smaller batches as they ordered it.
The billing was done on some cost + shipping basis, so at the end of the month you'd have to look at everything that was shipped, work out which original batches going into inventory that came from on a FIFO basis, and then use that as a basis for the cost plus billing.
It was a horrible messy old codebase, and it was sometimes difficult to explain the results.
Anyway, I just thought I'd share this as an example use-case for a sufficiently generic / flexible / reliable implementation of your potential side project.
It seems easy to do this but there are tricky operations like REPOs when you have to 'borrow' papers from a reversal REPO to perform a sell or REPO operation. Then you should close this hole with a next papers arrival. I wanted to attach some web interface to visualize these crazy buys-sells-repos chains but at some moment I left that company.
I want to rewrite that tool as a side project but not sure if it would be helpful for anybody.