White Label WL-02: verbindliche Tiegelfarbe, Etikettposition und gemeinsamer Resolver

- products.whitelabel_variant_id, product_images.position/size_cm mit Backfill aus Produktnamen
- WhiteLabelResolver: Farbe vom Produkt, Kundenlogo je Position, Fehler statt stillem Rückfall; Altlogik für Produkte ohne Variante
- Attribute: Variantenwert-Parsing und Farbname ohne Größe
- Produkt- und Kundenformular um Variante, Position und Größe ergänzt
- Lieferschein noch nicht umgestellt (WL-03, wartet auf K6/K7)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Kevin Adametz 2026-09-17 12:33:44 +00:00
parent 0dc3dea85e
commit cff749b133
14 changed files with 1159 additions and 280 deletions

View file

@ -43,7 +43,10 @@
<div class="float-right">
<a href="{{ route('admin_lead_remove', ['remove_whitelabel_product', $user->id, $wlp->id]) }}?show={{ $show }}" class="btn btn-sm btn-danger mt-2 mb-2" onclick="return confirm('Produkt wirklich entfernen?');">Produkt entfernen</a>
</div>
<h4>{{ $wlp->product->getWhiteLableName() }}</h4>
<h4>{{ $wlp->product->name }} <small class="text-muted">{{ $wlp->product->wp_number }}</small></h4>
@if($wlp->product->whitelabel_variant)
<div class="mb-2"><span class="badge badge-dark">Tiegel: {{ $wlp->product->whitelabel_variant->colorName() }}</span> <small class="text-muted">Farbe kommt vom Produkt; das Logo wird an seiner Position eingesetzt.</small></div>
@endif
</div>
@ -60,6 +63,16 @@
<select class="selectpicker" name="image_wl_attributes[{{ $wlp_image->id }}][]" id="image_wl_attributes_{{ $wlp_image->id }}" data-style="btn-light" data-live-search="true" multiple>
{!! HTMLHelper::getProductAttributesOptions($wlp->product->attribute_variants, $wlp_image->attributes, false, 1) !!}
</select>
<div class="form-row mt-2">
<div class="form-group col-md-4">
<label class="form-label" for="image_wl_position_{{ $wlp_image->id }}">Etikettposition</label>
<select class="form-control" name="image_wl_position[{{ $wlp_image->id }}]" id="image_wl_position_{{ $wlp_image->id }}">
@foreach (\App\Models\ProductImage::POSITIONS as $key => $label)
<option value="{{ $key }}" {{ ($wlp_image->position ?: 'deckel') === $key ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
</div>
</div>
<a href="{{ route('admin_lead_remove', ['remove_whitelabel_label', $user->id, $wlp->id, $wlp_image->id]) }}?show={{ $show }}" class="btn btn-sm btn-danger mt-2 mb-2" onclick="return confirm('Etikett wirklich löschen?');">Etikett löschen</a>
</div>
@endforeach

View file

@ -465,6 +465,15 @@
<label class="form-label" for="whitelabel_name">{{ __('White-Label Bezeichnung') }}</label>
{{ Form::text('whitelabel_name', $product->whitelabel_name, ['placeholder' => __('Bezeichnung'), 'class' => 'form-control', 'id' => 'whitelabel_name']) }}
</div>
<div class="form-group col-md-6">
<label class="form-label" for="whitelabel_variant_id">Tiegelfarbe / Größe (verbindlich)</label>
<select class="selectpicker" name="whitelabel_variant_id" id="whitelabel_variant_id" data-style="btn-light" data-live-search="true">
{!! HTMLHelper::getAttributesOptions($product->whitelabel_variant_id ? [$product->whitelabel_variant_id] : [], true, 1) !!}
</select>
<div class="mt-2">
<em>Bestimmt die Farbe auf dem Lieferschein („Tiegel: Schwarz“). Ohne Auswahl wird die Farbe wie bisher aus dem Etikett abgeleitet.</em>
</div>
</div>
<div class="form-group col-md-6">
<label class="form-label" for="whitelabel_variants">Mögliche Varianten (<a
href="{{ route('admin_product_attributes') }}">Anlage unter Attribute</a>)</label>
@ -497,6 +506,20 @@
multiple>
{!! HTMLHelper::getProductAttributesOptions($product->attribute_variants, $image->attributes, false, 1) !!}
</select>
<div class="form-row mt-2">
<div class="form-group col-md-4">
<label class="form-label" for="image_wl_position_{{ $image->id }}">Etikettposition</label>
<select class="form-control" name="image_wl_position[{{ $image->id }}]" id="image_wl_position_{{ $image->id }}">
@foreach (\App\Models\ProductImage::POSITIONS as $key => $label)
<option value="{{ $key }}" {{ ($image->position ?: 'deckel') === $key ? 'selected' : '' }}>{{ $label }}</option>
@endforeach
</select>
</div>
<div class="form-group col-md-4">
<label class="form-label" for="image_wl_size_{{ $image->id }}">Etikettgröße (cm)</label>
{{ Form::text('image_wl_size['.$image->id.']', $image->size_cm !== null ? formatNumber($image->size_cm, 1) : '', ['class' => 'form-control', 'id' => 'image_wl_size_'.$image->id, 'placeholder' => 'aus Variante']) }}
</div>
</div>
<a href="{{ route('admin_product_image_delete', [$image->id, $product->id]) }}"
class="btn btn-sm btn-danger mt-2 mb-2"
onclick="return confirm('Etikett wirklich löschen?');">Etikett löschen</a>