mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Test/review/rework (and hopefully finalized) new price handling
This commit is contained in:
99
views/productbarcodeform.blade.php
Normal file
99
views/productbarcodeform.blade.php
Normal file
@@ -0,0 +1,99 @@
|
||||
@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="form-control"
|
||||
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
|
||||
|
||||
<button id="save-barcode-button"
|
||||
class="btn btn-success">{{ $__t('Save') }}</button>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
Reference in New Issue
Block a user