improved default scopes

This commit is contained in:
Denis Duliçi
2022-06-10 19:26:32 +03:00
parent 5890a99bf9
commit 92065bd49d
13 changed files with 68 additions and 79 deletions

View File

@ -94,7 +94,7 @@ class Contact extends Model
public function bills()
{
return $this->documents()->where('type', Document::BILL_TYPE);
return $this->documents()->where('documents.type', Document::BILL_TYPE);
}
public function currency()
@ -104,17 +104,17 @@ class Contact extends Model
public function expense_transactions()
{
return $this->transactions()->whereIn('type', (array) $this->getExpenseTypes());
return $this->transactions()->whereIn('transactions.type', (array) $this->getExpenseTypes());
}
public function income_transactions()
{
return $this->transactions()->whereIn('type', (array) $this->getIncomeTypes());
return $this->transactions()->whereIn('transactions.type', (array) $this->getIncomeTypes());
}
public function invoices()
{
return $this->documents()->where('type', Document::INVOICE_TYPE);
return $this->documents()->where('documents.type', Document::INVOICE_TYPE);
}
public function transactions()