@extends('layout.default') @if($mode == 'edit') @section('title', $__t('Edit product')) @else @section('title', $__t('Create product')) @endif @section('viewJsName', 'productform') @push('pageScripts') @endpush @push('pageStyles') @endpush @section('content')

@yield('title')

@if($mode == 'edit') @if(!empty($product->picture_file_name)) @endif @endif
{{ $__t('A name is required') }}
@php $prefillById = ''; if($mode=='edit') { $prefillById = $product->parent_product_id; } @endphp @php $hint = ''; if ($isSubProductOfOthers) { $hint = $__t('Not possible because this product is already used as a parent product in another product'); } @endphp @include('components.productpicker', array( 'products' => $products, 'nextInputSelector' => '#barcode-taginput', 'prefillById' => $prefillById, 'disallowAllProductWorkflows' => true, 'isRequired' => false, 'label' => 'Parent product', 'disabled' => $isSubProductOfOthers, 'hint' => $hint ))
{{ $__t('A location is required') }}
@php if($mode == 'edit') { $value = $product->min_stock_amount; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'min_stock_amount', 'label' => 'Minimum stock amount', 'min' => 0, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0') )) @php if($mode == 'edit') { $value = $product->default_best_before_days; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'default_best_before_days', 'label' => 'Default best before days', 'min' => -1, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '-1'), 'hint' => $__t('For purchases this amount of days will be added to today for the best before date suggestion') . ' (' . $__t('-1 means that this product never expires') . ')' )) @php if($mode == 'edit') { $value = $product->default_best_before_days_after_open; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'default_best_before_days_after_open', 'label' => 'Default best before days after opened', 'min' => 0, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '-1'), 'hint' => $__t('When a product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)') ))
{{ $__t('A quantity unit is required') }}
{{ $__t('A quantity unit is required') }}
@php if($mode == 'edit') { $value = $product->qu_factor_purchase_to_stock; } else { $value = 1; } @endphp @include('components.numberpicker', array( 'id' => 'qu_factor_purchase_to_stock', 'label' => 'Factor purchase to stock quantity unit', 'min' => 1, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '1'), 'additionalCssClasses' => 'input-group-qu', 'additionalHtmlElements' => '

' ))
allow_partial_units_in_stock == 1) checked @endif class="form-check-input" type="checkbox" id="allow_partial_units_in_stock" name="allow_partial_units_in_stock" value="1">
enable_tare_weight_handling == 1) checked @endif class="form-check-input" type="checkbox" id="enable_tare_weight_handling" name="enable_tare_weight_handling" value="1">
@php if($mode == 'edit') { $value = $product->tare_weight; } else { $value = 0; } @endphp @php if(($mode == 'edit' && $product->enable_tare_weight_handling == 0) || $mode == 'create') { $additionalAttributes = 'disabled'; } else { $additionalAttributes = ''; } @endphp @include('components.numberpicker', array( 'id' => 'tare_weight', 'label' => 'Tare weight', 'min' => 0, 'step' => 0.01, 'value' => $value, 'invalidFeedback' => $__t('This cannot be lower than %s', '0'), 'additionalAttributes' => $additionalAttributes, 'hintId' => 'tare_weight_qu_info' )) @if(GROCY_FEATURE_FLAG_RECIPES)
not_check_stock_fulfillment_for_recipes == 1) checked @endif class="form-check-input" type="checkbox" id="not_check_stock_fulfillment_for_recipes" name="not_check_stock_fulfillment_for_recipes" value="1">
@endif
@include('components.userfieldsform', array( 'userfields' => $userfields, 'entity' => 'products' ))

{{ $__t('QU conversions') }} {{ $__t('Add') }}

@if($mode == "edit") @foreach($quConversions as $quConversion) @endforeach @endif
{{ $__t('Factor') }} {{ $__t('Unit') }} Hidden group Hidden from_qu_id
{{ $quConversion->factor }} {{ FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name }} @if($quConversion->product_id != null) {{ $__t('Product overrides') }} @else {{ $__t('Default conversions') }} @endif from_qu_id xx{{ $quConversion->from_qu_id }}xx
@if(!empty($product->picture_file_name))

{{ $__t('The current picture will be deleted when you save the product') }}

@else

{{ $__t('No picture available') }}

@endif
@stop