Gen multiple invoices for past due and cleanup

If an order is past due, we now will generate all invoices to bring it
up to current.  Usually this should be just one, but if a day is missed,
we won't screw the whole system.  Also, a lot of code cleanup to make
things a little easier to read.  It's still a bit messy.
Missed these changes for previous commit.
More invoice gen clean up & fixed due date bug

Bug was if an invoice already exists for an order's next due date, we
never updated the order's due date, so never generated another invoice.
Very minor cosmetic clean up