gruene-seele/resources/views/admin/product/index.blade.php
Kevin Adametz 3ee2d756e9 Warenwirtschaft: AP-09 bis AP-13 (Produktbestand, Set-Produkte, Ausschuss, Konzepte)
- AP-09 Produktbestand inkl. Bewegungshistorie (product_stock_movements, ProductStockService)
- AP-10 Rohstoffbestand-Ansicht je Lager (RawMaterialStockController)
- AP-11 Bestandsschwellen / Out-of-Stock-Handling fuer Produkte und Shop
- AP-12 Ausgang/Ausschuss (stock_disposals, StockDisposalController, InventoryService)
- Set-Produkte (product_set_items) inkl. Aufloesung
- Produktentwicklung & Hinweise-Verwaltung (Notices)
- AP-13 Entwicklungskonzept Shop-Bestandsabzug im Plan dokumentiert
- Feature-Tests fuer neue Module + aktualisierter Entwicklungsplan

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-03 11:04:22 +00:00

134 lines
7 KiB
PHP
Executable file

@extends('layouts.layout-2')
@section('content')
<div class="card">
<h6 class="card-header">
{{ __('Produkte') }}
<label class="custom-control custom-checkbox float-right mb-0">
<input type="checkbox" class="custom-control-input show-active-products" name="show_active_products"
@if (get_user_attr('show_active_products') === 'true') checked @endif>
<span class="custom-control-label font-style-normal font-weight-normal">nur aktive anzeigen</span>
</label>
</h6>
<div class="card-datatable table-responsive">
<table class="datatables-product table table-striped table-bordered">
<thead>
<tr>
<th style="max-width: 60px;">&nbsp;</th>
<th>{{ __('Pos') }}</th>
<th>{{ __('Bild') }}</th>
<th>{{ __('Name') }}</th>
<th>{{ __('Artikelnummer') }}</th>
<th>{{ __('Kategorie') }}</th>
<th>{{ __('Preis') }}</th>
<th>{{ __('Inhalt') }}</th>
<th>{{ __('Einheit') }}</th>
<th>{{ __('Grundpreis') }}</th>
<th>{{ __('Gewicht') }}</th>
<th>{{ __('Verfügbarkeit') }}</th>
<th>{{ __('sichbar') }}</th>
<th>
<div data-toggle="tooltip" title data-original-title="White Label">{{ __('WL') }}</div>
</th>
<th>
<div data-toggle="tooltip" title data-original-title="Kompensationsprodukt">{{ __('KP') }}
</div>
</th>
<th>
<div data-toggle="tooltip" title data-original-title="Maximaler Kauf pro Berater">
{{ __('MK') }}</div>
</th>
<th>
<div data-toggle="tooltip" title data-original-title="Einzelrabatt">{{ __('ER') }}</div>
</th>
<th>
<div data-toggle="tooltip" title data-original-title="Auswertung Absatzmengen ausschließen ">
{{ __('AA') }}</div>
</th>
<th>{{ __('Status') }}</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($values as $value)
<tr>
<td>
<a href="{{ route('admin_product_edit', [$value->id]) }}"
class="btn icon-btn btn-sm btn-primary">
<span class="far fa-edit"></span>
</a>
</td>
<td>{{ $value->pos }}</td>
<td>
@if (count($value->images))
<img class="img-fluid" alt="" style="max-height: 80px"
src="{{ route('product_image', [$value->images->first()->slug]) }}">
@endif
</td>
<td>{{ $value->name }}</td>
<td>{{ $value->number }}</td>
<td>
@foreach ($value->categories as $category)
<div style="white-space: nowrap">{{ $category->category->name }}</div>
@endforeach
</td>
<td>{{ $value->getFormattedPrice() }}</td>
<td>{{ $value->contents_total }}</td>
<td>{{ $value->getUnitType() }}</td>
<td>{{ $value->getBasePriceFormatted() }}</td>
<td>{{ $value->weight }}</td>
<td data-sort="{{ $value->isOutOfStock() ? 1 : 0 }}">
@if ($value->isOutOfStock())
<span class="badge badge-danger"
style="white-space: normal;">{{ $value->outOfStockNotice() }}</span>
@else
<span class="text-muted small">{{ __('vorrätig') }}</span>
@endif
</td>
<td>{!! $value->getShowOnTypes('<br>') !!}</td>
<td data-sort="{{ $value->whitelabel }}">{!! get_active_badge($value->whitelabel, $value->whitelabel_name) !!}</td>
<td data-sort="{{ $value->shipping_addon }}">{!! get_active_badge($value->shipping_addon) !!}</td>
<td data-sort="{{ $value->max_buy }}">{!! get_active_badge($value->max_buy) !!}</td>
<td data-sort="{{ $value->single_commission }}">{!! get_active_badge($value->single_commission) !!}</td>
<td data-sort="{{ $value->exclude_stats_sales }}">{!! get_active_badge($value->exclude_stats_sales) !!}</td>
<td data-sort="{{ $value->active }}">{!! get_active_badge($value->active) !!}</td>
<td><a class="text-info" href="{{ route('admin_product_copy', [$value->id]) }}"
onclick="return confirm('{{ __('Eintrag kopieren?') }}');"><i
class="far fa-copy"></i></a> &nbsp;
<a class="text-danger" href="{{ route('admin_product_delete', [$value->id]) }}"
onclick="return confirm('{{ __('Really delete entry?') }}');"><i
class="far fa-trash-alt"></i></a>
</td>
</tr>
@endforeach
</tbody>
</table>
<div class="mt-4 ml-4">
<a href="{{ route('admin_product_edit', ['new']) }}" class="btn btn-sm btn-primary">
{{ __('Neues Produkt erstellen') }}
</a>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('.datatables-product').dataTable({
"bLengthChange": false,
"iDisplayLength": 50,
"language": {
"url": "/js/German.json"
}
});
$('.show-active-products').on('change', function() {
console.log($(this));
console.log($(this).prop('checked'));
document.location.search = $(this).attr('name') + "=" + $(this).prop('checked');
// window.location.reload(true);
})
});
</script>
@endsection