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
2 changed files with 12 additions and 1 deletions

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,