diff --git a/app/Models/Common/Contact.php b/app/Models/Common/Contact.php index 2acebc57f..75990d1d6 100644 --- a/app/Models/Common/Contact.php +++ b/app/Models/Common/Contact.php @@ -192,9 +192,7 @@ class Contact extends Model $collection = $this->isCustomer() ? 'invoices' : 'bills'; $this->$collection->whereNotIn('status', ['draft', 'cancelled', 'paid'])->each(function ($item) use (&$amount) { - $unpaid = $item->amount - $item->paid; - - $amount += $this->convertToDefault($unpaid, $item->currency_code, $item->currency_rate); + $amount += $this->convertToDefault($item->amount_due, $item->currency_code, $item->currency_rate); }); return $amount;