Show accounting link on accounts that are linked
This commit is contained in:
@@ -40,7 +40,7 @@ class AccountingAccountSync implements ShouldQueue
|
||||
public function handle()
|
||||
{
|
||||
$api = $this->to->provider->API($this->to);
|
||||
$accounts = Account::get();
|
||||
$accounts = Account::with(['user'])->get();
|
||||
|
||||
foreach ($api->getCustomers() as $customer) {
|
||||
$ao = NULL;
|
||||
@@ -54,7 +54,7 @@ class AccountingAccountSync implements ShouldQueue
|
||||
$ao = $x->pop();
|
||||
|
||||
// Look based on Name
|
||||
} elseif (($x=$accounts->filter(function($item) use ($customer) { return $item->company == $customer->companyname || $item->name == $customer->fullname; }))->count() === 1) {
|
||||
} elseif (($x=$accounts->filter(function($item) use ($customer) { return $item->company == $customer->companyname || $item->name == $customer->fullname || $item->user->email == $customer->email; }))->count() === 1) {
|
||||
$ao = $x->pop();
|
||||
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user