Fix broadband plan change update
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
<!-- $o = App\Models\Service::class -->
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-8">
|
||||
<div class="col-4">
|
||||
<form role="form" method="POST" enctype="multipart/form-data">
|
||||
<div class="card card-dark">
|
||||
{{ csrf_field() }}
|
||||
@@ -55,8 +55,8 @@
|
||||
<select class="form-control @error('broadband.product_id') is-invalid @enderror" id="product_id" name="broadband[product_id]" required>
|
||||
<!-- @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 !== $o->product->category) @continue @endif
|
||||
<option value="{{ $po->id }}" {{ $po->id == old('broadband.product_id',$po->exists ? \Illuminate\Support\Arr::get($o->order_info,'change_product_id') : NULL) ? 'selected' : '' }}>{{ $po->name }}</option>
|
||||
@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>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@@ -112,6 +112,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-6">
|
||||
<!-- NEW PRICE -->
|
||||
<div class="form-group has-validation">
|
||||
<label for="price" class="col-form-label text-right">New Price <small>(Override)</small></label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-fw fa-dollar-sign"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control @error('broadband.price_override') is-invalid @enderror" id="price" name="broadband[price]" value="{{ $o->price }}">
|
||||
<span class="invalid-feedback" role="alert">
|
||||
@error('broadband.price')
|
||||
{{ $message }}
|
||||
@enderror
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@@ -126,8 +144,31 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Current Plan -->
|
||||
<div class="col-4">
|
||||
@include('service.widget.internal')
|
||||
<div class="card card-dark">
|
||||
<div class="card-body">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Current Plan</h3>
|
||||
</div>
|
||||
|
||||
@include('service.widget.internal',['o'=>$o,'p'=>$o->product])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Proposed Plan -->
|
||||
<div class="col-4">
|
||||
<div class="card card-dark">
|
||||
<div class="card-body">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Proposed Plan</h3>
|
||||
</div>
|
||||
|
||||
@include('service.widget.internal',['o'=>$o,'p'=>\App\Models\Product::where('id',Arr::get($o->order_info,'change_product_id'))->singleOrFail()])
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="transactions"></div>
|
||||
|
Reference in New Issue
Block a user