fixed invoice payment calculations
Merge pull request #108 from whitebook/master

fixed invoice payment calculations