mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Squashed commit
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)
This commit is contained in:
@@ -177,7 +177,7 @@
|
||||
<label for="assignment_config">{{ $__t('Assign to') }}</label>
|
||||
<select required
|
||||
multiple
|
||||
class="custom-control custom-select input-group-chore-assignment-type selectpicker"
|
||||
class="form-control input-group-chore-assignment-type selectpicker"
|
||||
id="assignment_config"
|
||||
name="assignment_config"
|
||||
data-actions-Box="true"
|
||||
|
@@ -4,7 +4,7 @@
|
||||
|
||||
@php if(!isset($value)) { $value = 1; } @endphp
|
||||
@php if(empty($min)) { $min = 0; } @endphp
|
||||
@php if(empty($max)) { $max = 999999; } @endphp
|
||||
@php if(!isset($max)) { $max = ''; } @endphp
|
||||
@php if(empty($decimals)) { $decimals = 0; } @endphp
|
||||
@php if(empty($hint)) { $hint = ''; } @endphp
|
||||
@php if(empty($hintId)) { $hintId = ''; } @endphp
|
||||
@@ -20,7 +20,8 @@
|
||||
|
||||
<div id="group-{{ $id }}"
|
||||
class="form-group {{ $additionalGroupCssClasses }}">
|
||||
<label for="{{ $id }}">
|
||||
<label class="w-100"
|
||||
for="{{ $id }}">
|
||||
{{ $__t($label) }}
|
||||
@if(!empty($hint) || !empty($hintId))
|
||||
<i id="{{ $hintId }}"
|
||||
@@ -31,7 +32,7 @@
|
||||
{!! $additionalHtmlContextHelp !!}
|
||||
@if(!empty($contextInfoId))
|
||||
<span id="{{ $contextInfoId }}"
|
||||
class="small text-muted"></span>
|
||||
class="small text-muted float-right mt-1"></span>
|
||||
@endif
|
||||
</label>
|
||||
<div class="input-group">
|
||||
@@ -46,8 +47,10 @@
|
||||
@endif
|
||||
value="{{ $value }}"
|
||||
min="{{ number_format($min, $decimals, '.', '') }}"
|
||||
@if(!empty($max))
|
||||
max="{{ number_format($max, $decimals, '.', '') }}"
|
||||
step="@if($decimals == 0){{1}}@else{{'.' . str_repeat('0', $userSettings['stock_decimal_places_amounts'] - 1) . '1'}}@endif"
|
||||
@endif
|
||||
step="@if($decimals == 0){{1}}@else{{'.' . str_repeat('0', $decimals - 1) . '1'}}@endif"
|
||||
data-decimals="{{ $decimals }}"
|
||||
@if($isRequired)
|
||||
required
|
||||
|
@@ -101,7 +101,7 @@
|
||||
<div class="form-group">
|
||||
<label for="{{ $userfield->name }}">{{ $userfield->caption }}</label>
|
||||
<select multiple
|
||||
class="custom-control custom-select userfield-input selectpicker"
|
||||
class="form-control userfield-input selectpicker"
|
||||
data-userfield-name="{{ $userfield->name }}"
|
||||
data-actions-Box="true"
|
||||
data-live-search="true">
|
||||
|
@@ -90,6 +90,11 @@
|
||||
value="1">
|
||||
@endif
|
||||
|
||||
@include('components.userfieldsform', array(
|
||||
'userfields' => $userfields,
|
||||
'entity' => 'product_barcodes'
|
||||
))
|
||||
|
||||
<button id="save-barcode-button"
|
||||
class="btn btn-success">{{ $__t('Save') }}</button>
|
||||
|
||||
|
@@ -469,6 +469,10 @@
|
||||
@endif
|
||||
<th>{{ $__t('Quantity unit') }}</th>
|
||||
<th>{{ $__t('Amount') }}</th>
|
||||
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $productBarcodeUserfields
|
||||
))
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="d-none">
|
||||
@@ -510,6 +514,11 @@
|
||||
<span class="locale-number locale-number-quantity-amount">{{ $barcode->amount }}</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
@include('components.userfields_tbody', array(
|
||||
'userfields' => $productBarcodeUserfields,
|
||||
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($productBarcodeUserfieldValues, 'object_id', $barcode->id)
|
||||
))
|
||||
</tr>
|
||||
@endif
|
||||
@endforeach
|
||||
@@ -595,7 +604,7 @@
|
||||
@endif
|
||||
</td>
|
||||
<td class="font-italic">
|
||||
{{ $__t('This means 1 %1$s is the same as %2$s %3$s', FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->from_qu_id)->name, $quConversion->factor, FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name) }}
|
||||
{!! $__t('This means 1 %1$s is the same as %2$s %3$s', FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->from_qu_id)->name, '<span class="locale-number locale-number-quantity-amount">' . $quConversion->factor . '</span>', FindObjectInArrayByPropertyValue($quantityunits, 'id', $quConversion->to_qu_id)->name) !!}
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
@@ -103,6 +103,8 @@
|
||||
<div class="title-related-links">
|
||||
<h4>
|
||||
{{ $__t('Default conversions') }}
|
||||
<small id="qu-conversion-headline-info"
|
||||
class="text-muted font-italic"></small>
|
||||
</h4>
|
||||
<button class="btn btn-outline-dark d-md-none mt-2 float-right order-1 order-md-3"
|
||||
type="button"
|
||||
@@ -119,9 +121,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h5 id="qu-conversion-headline-info"
|
||||
class="text-muted font-italic"></h5>
|
||||
|
||||
<table id="qu-conversions-table"
|
||||
class="table table-sm table-striped nowrap w-100">
|
||||
<thead>
|
||||
@@ -154,7 +153,7 @@
|
||||
</a>
|
||||
</td>
|
||||
<td>
|
||||
{{ $defaultQuConversion->factor }}
|
||||
<span class="locale-number locale-number-quantity-amount">{{ $defaultQuConversion->factor }}</span>
|
||||
</td>
|
||||
<td>
|
||||
{{ FindObjectInArrayByPropertyValue($quantityUnits, 'id', $defaultQuConversion->to_qu_id)->name }}
|
||||
|
@@ -187,7 +187,7 @@
|
||||
$productQuConversions = FindAllObjectsInArrayByPropertyValue($quantityUnitConversionsResolved, 'product_id', $product->id);
|
||||
$productQuConversions = FindAllObjectsInArrayByPropertyValue($productQuConversions, 'from_qu_id', $product->qu_id_stock);
|
||||
$productQuConversion = FindObjectInArrayByPropertyValue($productQuConversions, 'to_qu_id', $recipePosition->qu_id);
|
||||
if ($productQuConversion)
|
||||
if ($productQuConversion && $recipePosition->only_check_single_unit_in_stock == 0)
|
||||
{
|
||||
$recipePosition->amount = $recipePosition->amount * $productQuConversion->factor;
|
||||
}
|
||||
|
@@ -398,7 +398,7 @@
|
||||
$productQuConversions = FindAllObjectsInArrayByPropertyValue($quantityUnitConversionsResolved, 'product_id', $product->id);
|
||||
$productQuConversions = FindAllObjectsInArrayByPropertyValue($productQuConversions, 'from_qu_id', $product->qu_id_stock);
|
||||
$productQuConversion = FindObjectInArrayByPropertyValue($productQuConversions, 'to_qu_id', $selectedRecipePosition->qu_id);
|
||||
if ($productQuConversion)
|
||||
if ($productQuConversion && $selectedRecipePosition->only_check_single_unit_in_stock == 0)
|
||||
{
|
||||
$selectedRecipePosition->recipe_amount = $selectedRecipePosition->recipe_amount * $productQuConversion->factor;
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@
|
||||
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100"
|
||||
id="related-links">
|
||||
<div class="my-auto float-right">
|
||||
<select class="custom-control custom-select"
|
||||
<select class="custom-control custom-select custom-select-sm"
|
||||
id="selected-shopping-list">
|
||||
@foreach($shoppingLists as $shoppingList)
|
||||
<option @if($shoppingList->id == $selectedShoppingListId) selected="selected" @endif value="{{ $shoppingList->id }}">{{ $shoppingList->name }}</option>
|
||||
@@ -190,6 +190,9 @@
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $userfields
|
||||
))
|
||||
@include('components.userfields_thead', array(
|
||||
'userfields' => $productUserfields
|
||||
))
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -259,6 +262,10 @@
|
||||
|
||||
@include('components.userfields_tbody', array(
|
||||
'userfields' => $userfields,
|
||||
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $listItem->id)
|
||||
))
|
||||
@include('components.userfields_tbody', array(
|
||||
'userfields' => $productUserfields,
|
||||
'userfieldValues' => FindAllObjectsInArrayByPropertyValue($userfieldValues, 'object_id', $listItem->product_id)
|
||||
))
|
||||
|
||||
|
@@ -43,6 +43,11 @@
|
||||
<div class="invalid-feedback">{{ $__t('A name is required') }}</div>
|
||||
</div>
|
||||
|
||||
@include('components.userfieldsform', array(
|
||||
'userfields' => $userfields,
|
||||
'entity' => 'shopping_lists'
|
||||
))
|
||||
|
||||
<button id="save-shopping-list-button"
|
||||
class="btn btn-success">{{ $__t('Save') }}</button>
|
||||
|
||||
|
@@ -84,6 +84,11 @@
|
||||
name="note">@if($mode == 'edit'){{ $listItem->note }}@endif</textarea>
|
||||
</div>
|
||||
|
||||
@include('components.userfieldsform', array(
|
||||
'userfields' => $userfields,
|
||||
'entity' => 'shopping_list'
|
||||
))
|
||||
|
||||
<button id="save-shoppinglist-button"
|
||||
class="btn btn-success">{{ $__t('Save') }}</button>
|
||||
|
||||
|
@@ -34,7 +34,7 @@
|
||||
|
||||
<div class="row collapse d-md-flex"
|
||||
id="table-filter-row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<div class="col-xs-12 col-md-6 col-xl-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
||||
@@ -45,7 +45,7 @@
|
||||
placeholder="{{ $__t('Search') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<div class="col-xs-12 col-md-6 col-xl-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Product') }}</span>
|
||||
@@ -59,8 +59,50 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Transaction type') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="transaction-type-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($transactionTypes as $transactionType)
|
||||
<option value="{{ $transactionType }}">{{ $__t($transactionType) }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Location') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="location-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($locations as $location)
|
||||
<option value="{{ $location->id }}">{{ $location->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('User') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="user-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->display_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="float-right">
|
||||
<div class="float-right mt-1">
|
||||
<a id="clear-filter-button"
|
||||
class="btn btn-sm btn-outline-info"
|
||||
href="#">
|
||||
|
@@ -8,17 +8,98 @@
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="title">@yield('title')</h2>
|
||||
<div class="float-right">
|
||||
<button class="btn btn-outline-dark d-md-none mt-2 order-1 order-md-3"
|
||||
type="button"
|
||||
data-toggle="collapse"
|
||||
data-target="#table-filter-row">
|
||||
<i class="fas fa-filter"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr class="my-2">
|
||||
|
||||
<div class="row">
|
||||
<div class="row collapse d-md-flex"
|
||||
id="table-filter-row">
|
||||
<div class="col-xs-12 col-md-6 col-xl-2">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-search"></i></span>
|
||||
</div>
|
||||
<input type="text"
|
||||
id="search"
|
||||
class="form-control"
|
||||
placeholder="{{ $__t('Search') }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Product') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="product-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($products as $product)
|
||||
<option value="{{ $product->id }}">{{ $product->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('Transaction type') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="transaction-type-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($transactionTypes as $transactionType)
|
||||
<option value="{{ $transactionType }}">{{ $__t($transactionType) }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-xl-3">
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fas fa-filter"></i> {{ $__t('User') }}</span>
|
||||
</div>
|
||||
<select class="custom-control custom-select"
|
||||
id="user-filter">
|
||||
<option value="all">{{ $__t('All') }}</option>
|
||||
@foreach($users as $user)
|
||||
<option value="{{ $user->id }}">{{ $user->display_name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<table id="journal-summary-table"
|
||||
<div class="float-right mt-1">
|
||||
<a id="clear-filter-button"
|
||||
class="btn btn-sm btn-outline-info"
|
||||
href="#">
|
||||
{{ $__t('Clear filter') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-2">
|
||||
<div class="col">
|
||||
<table id="stock-journal-summary-table"
|
||||
class="table table-sm table-striped nowrap w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="border-right"><a class="text-muted change-table-columns-visibility-button"
|
||||
data-toggle="tooltip"
|
||||
data-toggle="tooltip"
|
||||
title="{{ $__t('Hide/view columns') }}"
|
||||
data-table-selector="#stock-journal-summary-table"
|
||||
href="#"><i class="fas fa-eye"></i></a>
|
||||
</th>
|
||||
<th>{{ $__t('Product') }}</th>
|
||||
<th>{{ $__t('Transaction type') }}</th>
|
||||
<th>{{ $__t('User') }}</th>
|
||||
@@ -28,6 +109,7 @@
|
||||
<tbody class="d-none">
|
||||
@foreach($entries as $journalEntry)
|
||||
<tr>
|
||||
<td class="fit-content border-right"></td>
|
||||
<td>
|
||||
{{ $journalEntry->product_name }}
|
||||
</td>
|
||||
|
@@ -84,7 +84,7 @@
|
||||
'id' => 'stock_default_purchase_amount',
|
||||
'additionalAttributes' => 'data-setting-key="stock_default_purchase_amount"',
|
||||
'label' => 'Default amount for purchase',
|
||||
'min' => 0,
|
||||
'min' => '0.',
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'additionalCssClasses' => 'user-setting-control locale-number-input locale-number-quantity-amount',
|
||||
))
|
||||
|
Reference in New Issue
Block a user