Skip to content

Commit

Permalink
collect function uses wrong direction for currency conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Grube committed Apr 10, 2020
1 parent 663b1a5 commit 679b17d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/Common/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function getUnpaidAttribute()
$this->$collection()->accrued()->notPaid()->each(function ($item) use (&$amount) {
$unpaid = $item->amount - $item->paid;

$amount += $this->convertFromDefault($unpaid, $item->currency_code, $item->currency_rate);
$amount += $this->convertToDefault($unpaid, $item->currency_code, $item->currency_rate);
});

return $amount;
Expand Down

0 comments on commit 679b17d

Please sign in to comment.