mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Fixed number input min/max amount handling Only (auto) save valid user inputs More filters on the stock journal pages Save the last price per used barcode and preselect that as a total price on purchase if not empty (closes #1131) Don't apply conversions for only_check_single_unit_in_stock ingredients (fixes #1120) Render shopping list userfields (closes #1052) Fixed Focus when adding included recipes (closes #1019) Order all base objects with NOCASE (closes #1086)
105 lines
2.6 KiB
PHP
105 lines
2.6 KiB
PHP
@extends('layout.default')
|
|
|
|
@if($mode == 'edit')
|
|
@section('title', $__t('Edit Barcode'))
|
|
@else
|
|
@section('title', $__t('Create Barcode'))
|
|
@endif
|
|
|
|
@section('viewJsName', 'productbarcodeform')
|
|
|
|
@section('content')
|
|
<script>
|
|
Grocy.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
|
Grocy.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
|
</script>
|
|
|
|
<div class="row">
|
|
<div class="col">
|
|
<div class="title-related-links">
|
|
<h2 class="title">@yield('title')</h2>
|
|
<h2>
|
|
<span class="text-muted small">{{ $__t('Barcode for product') }} <strong>{{ $product->name }}</strong></span>
|
|
</h2>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="my-2">
|
|
|
|
<div class="row">
|
|
<div class="col-lg-6 col-xs-12">
|
|
|
|
<script>
|
|
Grocy.EditMode = '{{ $mode }}';
|
|
Grocy.EditObjectProduct = {!! json_encode($product) !!};
|
|
</script>
|
|
|
|
@if($mode == 'edit')
|
|
<script>
|
|
Grocy.EditObjectId = {{ $barcode->id }};
|
|
Grocy.EditObject = {!! json_encode($barcode) !!};
|
|
</script>
|
|
@endif
|
|
|
|
<form id="barcode-form"
|
|
novalidate>
|
|
|
|
<input type="hidden"
|
|
name="product_id"
|
|
value="{{ $product->id }}">
|
|
|
|
<div class="form-group">
|
|
<label for="name">{{ $__t('Barcode') }} <i class="fas fa-barcode"></i></label>
|
|
<div class="input-group">
|
|
<input type="text"
|
|
class="form-control barcodescanner-input"
|
|
required
|
|
id="barcode"
|
|
name="barcode"
|
|
value="@if($mode == 'edit'){{ $barcode->barcode }}@endif"
|
|
data-target="#scanned_barcode">
|
|
@include('components.barcodescanner')
|
|
</div>
|
|
</div>
|
|
|
|
@php if($mode == 'edit') { $value = $barcode->amount; } else { $value = ''; } @endphp
|
|
@include('components.productamountpicker', array(
|
|
'value' => $value,
|
|
'isRequired' => false
|
|
))
|
|
|
|
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
|
<div class="form-group">
|
|
<label for="shopping_location_id_id">{{ $__t('Store') }}</label>
|
|
<select class="custom-control custom-select"
|
|
id="shopping_location_id"
|
|
name="shopping_location_id">
|
|
<option></option>
|
|
@foreach($shoppinglocations as $store)
|
|
<option @if($mode=='edit'
|
|
&&
|
|
$store->id == $barcode->shopping_location_id) selected="selected" @endif value="{{ $store->id }}">{{ $store->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
@else
|
|
<input type="hidden"
|
|
name="shopping_location_id"
|
|
id="shopping_location_id"
|
|
value="1">
|
|
@endif
|
|
|
|
@include('components.userfieldsform', array(
|
|
'userfields' => $userfields,
|
|
'entity' => 'product_barcodes'
|
|
))
|
|
|
|
<button id="save-barcode-button"
|
|
class="btn btn-success">{{ $__t('Save') }}</button>
|
|
|
|
</form>
|
|
</div>
|
|
</div>
|
|
@stop
|