@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 ))
@if(GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
{{ $__t('A location is required') }}
@else @endif @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) @include('components.shoppinglocationpicker', array( 'label' => 'Default store', 'shoppinglocations' => $shoppinglocations )) @else @endif @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'), 'additionalGroupCssClasses' => 'mb-1' ))
cumulate_min_stock_amount_of_sub_products == 1) checked @endif class="form-check-input" type="checkbox" id="cumulate_min_stock_amount_of_sub_products" name="cumulate_min_stock_amount_of_sub_products" value="1">
@if(GROCY_FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING) @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') . ')' )) @if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING) @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 this product was marked as opened, the best before date will be replaced by today + this amount of days (a value of 0 disables this)') )) @endif @endif
{{ $__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' )) @php $additionalAttributes = '' @endphp @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">
@php if($mode == 'edit') { $value = $product->calories; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'calories', 'label' => 'Energy (kcal)', 'min' => 0, 'step' => 0.01, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'), 'hint' => $__t('Per stock quantity unit'), 'isRequired' => false )) @endif @if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_FREEZING) @php if($mode == 'edit') { $value = $product->default_best_before_days_after_freezing; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'default_best_before_days_after_freezing', 'label' => 'Default best before days after freezing', 'min' => -1, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'), 'hint' => $__t('On moving this product to a freezer location (so when freezing it), the best before date will be replaced by today + this amount of days') )) @php if($mode == 'edit') { $value = $product->default_best_before_days_after_thawing; } else { $value = 0; } @endphp @include('components.numberpicker', array( 'id' => 'default_best_before_days_after_thawing', 'label' => 'Default best before days after thawing', 'min' => -1, 'value' => $value, 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'), 'hint' => $__t('On moving this product from a freezer location (so when thawing it), the best before date will be replaced by today + this amount of days') )) @else @endif
@include('components.userfieldsform', array( 'userfields' => $userfields, 'entity' => 'products' ))

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

@if($mode == "edit") @foreach($quConversions as $quConversion) @if($quConversion->product_id == $product->id || $quConversion->product_id == null) @endif @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