To simplify here is what I'm trying to do
From this:
To this:
Move inventory 1 to 5 to the next month and ensure that leftovers is as close as possible to 0 but not go negative.
The inventory Qty is treated as a whole and can't be combined
Previous month's inventory takes priority and it can only move month to month in order (ie., can't jump from Feb to May)
From this:

To this:

Move inventory 1 to 5 to the next month and ensure that leftovers is as close as possible to 0 but not go negative.
The inventory Qty is treated as a whole and can't be combined
Previous month's inventory takes priority and it can only move month to month in order (ie., can't jump from Feb to May)