Skip to content

Commit

Permalink
support partial drawdown of advances
Browse files Browse the repository at this point in the history
  • Loading branch information
countvajhula committed Mar 22, 2024
1 parent 77c85f5 commit c8c0698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oldabe/money_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ def distribute_payment(payment, attributions):
advance_totals = get_sum_of_advances_by_contributor(attributions)
for email, advance_total in advance_totals.items():
amount_payable = amounts_payable.get(email, 0)
drawdown_amount = max(advance_total - amount_payable, 0)
drawdown_amount = min(advance_total, amount_payable)
if drawdown_amount > ACCOUNTING_ZERO:
negative_advance = Advance(email=email,
amount=-drawdown_amount, # note minus sign
Expand Down

0 comments on commit c8c0698

Please sign in to comment.