Fixes for supplier configuration product links
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 42s
Create Docker Image / Final Docker Image Manifest (push) Successful in 9s

This commit is contained in:
Deon George 2025-05-18 21:29:32 +10:00
parent 7fd1ce9584
commit 4ddbb14d09
4 changed files with 6 additions and 6 deletions

View File

@ -1,6 +1,5 @@
<!-- $o=Product::class -->
@use(App\Models\Product)
<div class="card card-dark">
<div class="card-header">
<h1 class="card-title">Product Configuration</h1>
@ -12,7 +11,7 @@
<div class="row">
<div class="col-12 col-sm-9 col-md-6 col-xl-5">
<x-leenooks::form.select name="product_id" icon="fa-list" label="Product" choose="true" groupby="active" :value="$po?->id ?? ''" :options="Product::get()->sortBy(fn($item)=>($item->active ? '0' : '1').$item->name)->map(fn($item)=>['id'=>$item->id,'value'=>$item->name,'active'=>$item->active])"/>
<x-leenooks::form.select name="product_id" icon="fa-list" label="Product" choose="true" groupby="active" :value="$pdo?->id ?? ''" :options="Product::get()->sortBy(fn($item)=>($item->active ? '0' : '1').$item->name)->map(fn($item)=>['id'=>$item->id,'value'=>$item->name,'active'=>$item->active])"/>
</div>
</div>
</form>

View File

@ -99,7 +99,7 @@ if(isset($spo)) {
@foreach ($oo->products as $pto)
@foreach ($pto->products as $po)
<tr>
<td>{{ $po->id }}</td>
<td><a href="{{ route('product',['pdo'=>$po->id]) }}">{{ $po->id }}</a></td>
<td>{{ $po->name }}</td>
<td class="text-right">{{ $po->services->where('active',true)->count() }}</td>
<td class="text-right">{{ $po->services->count() }}</td>

View File

@ -39,8 +39,8 @@
@foreach($xx=$offering->items->with(['products.products.services','products.products.type.supplied.supplier_detail','products.products.translate'])->get() as $oo)
@foreach($oo->products->pluck('products')->flatten()->filter() as $po)
<tr>
<td><a href="{{ url('a/supplier/product',[$po->supplier->id,$po->supplied->id,$po->supplied->category]) }}">{{ $po->lid }}</a></td>
<td>{{ $po->pid }}</td>
<td><a href="{{ route('product',['pdo'=>$po->id]) }}">{{ $po->lid }}</a></td>
<td>{{ $po->pid }} <small>[<a href="{{ route('supplier.product.type',['id'=>$po->supplied->id,'spo'=>$po->supplier->id,'type'=>$po->supplied->category]) }}">{{ $po->supplied->name }}</a>]</small></td>
<td>{{ $po->name }}</td>
<td class="text-right">{{ $po->active ? 'YES' : 'NO' }}</td>
<td class="text-right">{{ $po->billing_interval_string }}</td>

View File

@ -106,7 +106,8 @@ Route::group(['middleware'=>['auth','role:wholesaler'],'prefix'=>'a'],function()
// Product Setup
Route::view('product','theme.backend.adminlte.product.home');
Route::view('product/{pdo}','theme.backend.adminlte.product.details',['breadcrumb'=>['Products'=>'a/product']])
->where('pdo','[0-9]+');
->where('pdo','[0-9]+')
->name('product');
Route::post('product/{o?}',[ProductController::class,'addedit'])
->where('o','[0-9]+');