diff --git a/app/Http/Controllers/OrderController.php b/app/Http/Controllers/OrderController.php index ffec4c0..00fbc3c 100644 --- a/app/Http/Controllers/OrderController.php +++ b/app/Http/Controllers/OrderController.php @@ -53,7 +53,6 @@ class OrderController extends Controller }) ->validate(); - // Check the plugin details. $po = Product::findOrFail($request->input('product_id')); @@ -103,6 +102,7 @@ class OrderController extends Controller $so->product_id = $request->input('product_id'); $so->order_status = 'ORDER-SUBMIT'; $so->orderby_id = Auth::id(); + $so->model = get_class($options); if ($options->order_info) { @@ -117,7 +117,7 @@ class OrderController extends Controller $options->save(); } - Mail::to('deon@graytech.net.au')->queue((new OrderRequest($so))->onQueue('email')); //@todo Get email from DB. + Mail::to('help@graytech.net.au')->queue((new OrderRequest($so,$request->input('options.notes')))->onQueue('email')); //@todo Get email from DB. return view('order_received',['o'=>$so]); } } \ No newline at end of file diff --git a/app/Models/AdslPlan.php b/app/Models/AdslPlan.php index 71fdb57..f4a6ec3 100644 --- a/app/Models/AdslPlan.php +++ b/app/Models/AdslPlan.php @@ -19,6 +19,12 @@ class AdslPlan extends Model 'validation'=>'required|string:10', 'validation_message'=>'Address is a required field.', ], + 'options.notes'=>[ + 'request'=>'options.notes', + 'key'=>'order_info.notes', + 'validation'=>'present', + 'validation_message'=>'Special Instructions here.', + ], ]; protected $order_model = Service\Adsl::class; diff --git a/app/Models/PlanVoip.php b/app/Models/PlanVoip.php index 216b5f4..1cf4ed8 100644 --- a/app/Models/PlanVoip.php +++ b/app/Models/PlanVoip.php @@ -14,7 +14,7 @@ class PlanVoip extends Model 'options.phonenumber'=>[ 'request'=>'options.phonenumber', 'key'=>'service_number', - 'validation'=>'required|min:10', + 'validation'=>'required|size:10', 'validation_message'=>'Phone Number is a required field.', ], 'options.supplier'=>[ @@ -29,6 +29,12 @@ class PlanVoip extends Model 'validation'=>'required|min:4', 'validation_message'=>'Phone Supplier Account Number is a required field.', ], + 'options.notes'=>[ + 'request'=>'options.notes', + 'key'=>'order_info.notes', + 'validation'=>'present', + 'validation_message'=>'Special Instructions here.', + ], ]; protected $order_model = Service\Voip::class; diff --git a/app/Models/Service.php b/app/Models/Service.php index ac66350..c94f269 100644 --- a/app/Models/Service.php +++ b/app/Models/Service.php @@ -180,6 +180,7 @@ class Service extends Model { return $this->model ? $this->type->name : NULL; } + /** * Return the date for the next invoice * diff --git a/composer.lock b/composer.lock index 721c17a..7e3afb3 100644 --- a/composer.lock +++ b/composer.lock @@ -2357,11 +2357,11 @@ }, { "name": "leenooks/laravel", - "version": "0.3.8", + "version": "0.3.9", "source": { "type": "git", "url": "https://dev.leenooks.net/leenooks/laravel", - "reference": "70a714287706fbde3f2043315f939a8e98e2d9c4" + "reference": "6d876f2c946f5b182e4efe6c8f89038385818ea1" }, "require": { "acacha/user": "^0.2.2", @@ -2399,7 +2399,7 @@ "laravel", "leenooks" ], - "time": "2019-05-16T01:15:49+00:00" + "time": "2019-06-17T01:44:56+00:00" }, { "name": "maximebf/debugbar", diff --git a/resources/theme/frontend/metronic/order.blade.php b/resources/theme/frontend/metronic/order.blade.php index f09770b..2229619 100644 --- a/resources/theme/frontend/metronic/order.blade.php +++ b/resources/theme/frontend/metronic/order.blade.php @@ -55,8 +55,8 @@ {{ $errors->first('account_id') }} @@ -111,8 +111,8 @@ {{ $errors->first('account_id') }} @@ -237,14 +237,10 @@
-
- {{ $errors->first('product_options') }} -
- -
- - - {{ $errors->first('order_notes') }} +
+ + + {{ $errors->first('options.notes') }}
diff --git a/resources/views/email/admin/order/approve.blade.php b/resources/views/email/admin/order/approve.blade.php index 1cc1c78..c8672af 100644 --- a/resources/views/email/admin/order/approve.blade.php +++ b/resources/views/email/admin/order/approve.blade.php @@ -9,12 +9,12 @@ | Account | {{ $service->account_name }} ({!! $service->account->account_id_url !!}) | | Service ID | {!! $service->service_id_url !!} | | Product | {{ $service->product_name }} | - @switch($service->category) + @switch($service->product_category) @case('ADSL') - | Address | {{ $service->service_adsl->service_address }} | + | Address | {{ $service->type->service_address }} | @break; @case('VOIP') - | Address | {{ $service->service_voip->service_address }} | + | Number | {{ $service->type->service_number }} | | Supplier Details | {{ join(':',$service->order_info) }} | @break; @endswitch