Add product selection to service update
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<!-- $o=Service::class -->
|
||||
@use(App\Models\Invoice)
|
||||
@use(App\Models\Product)
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@@ -43,6 +44,24 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<!-- PRODUCT -->
|
||||
<x-leenooks::form.select name="product_id" icon="fa-list" label="Product" :helper="$o->product->category_name"
|
||||
:value="$o->product_id"
|
||||
:options="Product::get()
|
||||
->filter(fn($item)=>($item->category === $o->product->category))
|
||||
->sortBy('name')
|
||||
->map(fn($item)=>[
|
||||
'id'=>$item->id,
|
||||
'value'=>sprintf('%s $%3.2f [%s/%3.2f]',
|
||||
$item->name,
|
||||
$o->account->taxed($item->base_charge)*Invoice::billing_change($item->billing_interval,Invoice::BILL_MONTHLY),
|
||||
$item->supplied->name,
|
||||
$o->account->taxed($item->base_cost)*Invoice::billing_change($item->billing_interval,Invoice::BILL_MONTHLY),
|
||||
)])" :required="true"/>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@includeIf('theme.backend.adminlte.service.widget.'.$o->product->category.'.update',['o'=>$o->type])
|
||||
|
Reference in New Issue
Block a user