mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Also use the productamountpicker for inventory (refernces #1015)
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
|
||||
@php if(empty($additionalGroupCssClasses)) { $additionalGroupCssClasses = ''; } @endphp
|
||||
@php if(empty($additionalHtmlContextHelp)) { $additionalHtmlContextHelp = ''; } @endphp
|
||||
@php if(empty($additionalHtmlElements)) { $additionalHtmlElements = ''; } @endphp
|
||||
@php if(empty($label)) { $label = 'Amount'; } @endphp
|
||||
|
||||
<div class="form-group row {{ $additionalGroupCssClasses }}">
|
||||
<div class="col">
|
||||
@@ -13,14 +15,15 @@
|
||||
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'display_amount',
|
||||
'label' => 'Amount',
|
||||
'label' => $label,
|
||||
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'invalidFeedback' => $__t('This cannot be negative and must be an integral number'),
|
||||
'additionalGroupCssClasses' => 'col-sm-5 col-xs-12 my-0',
|
||||
'additionalCssClasses' => 'input-group-productamountpicker',
|
||||
'additionalHtmlContextHelp' => ''
|
||||
'additionalHtmlContextHelp' => '',
|
||||
'additionalHtmlElements' => ''
|
||||
))
|
||||
|
||||
<div class="col-sm-7 col-xs-12">
|
||||
@@ -36,7 +39,10 @@
|
||||
</div>
|
||||
|
||||
<div id="qu-conversion-info"
|
||||
class="col form-text text-info d-none"></div>
|
||||
class="ml-3 my-0 form-text text-info d-none w-100"></div>
|
||||
|
||||
{!! $additionalHtmlElements !!}
|
||||
|
||||
<input type="hidden"
|
||||
id="amount"
|
||||
name="amount"
|
||||
|
@@ -5,6 +5,11 @@
|
||||
@section('viewJsName', 'inventory')
|
||||
|
||||
@section('content')
|
||||
<script>
|
||||
Grocy.QuantityUnits = {!! json_encode($quantityUnits) !!};
|
||||
Grocy.QuantityUnitConversionsResolved = {!! json_encode($quantityUnitConversionsResolved) !!};
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-4 pb-3">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
@@ -20,19 +25,14 @@
|
||||
'nextInputSelector' => '#new_amount'
|
||||
))
|
||||
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'new_amount',
|
||||
'label' => 'New stock amount',
|
||||
'hintId' => 'new_amount_qu_unit',
|
||||
'min' => 0,
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
@include('components.productamountpicker', array(
|
||||
'value' => 1,
|
||||
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
|
||||
'label' => 'New stock amount',
|
||||
'additionalAttributes' => 'data-not-equal="-1"',
|
||||
'additionalHtmlElements' => '<div id="inventory-change-info"
|
||||
class="form-text text-muted small d-none"></div>',
|
||||
class="form-text text-muted d-none ml-3 my-0 w-100"></div>',
|
||||
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
|
||||
class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
|
||||
class="text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
|
||||
))
|
||||
|
||||
@if(boolval($userSettings['show_purchased_date_on_purchase']))
|
||||
|
Reference in New Issue
Block a user