2024-08-24 07:37:55 +00:00
|
|
|
<!-- $spo=Supplier::class -->
|
|
|
|
@use(App\Models\Cost)
|
|
|
|
|
2022-06-28 13:20:56 +00:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-4">
|
2024-08-24 07:37:55 +00:00
|
|
|
<x-leenooks::form.select name="cost_id" icon="fa-list" label="Supplier Invoice" helper="Supplier invoice" addnew="Add New" :options="Cost::where('supplier_id',$spo->id)->orderBy('billed_at','DESC')->get()->map(fn($item,$key)=>['id'=>$item->id,'value'=>sprintf('%s: $%s',$item->billed_at->format('Y-m-d'),number_format($item->total,2))])"/>
|
2022-06-28 13:20:56 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
@section('page-scripts')
|
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#cost_id')
|
|
|
|
.on('change',function(item) {
|
2024-08-24 07:37:55 +00:00
|
|
|
window.location.href = '{{ url('a/supplier/cost') }}/'+(item.target.value !== 'new' ? item.target.value : 'new/'+{{ $spo->id }});
|
2022-06-28 13:20:56 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@append
|