diff --git a/app/Http/Controllers/ServiceController.php b/app/Http/Controllers/ServiceController.php index cb316d7..7134721 100644 --- a/app/Http/Controllers/ServiceController.php +++ b/app/Http/Controllers/ServiceController.php @@ -412,6 +412,7 @@ class ServiceController extends Controller 'suspend_billing' => 'nullable|in:on', 'recur_schedule' => ['required',Rule::in(collect(Invoice::billing_periods)->keys())], 'invoice_next_at' => 'nullable|date', + 'product_id'=>'required|exists:products,id', 'price' => 'nullable|numeric|min:0', // Price we charge the client, if we dont charge supplied/price 'cost' => 'nullable|numeric|min:0', // Price we are charged by supplier, if we arent charged supplier/price 'supplierid' => 'nullable|string|min:1', // As used on invoices @@ -460,6 +461,7 @@ class ServiceController extends Controller $o->price = $validated->get('price'); $o->cost = $validated->get('cost'); $o->supplierid = $validated->get('supplierid'); + $o->product_id = $validated->get('product_id'); // Also update our service start_at date. // @todo We may want to make start_at/stop_at dynamic values calculated by the type records diff --git a/resources/views/theme/backend/adminlte/service/widget/update.blade.php b/resources/views/theme/backend/adminlte/service/widget/update.blade.php index b8aa960..a1220ee 100644 --- a/resources/views/theme/backend/adminlte/service/widget/update.blade.php +++ b/resources/views/theme/backend/adminlte/service/widget/update.blade.php @@ -1,5 +1,6 @@ @use(App\Models\Invoice) +@use(App\Models\Product)
@@ -43,6 +44,24 @@
+
+
+ + +
+

@includeIf('theme.backend.adminlte.service.widget.'.$o->product->category.'.update',['o'=>$o->type])