added customer and vendor scopes

This commit is contained in:
denisdulici
2020-04-07 14:39:35 +03:00
parent d94bf5d5b5
commit a2b17eaab5
9 changed files with 50 additions and 37 deletions

View File

@@ -82,17 +82,17 @@ abstract class Report
public function getCustomers()
{
return $this->getContacts($this->getCustomerTypes());
return $this->getContacts('customer');
}
public function getVendors()
{
return $this->getContacts($this->getVendorTypes());
return $this->getContacts('vendor');
}
public function getContacts($types)
public function getContacts($type)
{
return Contact::type($types)->orderBy('name')->pluck('name', 'id')->toArray();
return Contact::$type()->orderBy('name')->pluck('name', 'id')->toArray();
}
public function applyDateFilter($event)