From 3c71560d46e396683aae3bca5cab42b5a729087a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Tue, 5 Oct 2021 13:26:27 +0300 Subject: [PATCH] close #2275 Fixed: Vendor and Payment deleting issue. --- app/Traits/Contacts.php | 4 ++-- app/Traits/Transactions.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Traits/Contacts.php b/app/Traits/Contacts.php index f5bbdc28f..a529b6b6b 100644 --- a/app/Traits/Contacts.php +++ b/app/Traits/Contacts.php @@ -6,14 +6,14 @@ trait Contacts { public function isCustomer() { - $type = $this->type ?? $this->contact->type ?? 'customer'; + $type = $this->type ?? $this->contact->type ?? $this->model->type ?? 'customer'; return in_array($type, $this->getCustomerTypes()); } public function isVendor() { - $type = $this->type ?? $this->contact->type ?? 'vendor'; + $type = $this->type ?? $this->contact->type ?? $this->model->type ?? 'vendor'; return in_array($type, $this->getVendorTypes()); } diff --git a/app/Traits/Transactions.php b/app/Traits/Transactions.php index faef5cb18..51bc0cbc2 100644 --- a/app/Traits/Transactions.php +++ b/app/Traits/Transactions.php @@ -9,14 +9,14 @@ trait Transactions { public function isIncome() { - $type = $this->type ?? $this->transaction->type ?? 'income'; + $type = $this->type ?? $this->transaction->type ?? $this->model->type ?? 'income'; return in_array($type, $this->getIncomeTypes()); } public function isExpense() { - $type = $this->type ?? $this->transaction->type ?? 'expense'; + $type = $this->type ?? $this->transaction->type ?? $this->model->type ?? 'expense'; return in_array($type, $this->getExpenseTypes()); }