Refactoring and bug fix

I believe this is the root of all the issues. If a customer paid, getTotalDue is 0 and this is why it would keep adding a payment. Updated so only enters the conditional if there is something due and the order can be invoiced.