improved default scopes
This commit is contained in:
@ -63,7 +63,7 @@ class Currency extends Model
|
||||
|
||||
public function bills()
|
||||
{
|
||||
return $this->documents()->where('type', Document::BILL_TYPE);
|
||||
return $this->documents()->where('documents.type', Document::BILL_TYPE);
|
||||
}
|
||||
|
||||
public function contacts()
|
||||
@ -73,22 +73,22 @@ class Currency extends Model
|
||||
|
||||
public function customers()
|
||||
{
|
||||
return $this->contacts()->whereIn('type', (array) $this->getCustomerTypes());
|
||||
return $this->contacts()->whereIn('contacts.type', (array) $this->getCustomerTypes());
|
||||
}
|
||||
|
||||
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()
|
||||
@ -98,7 +98,7 @@ class Currency extends Model
|
||||
|
||||
public function vendors()
|
||||
{
|
||||
return $this->contacts()->whereIn('type', (array) $this->getVendorTypes());
|
||||
return $this->contacts()->whereIn('contacts.type', (array) $this->getVendorTypes());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user