Progress on order progress
This commit is contained in:
@@ -17,55 +17,6 @@ class AdminHomeController extends Controller
|
||||
return View('a.service',['o'=>$o]);
|
||||
}
|
||||
|
||||
public function service_update(Request $request, Service $o)
|
||||
{
|
||||
if (! $o->validStatus(strtolower($request->input('action'))))
|
||||
return $this->service($o);
|
||||
|
||||
$action = strtolower($request->input('action'));
|
||||
|
||||
switch ($action)
|
||||
{
|
||||
case 'approve':
|
||||
// Send an email to the supplier.
|
||||
// @todo Change to address to suppliers email address.
|
||||
Mail::to('help@graytech.net.au')
|
||||
->queue((new OrderRequestApprove($o,$request->input('order_notes') ?: 'NONE'))->onQueue('high'));
|
||||
|
||||
// Send an email to the client.
|
||||
// @todo Your order has been submitted to supplier.
|
||||
|
||||
// Update the service to "ORDER-SENT"
|
||||
$o->nextStatus($action);
|
||||
|
||||
break;
|
||||
|
||||
case 'reject':
|
||||
$o->order_info = array_merge($o->order_info ? $o->order_info : [],['reason'=>$request->input('notes')]);
|
||||
|
||||
// Send mail to user
|
||||
Mail::to($o->orderby->email)->queue((new OrderRequestReject($o,$request->input('notes')))->onQueue('email'));
|
||||
|
||||
$o->nextStatus($action);
|
||||
break;
|
||||
|
||||
case 'hold':
|
||||
case 'release':
|
||||
$o->nextStatus($action);
|
||||
break;
|
||||
|
||||
case 'update_reference':
|
||||
$o->order_info = array_merge($o->order_info ? $o->order_info : [],['order_reference'=>$request->input('notes')]);
|
||||
$o->save();
|
||||
|
||||
// No action specified.
|
||||
default:
|
||||
return $this->service($o);
|
||||
}
|
||||
|
||||
return redirect(url('/a/service',[$o->id]));
|
||||
}
|
||||
|
||||
public function setup()
|
||||
{
|
||||
return view('a.setup');
|
||||
|
Reference in New Issue
Block a user