Rework service, removed redundant code, service invoicing improvements
This commit is contained in:
@@ -68,9 +68,11 @@ class SearchController extends Controller
|
||||
foreach (Service::Search($request->input('term'))
|
||||
->whereIN('account_id',$account_ids)
|
||||
->orderBy('id')
|
||||
->limit(20)->get() as $o)
|
||||
->limit(20)
|
||||
->with(['product'])
|
||||
->get() as $o)
|
||||
{
|
||||
$result->push(['name'=>sprintf('%s (%s) %s',$o->name,$o->lid,$o->active ? '' : '<small>INACT</small>'),'value'=>'/u/service/'.$o->id,'category'=>$o->category_name]);
|
||||
$result->push(['name'=>sprintf('%s (%s) %s',$o->name,$o->lid,$o->active ? '' : '<small>INACT</small>'),'value'=>'/u/service/'.$o->id,'category'=>$o->product->category_name]);
|
||||
}
|
||||
|
||||
// Look for an Invoice
|
||||
@@ -93,7 +95,7 @@ class SearchController extends Controller
|
||||
}
|
||||
|
||||
return $result
|
||||
->sortBy(function($item) { return $item['category'].$item['name']; })
|
||||
->sortBy(fn($item)=>$item['category'].$item['name'])
|
||||
->values();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user