Reimplmement service changes going to the service__change table
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
{{ $o->sid }}
|
||||
@endsection
|
||||
|
||||
<!-- $o = App\Models\Service::class -->
|
||||
<!-- $o = Service::class, $np = Product::class -->
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-12 col-lg-4">
|
||||
@@ -56,7 +56,7 @@
|
||||
<!-- @todo TO DO LIMIT THIS TO OF THE SAME OFFERING TYPE AND SORT BY NAME -->
|
||||
@foreach (\App\Models\Product::get() as $po)
|
||||
@if (! $po->category || ($po->category !== $o->product->category)) @continue @endif
|
||||
<option value="{{ $po->id }}" {{ $po->id == old('broadband.product_id',$po->exists ? Arr::get($o->order_info,'change_product_id') : NULL) ? 'selected' : '' }}>{{ $po->name }}</option>
|
||||
<option value="{{ $po->id }}" {{ $po->id == old('broadband.product_id',$np->id) ? 'selected' : '' }}>{{ $po->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -81,7 +81,7 @@
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-calendar"></i></span>
|
||||
</div>
|
||||
<input type="date" class="form-control @error('broadband.start_at') is-invalid @enderror" id="start_at" name="broadband[start_at]" value="{{ \Illuminate\Support\Arr::get($o->order_info,'change_date') ?? '' }}" required>
|
||||
<input type="date" class="form-control @error('broadband.start_at') is-invalid @enderror" id="start_at" name="broadband[start_at]" value="{{ $np->pivot->effective_at ?? $np->pivot->ordered_at }}" required>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('broadband.start_at')
|
||||
{{ $message }}
|
||||
@@ -153,7 +153,7 @@
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
@include('service.widget.internal',['o'=>$o,'p'=>\App\Models\Product::where('id',Arr::get($o->order_info,'change_product_id'))->singleOrFail()])
|
||||
@include('service.widget.internal',['o'=>$o,'p'=>$np])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -170,13 +170,14 @@
|
||||
var pid = $('#product_id').val();
|
||||
var start = $('#start_at').val();
|
||||
var fee = $('#change_fee').val();
|
||||
var price = $('#price').val();
|
||||
|
||||
$("div[id=transactions]").empty();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'html',
|
||||
data: {broadband: {product_id: pid,start_at: start,change_fee: fee}},
|
||||
data: {broadband: {product_id: pid,start_at: start,change_fee: fee,price: price}},
|
||||
cache: false,
|
||||
url: '{{ url('r/service_change_charges',[$o->id]) }}',
|
||||
timeout: 2000,
|
||||
@@ -205,6 +206,10 @@
|
||||
pendingtrans();
|
||||
});
|
||||
|
||||
$('#price').on('change',function() {
|
||||
pendingtrans();
|
||||
});
|
||||
|
||||
pendingtrans();
|
||||
});
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user