Enable editing of address for phone/broadband, fix billing start for phone

This commit is contained in:
Deon George 2022-09-29 17:45:43 +10:00
parent ec99a5ff75
commit 15a3b11d2e
6 changed files with 34 additions and 10 deletions

View File

@ -93,6 +93,7 @@ class Broadband extends Type implements ServiceUsage
{ {
return [ return [
'service_number' => 'nullable|string|min:10|max:10', 'service_number' => 'nullable|string|min:10|max:10',
'service_address' => 'nullable|string|min:3',
'service_username' => 'nullable|string', 'service_username' => 'nullable|string',
'service_password' => 'nullable|string', 'service_password' => 'nullable|string',
'connect_at' => 'nullable|date', 'connect_at' => 'nullable|date',

View File

@ -60,6 +60,7 @@ class Phone extends Type
{ {
return [ return [
'service_number' => 'nullable|string|min:10|max:10', 'service_number' => 'nullable|string|min:10|max:10',
'service_address' => 'nullable|string|min:3',
'service_username' => 'nullable|string', 'service_username' => 'nullable|string',
'service_password' => 'nullable|string', 'service_password' => 'nullable|string',
'connect_at' => 'nullable|date', 'connect_at' => 'nullable|date',

View File

@ -10,6 +10,17 @@
'value'=>$o->service_number ?? '', 'value'=>$o->service_number ?? '',
]) ])
</div> </div>
<div class="col-12 col-sm-9 col-md-6 col-xl-7">
@include('adminlte::widget.form_text',[
'label'=>'Service Address',
'icon'=>'fas fa-map',
'id'=>'service_address',
'old'=>'broadband.service_address',
'name'=>'broadband[service_address]',
'value'=>$o->service_address ?? '',
])
</div>
</div> </div>
<div class="row"> <div class="row">
@ -18,7 +29,7 @@
'label'=>'Service Username', 'label'=>'Service Username',
'icon'=>'fas fa-user', 'icon'=>'fas fa-user',
'id'=>'service_username', 'id'=>'service_username',
'old'=>'broadband.service_username', 'old'=>'broadband.service_username',
'name'=>'broadband[service_username]', 'name'=>'broadband[service_username]',
'value'=>$o->service_username ?? '', 'value'=>$o->service_username ?? '',
]) ])

View File

@ -52,7 +52,7 @@
'id'=>'domain_registrar_id', 'id'=>'domain_registrar_id',
'old'=>'domain.domain_registrar_id', 'old'=>'domain.domain_registrar_id',
'name'=>'domain[domain_registrar_id]', 'name'=>'domain[domain_registrar_id]',
'options'=>\App\Models\DomainRegistrar::active()->orderBy('name')->get()->transform(function($item) { return ['id'=>$item->id,'value'=>$item->name]; }), 'options'=>\App\Models\DomainRegistrar::active()->orderBy('name')->get()->transform(function($item) { return ['id'=>$item->id,'value'=>$item->name]; }),
'value'=>$o->domain_registrar_id ?? '', 'value'=>$o->domain_registrar_id ?? '',
]) ])
</div> </div>
@ -77,7 +77,7 @@
'id'=>'registrar_ns', 'id'=>'registrar_ns',
'old'=>'domain.registrar_ns', 'old'=>'domain.registrar_ns',
'name'=>'domain[registrar_ns]', 'name'=>'domain[registrar_ns]',
'options'=>\App\Models\Service\Domain::select('registrar_ns')->distinct()->orderBy('registrar_ns')->get()->transform(function($item) { return ['id'=>$item->registrar_ns,'value'=>$item->registrar_ns]; }), 'options'=>\App\Models\Service\Domain::select('registrar_ns')->distinct()->orderBy('registrar_ns')->get()->transform(function($item) { return ['id'=>$item->registrar_ns,'value'=>$item->registrar_ns]; }),
'value'=>$o->registrar_ns ?? '', 'value'=>$o->registrar_ns ?? '',
'addvalues'=>TRUE, 'addvalues'=>TRUE,
]) ])
@ -88,7 +88,7 @@
'label'=>'Registrar Username', 'label'=>'Registrar Username',
'icon'=>'fas fa-user', 'icon'=>'fas fa-user',
'id'=>'registrar_username', 'id'=>'registrar_username',
'old'=>'domain.registrar_username', 'old'=>'domain.registrar_username',
'name'=>'domain[registrar_username]', 'name'=>'domain[registrar_username]',
'value'=>$o->registrar_username ?? '', 'value'=>$o->registrar_username ?? '',
]) ])

View File

@ -65,7 +65,7 @@
'label'=>'Admin User', 'label'=>'Admin User',
'icon'=>'fas fa-user', 'icon'=>'fas fa-user',
'id'=>'host_username', 'id'=>'host_username',
'old'=>'host.host_username', 'old'=>'host.host_username',
'name'=>'host[host_username]', 'name'=>'host[host_username]',
'value'=>$o->host_username ?? '', 'value'=>$o->host_username ?? '',
]) ])

View File

@ -10,6 +10,17 @@
'value'=>$o->service_number ?? '', 'value'=>$o->service_number ?? '',
]) ])
</div> </div>
<div class="col-12 col-sm-9 col-md-6 col-xl-7">
@include('adminlte::widget.form_text',[
'label'=>'Service Address',
'icon'=>'fas fa-map',
'id'=>'service_address',
'old'=>'phone.service_address',
'name'=>'phone[service_address]',
'value'=>$o->service_address ?? '',
])
</div>
</div> </div>
<div class="row"> <div class="row">
@ -18,7 +29,7 @@
'label'=>'Service Username', 'label'=>'Service Username',
'icon'=>'fas fa-user', 'icon'=>'fas fa-user',
'id'=>'service_username', 'id'=>'service_username',
'old'=>'phone.service_username', 'old'=>'phone.service_username',
'name'=>'phone[service_username]', 'name'=>'phone[service_username]',
'value'=>$o->service_username ?? '', 'value'=>$o->service_username ?? '',
]) ])
@ -53,10 +64,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'=>'phone.start_at', 'old'=>'invoice_next_at',
'name'=>'phone[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>