Here is my problem in english.
I have an INVOICE table which has orders with a quantity. I need to
take those orders out and make new 12 pack boxes from the original
invoice. For example:
Invoice 1 is an order for 3 widgets
Invoice 2 is an order for 12 widgets
Invoice 3 is an order for 6 widgets
What should happen is the 3 widgets from order one is combined with 9
widgets in order two to make a packing slip for 12 widgets. The
remaining total is less that 12 so nothing happens with the rest. The
transaction would need to be logged as weel but that is another issue.
I was initially planning on just turning every invoice into rows and
the just grabbing the top 12 or with a do 12 times or whatever. That
way I get only what I need. I am just wondering if there is a way
without creating so many records in the database.
Thanks in advance!