WIP: Fix invoice_next_at date on service update for broadband - must do the others, and create a service validator
This commit is contained in:
parent
3cae12b256
commit
5b4aa5c73e
@ -405,7 +405,7 @@ class ServiceController extends Controller
|
|||||||
->withInput();
|
->withInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
$o->type->forceFill(Arr::except($x,['start_at']));
|
$o->type->forceFill($validator->validated());
|
||||||
|
|
||||||
} elseif ($request->post($o->product->category)) {
|
} elseif ($request->post($o->product->category)) {
|
||||||
$o->type->forceFill($request->post($o->product->category));
|
$o->type->forceFill($request->post($o->product->category));
|
||||||
@ -413,6 +413,10 @@ class ServiceController extends Controller
|
|||||||
|
|
||||||
$o->type->save();
|
$o->type->save();
|
||||||
|
|
||||||
|
// @todo create a validator for service
|
||||||
|
if ($request->post('invoice_next_at'))
|
||||||
|
$o->invoice_next_at = $request->invoice_next_at;
|
||||||
|
|
||||||
// Also update our service start_at date.
|
// Also update our service start_at date.
|
||||||
if ($request->post('start_at'))
|
if ($request->post('start_at'))
|
||||||
$o->start_at = $request->start_at;
|
$o->start_at = $request->start_at;
|
||||||
|
@ -53,10 +53,10 @@
|
|||||||
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
||||||
@include('adminlte::widget.form_date',[
|
@include('adminlte::widget.form_date',[
|
||||||
'label'=>'Billing Start Date',
|
'label'=>'Billing Start Date',
|
||||||
'id'=>'start_at',
|
'id'=>'invoice_next_at',
|
||||||
'old'=>'broadband.start_at',
|
'old'=>'invoice_next_at',
|
||||||
'name'=>'broadband[start_at]',
|
'name'=>'invoice_next_at',
|
||||||
'value'=>$o->start_at ? $o->start_at->format('Y-m-d') : ($o->connect_at ? $o->connect_at->format('Y-m-d') : ''),
|
'value'=>$o->service->invoice_next_at ? $o->service->invoice_next_at->format('Y-m-d') : ($o->connect_at ? $o->connect_at->format('Y-m-d') : ''),
|
||||||
])
|
])
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user