- Lagerort-Stammdaten Raum/Regal/Fach (storage_rooms/shelves/slots) mit CRUD auf Einstellungen -> Allgemein (SettingCrudController-Kinder, ein gemeinsamer StoreStorageSegmentRequest, generische Partials setting-list-card/-segment-form) - Ingredient: alt_name (Handelsname), Lagerort-FKs + storageLabel(), scopeUsedInActiveRecipes() - INCI-Formular: Lieferanten-Repeater mit Shop-URL je Lieferant (leer = Mail), Alternativname, drei Lagerort-Dropdowns - INCI-Liste: Filter "nur aktive (in Rezeptur aktiver Produkte)" + Spalte Alternativer Name - Rohstoffbestand-Detail: Bestellweg pro INCI-Lieferant (Pivot-URL statt order_method-Fallback), Kopf zeigt Alternativname + Lagerort - Hinweise-Doku fortgeschrieben inkl. Chargen-Format-Entscheid ttmmjj (AP-24) Tests: StorageSettingsTest, IngredientActiveRecipeFilterTest, IngredientOrderFieldsTest (Repeater-Format), RawMaterialStockTest erweitert (volle Suite 170 gruen, 613 Assertions) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
72 lines
2.3 KiB
PHP
Executable file
72 lines
2.3 KiB
PHP
Executable file
@extends('layouts.layout-2')
|
|
|
|
@section('content')
|
|
|
|
@if ($errors->any())
|
|
<div class="row">
|
|
<div class="col-sm-12">
|
|
<div class="alert alert-danger">
|
|
<ul>
|
|
@foreach ($errors->all() as $error)
|
|
<li>{{ $error }}</li>
|
|
@endforeach
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endif
|
|
|
|
<h4 class="font-weight-bold py-2 mb-2">
|
|
{{ __('Create/Edit Inhaltsstoff') }}
|
|
</h4>
|
|
|
|
{!! Form::open(['action' => route('admin_product_ingredient_store'), 'class' => 'form-horizontal', 'id'=>'']) !!}
|
|
|
|
<input type="hidden" name="id" id="id" value="@if($model->id>0){{$model->id}}@else new @endif">
|
|
|
|
|
|
@include('admin.ingredient.form')
|
|
|
|
<div class="text-left mt-0 mb-2">
|
|
<button type="submit" class="btn btn-submit">{{ __('save') }}</button>
|
|
<a href="{{ route('admin_product_ingredients') }}" class="btn btn-default">{{ __('back') }}</a>
|
|
</div>
|
|
|
|
{!! Form::close() !!}
|
|
|
|
@endsection
|
|
|
|
@section('scripts')
|
|
<script>
|
|
$(document).ready(function() {
|
|
var supplierRepeater = $('#supplier-repeater');
|
|
var supplierRowIndex = supplierRepeater.find('.supplier-row').length;
|
|
|
|
function addSupplierRow() {
|
|
var html = $('#supplier-row-template').html().replace(/__INDEX__/g, supplierRowIndex++);
|
|
supplierRepeater.append(html);
|
|
}
|
|
|
|
$('#add-supplier-row').on('click', addSupplierRow);
|
|
|
|
supplierRepeater.on('click', '.js-remove-supplier-row', function() {
|
|
$(this).closest('.supplier-row').remove();
|
|
});
|
|
|
|
if (supplierRepeater.find('.supplier-row').length === 0) {
|
|
addSupplierRow();
|
|
}
|
|
|
|
$('#delivery_time').on('input change', function() {
|
|
var value = $(this).val();
|
|
var option = $('#ingredient_delivery_time_options option').filter(function() {
|
|
return this.value === value;
|
|
}).first();
|
|
|
|
if (option.length && option.data('days') !== undefined && option.data('days') !== '') {
|
|
$('#delivery_time_days').val(option.data('days'));
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|