Add relations in tables, add saving states for datatables, minor fixes

This commit is contained in:
Ludovic CANDELLIER
2021-09-14 23:14:03 +02:00
parent 1dcc3e34a9
commit ffb9f81353
16 changed files with 255 additions and 47 deletions

View File

@@ -0,0 +1,29 @@
@if (count($generic['prices'] ?? []))
<table class="table table-bordered table-hover table-striped w-100 mb-0 dataTable">
<input type="hidden" name="price_generics[0]" value="{{ $generic['id'] }}">
<thead>
<th>
<button type="button" class="btn btn-xs btn-danger delete-generic-price-btn mt-2" data-card-widget="collapse" data-toggle="tooltip" title="supprimer" data-id="{{ $generic['id'] }}">
<i class="fas fa-trash"></i>
</button>
{{ $generic['category']['name'] ?? null }}
</th>
@foreach ($generic['prices'] as $price)
<th>
{{ $price['quantity'] ?? null }} {{ $price['unity_id'] ?? null }}
</th>
@endforeach
</thead>
<tr>
<td>
{{ $generic['name'] ?? null }}
</td>
@foreach ($generic['prices'] as $price)
<td>
{{ $price['price_taxed'] ?? null }}
</td>
@endforeach
</tr>
</table>
@endif

View File

@@ -11,7 +11,7 @@
</div>
<div class="col-4">
{{ Form::label('unity_id', 'Unité') }}
@include('components.select', ['name' => 'unity_id', 'list' => $unities ?? [], 'value' => $variation['unity_id'] ?? false, 'required' => true, 'with_empty' => ''])
@include('components.select', ['name' => 'unity_id', 'list' => $unities ?? [], 'value' => $variation['unity_id'] ?? false, 'required' => false, 'with_empty' => ''])
</div>
</div>
</div>