close #2275 Fixed: Vendor and Payment deleting issue.

This commit is contained in:
Cüneyt Şentürk 2021-10-05 13:26:27 +03:00
parent c54c078e87
commit 3c71560d46
2 changed files with 4 additions and 4 deletions

View File

@ -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());
}

View File

@ -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());
}