From ccca2f8013aada32c5e9be51f910c848f6f10306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Duli=C3=A7i?= Date: Mon, 6 Jun 2022 14:37:23 +0300 Subject: [PATCH] fixed #2424 #30xc7aw --- app/View/Components/Contacts/Show/Content.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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();