zsoltbalogh/payoff — pull request #12 by djavorszky (2014-08-24 15:28:55+00:00)
Title: Added project-scoped balances, squashed a bug

Hi Zsolt,

Added project-scoped balances into the project_email table (that seemed like the most logical place where I'd put it, as I didn't want to create a new table that was basically project_email + balances). This is in preparation for the merged-project feature.

I also fixed a bug: the user balances were updated wrongly when there were more than 2 people on a project and a record was added. Prior to this PR, the update was always "amount paid divided by number of people paid for", however, for the one who paid, it's "amount paid minus (amount paid divided by number of people paid for)"