2024-07-24 04:14:11 +00:00
|
|
|
<!-- $o=Service::class -->
|
|
|
|
@use(App\Models\Invoice)
|
|
|
|
|
2021-07-13 02:31:56 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-12">
|
2024-07-24 04:14:11 +00:00
|
|
|
<h4>Update Service details <x-leenooks::button.success class="float-right"/></h4>
|
|
|
|
<hr>
|
2022-08-01 10:34:10 +00:00
|
|
|
|
2024-07-24 04:14:11 +00:00
|
|
|
<form method="POST" action="{{ url('a/service/update',[$o->id]) }}">
|
2021-07-13 02:31:56 +00:00
|
|
|
@csrf
|
|
|
|
|
2022-10-18 06:24:53 +00:00
|
|
|
<div class="row">
|
|
|
|
<!-- External Billing -->
|
|
|
|
<div class="col-2">
|
2024-07-24 04:14:11 +00:00
|
|
|
<x-leenooks::form.toggle id="external_billing" name="external_billing" label="External Billing" :value="$o->external_billing"/>
|
|
|
|
<x-leenooks::form.toggle id="suspend_billing" name="suspend_billing" label="Suspend Billing" :value="$o->suspend_billing"/>
|
2022-10-18 06:24:53 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="col-1"></div>
|
|
|
|
|
|
|
|
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
2024-07-24 05:31:57 +00:00
|
|
|
<x-leenooks::form.date id="invoice_next_at" name="invoice_next_at" icon="fa-calendar" label="Billing Start Date" :value="($o->getRawOriginal('invoice_next_at') ?: $o->getRawOriginal('connect_at'))"/>
|
2022-10-18 06:24:53 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<!-- Price -->
|
|
|
|
<div class="col-12 col-sm-9 col-md-12 col-xl-3">
|
2024-07-24 04:14:11 +00:00
|
|
|
<x-leenooks::form.text name="price" icon="fa-dollar-sign" label="Price" :value="$o->price"/>
|
2022-10-18 06:24:53 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-3"></div>
|
|
|
|
|
|
|
|
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
|
2024-07-24 04:14:11 +00:00
|
|
|
<x-leenooks::form.select id="recur_schedule" name="recur_schedule" icon="fa-redo" label="Renew Term" :value="$o->recur_schedule" :options="collect(Invoice::billing_periods)->map(fn($item,$key)=>['id'=>$key,'value'=>$item['name']])"/>
|
2022-10-18 06:24:53 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
|
2024-07-04 05:03:11 +00:00
|
|
|
@includeIf('theme.backend.adminlte.service.widget.'.$o->product->category.'.update',['o'=>$o->type])
|
2021-07-13 02:31:56 +00:00
|
|
|
|
|
|
|
<div class="row">
|
2024-07-24 04:14:11 +00:00
|
|
|
<div class="col">
|
2021-07-13 02:31:56 +00:00
|
|
|
@can('wholesaler')
|
2024-07-24 04:14:11 +00:00
|
|
|
<x-leenooks::button.reset/>
|
|
|
|
<x-leenooks::button.submit class="float-right">Save</x-leenooks::button.submit>
|
2021-07-13 02:31:56 +00:00
|
|
|
@endcan
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2024-07-24 04:14:11 +00:00
|
|
|
|
|
|
|
@section('page-scripts')
|
|
|
|
<script type="text/javascript">
|
|
|
|
function toggle_billing_external(item) {
|
|
|
|
if (item.is(':checked')) {
|
|
|
|
$('#suspend_billing').closest('.form-group').addClass('d-none');
|
|
|
|
$('#invoice_next_at').closest('.form-group').parent().addClass('d-none');
|
|
|
|
$('#price').closest('.form-group').parent().addClass('d-none');
|
|
|
|
$('#recur_schedule').closest('.form-group').parent().addClass('d-none');
|
|
|
|
|
|
|
|
item.closest('.form-group').addClass('mb-0');
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$('#suspend_billing').closest('.form-group').removeClass('d-none');
|
|
|
|
$('#invoice_next_at').closest('.form-group').parent().removeClass('d-none');
|
|
|
|
$('#price').closest('.form-group').parent().removeClass('d-none');
|
|
|
|
$('#recur_schedule').closest('.form-group').parent().removeClass('d-none');
|
|
|
|
|
|
|
|
item.closest('.form-group').removeClass('mb-0');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function toggle_billing_suspend(item) {
|
|
|
|
if (item.is(':checked')) {
|
|
|
|
$('#invoice_next_at').prop('readonly',true);
|
|
|
|
$('#price').prop('readonly',true);
|
|
|
|
|
|
|
|
recur_schedule_readonly(true);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
$('#invoice_next_at').prop('readonly',false);
|
|
|
|
$('#price').prop('readonly',false);
|
|
|
|
|
|
|
|
recur_schedule_readonly(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
toggle_billing_external($('#external_billing'));
|
|
|
|
toggle_billing_suspend($('#suspend_billing'));
|
|
|
|
|
|
|
|
$('#external_billing').on('click',function(item) {
|
|
|
|
toggle_billing_external($(this));
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#suspend_billing').on('click',function(item) {
|
|
|
|
toggle_billing_suspend($(this));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|