diff --git a/CHANGELOG b/CHANGELOG index 8443e5b833..6e5d3fbaca 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +* Use positive sign for deposit amount of party + Version 4.4.0 - 2017-05-01 * Bug fixes (see mercurial logs for details) diff --git a/party.py b/party.py index e90861f859..a5ca83a0c0 100644 --- a/party.py +++ b/party.py @@ -50,7 +50,8 @@ class Party: cursor.execute(*line.join(account, condition=account.id == line.account ).select(line.party, - Sum(Coalesce(line.debit, 0) - Coalesce(line.credit, 0)), + # Use credit - debit to positive deposit amount + Sum(Coalesce(line.credit, 0) - Coalesce(line.debit, 0)), where=account.active & (account.kind == 'deposit') & party_clause diff --git a/tests/scenario_deposit.rst b/tests/scenario_deposit.rst index 6ad80707e8..83834a83cc 100644 --- a/tests/scenario_deposit.rst +++ b/tests/scenario_deposit.rst @@ -67,7 +67,7 @@ Check party deposit:: >>> party.reload() >>> party.deposit - Decimal('-100.00') + Decimal('100.00') Create final invoice::