diff --git a/app/View/Components/Contacts/Show/Content.php b/app/View/Components/Contacts/Show/Content.php index 8a40bfc9d..f1bd76941 100644 --- a/app/View/Components/Contacts/Show/Content.php +++ b/app/View/Components/Contacts/Show/Content.php @@ -34,7 +34,9 @@ class Content extends Component $this->counts = []; // Handle documents - $this->documents = $this->contact->documents()->with('transactions')->get(); + $docs = $this->contact->isCustomer() ? 'invoices' : 'bills'; + + $this->documents = $this->contact->$docs()->with('transactions')->get(); $this->counts['documents'] = $this->documents->count();