Don't prefill for empty prices when editing a stock entry (fixes #961)

This commit is contained in:
Bernd Bestel 2020-08-24 17:42:41 +02:00
parent a6db08943c
commit e039db22f5
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
2 changed files with 12 additions and 1 deletions

View File

@ -24,6 +24,7 @@
- Fixed that `FEATURE_SETTING_STOCK_COUNT_OPENED_PRODUCTS_AGAINST_MINIMUM_STOCK_AMOUNT` (option to configure if opened products should be considered for minimum stock amounts) was not handled correctly (thanks @teddybeermaniac)
- Fixed that the "Expiring soon" sum (yellow header-button) on the stock overview page didn't include products which expire today (thanks @fipwmaqzufheoxq92ebc)
- Fixed that the shopping cart icon on the stock overview page was also shown if the product was on an already deleted shopping list (if enabled) (thanks @fipwmaqzufheoxq92ebc)
- Fixed that when editing a stock entry without a price, the price field was prefilled with `1`
### Recipe improvements/fixes
- It's now possible to print recipes (button next to the recipe title) (thanks @zsarnett)

View File

@ -71,9 +71,19 @@
))
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@php
if (empty($stockEntry->price))
{
$price = '';
}
else
{
$price = $stockEntry->price;
}
@endphp
@include('components.numberpicker', array(
'id' => 'price',
'value' => $stockEntry->price,
'value' => $price,
'label' => 'Price',
'min' => 0,
'step' => 0.01,