2022-06-28 13:20:56 +00:00
|
|
|
<!-- $o = Supplier::class -->
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-4">
|
|
|
|
<div class="form-group has-validation">
|
|
|
|
<label for="cost_id">Supplier Invoice</label>
|
|
|
|
<select class="form-control form-control-border" id="cost_id" name="cost_id">
|
|
|
|
<option value=""></option>
|
|
|
|
<option value="">Add New</option>
|
2022-06-30 13:51:20 +00:00
|
|
|
@foreach(\App\Models\Cost::where('supplier_id',$o->id)->orderBy('billed_at','DESC')->get() as $oo)
|
2022-06-28 13:20:56 +00:00
|
|
|
<option value="{{ $oo->id }}">{{ $oo->billed_at->format('Y-m-d') }}: ${{ number_format($oo->total,2) }}</option>
|
|
|
|
@endforeach
|
|
|
|
</select>
|
|
|
|
<span class="invalid-feedback" role="alert">
|
|
|
|
@error('name')
|
|
|
|
{{ $message }}
|
|
|
|
@else
|
|
|
|
Date is required.
|
|
|
|
@enderror
|
|
|
|
</span>
|
|
|
|
<span class="input-helper">Suppliers Invoice</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@section('page-scripts')
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#cost_id')
|
|
|
|
.on('change',function(item) {
|
|
|
|
window.location.href = '{{ url('a/supplier/cost') }}'+(item.target.value ? '/'+item.target.value : '');
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|