mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Allow 0 for shopping list item amounts (references #2712)
This commit is contained in:
57
changelog/81_UNRELEASED_xxxx-xx-xx.md
Normal file
57
changelog/81_UNRELEASED_xxxx-xx-xx.md
Normal file
@@ -0,0 +1,57 @@
|
||||
> ⚠️ xxxBREAKING CHANGESxxx
|
||||
|
||||
> ❗ xxxImportant upgrade informationXXX
|
||||
|
||||
> 💡 xxxMinor upgrade informationXXX
|
||||
|
||||
### New Feature: xxxx
|
||||
|
||||
- xxx
|
||||
|
||||
### Stock
|
||||
|
||||
- xxx
|
||||
|
||||
### Shopping list
|
||||
|
||||
- An amount of `0` is now allowed for shopping list items (just a convenience optimization, it was already possible to leave the amount field empty which implicitly resulted in an amount of `0`)
|
||||
|
||||
### Recipes
|
||||
|
||||
- xxx
|
||||
|
||||
### Meal plan
|
||||
|
||||
- xxx
|
||||
|
||||
### Chores
|
||||
|
||||
- xxx
|
||||
|
||||
### Calendar
|
||||
|
||||
- xxx
|
||||
|
||||
### Tasks
|
||||
|
||||
- xxx
|
||||
|
||||
### Batteries
|
||||
|
||||
- xxx
|
||||
|
||||
### Equipment
|
||||
|
||||
- xxx
|
||||
|
||||
### Userfields
|
||||
|
||||
- xxx
|
||||
|
||||
### General
|
||||
|
||||
- xxx
|
||||
|
||||
### API
|
||||
|
||||
- xxx
|
@@ -10,6 +10,15 @@
|
||||
@php if(empty($label)) { $label = 'Amount'; } @endphp
|
||||
@php if(empty($initialQuId)) { $initialQuId = '-1'; } @endphp
|
||||
@php if(!isset($isRequired)) { $isRequired = true; } @endphp
|
||||
@php if(!isset($allowZero)) { $allowZero = false; } @endphp
|
||||
|
||||
@php
|
||||
$minLocal = $DEFAULT_MIN_AMOUNT;
|
||||
if ($allowZero)
|
||||
{
|
||||
$minLocal = 0;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<div class="form-group row {{ $additionalGroupCssClasses }}">
|
||||
<div class="col">
|
||||
@@ -20,7 +29,7 @@
|
||||
@include('components.numberpicker', array(
|
||||
'id' => 'display_amount',
|
||||
'label' => $label,
|
||||
'min' => $DEFAULT_MIN_AMOUNT,
|
||||
'min' => $minLocal,
|
||||
'decimals' => $userSettings['stock_decimal_places_amounts'],
|
||||
'value' => $value,
|
||||
'additionalGroupCssClasses' => 'col-sm-5 col-12 my-0',
|
||||
|
@@ -72,7 +72,7 @@
|
||||
@include('components.productamountpicker', array(
|
||||
'value' => $value,
|
||||
'initialQuId' => $initialQuId,
|
||||
'min' => $DEFAULT_MIN_AMOUNT,
|
||||
'allowZero' => true,
|
||||
'isRequired' => false
|
||||
))
|
||||
|
||||
|
Reference in New Issue
Block a user