mirror of
https://github.com/grocy/grocy.git
synced 2026-04-05 12:26:15 +02:00
Fix stockentryform
This commit is contained in:
parent
ab83064e2c
commit
b0e1664e09
|
|
@ -26,12 +26,12 @@ function stockentryformView(Grocy, scope = null)
|
||||||
var jsonForm = $scope('#stockentry-form').serializeJSON();
|
var jsonForm = $scope('#stockentry-form').serializeJSON();
|
||||||
Grocy.FrontendHelpers.BeginUiBusy("stockentry-form");
|
Grocy.FrontendHelpers.BeginUiBusy("stockentry-form");
|
||||||
|
|
||||||
|
var jsonData = {};
|
||||||
if (!jsonForm.price.toString().isEmpty())
|
if (!jsonForm.price.toString().isEmpty())
|
||||||
{
|
{
|
||||||
jsonData.price = parseFloat(jsonForm.price).toFixed(Grocy.UserSettings.stock_decimal_places_prices);
|
jsonData.price = parseFloat(jsonForm.price).toFixed(Grocy.UserSettings.stock_decimal_places_prices);
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonData = {};
|
|
||||||
jsonData.amount = jsonForm.amount;
|
jsonData.amount = jsonForm.amount;
|
||||||
jsonData.best_before_date = datetimepicker.GetValue();
|
jsonData.best_before_date = datetimepicker.GetValue();
|
||||||
jsonData.purchased_date = datetimepicker2.GetValue();
|
jsonData.purchased_date = datetimepicker2.GetValue();
|
||||||
|
|
|
||||||
|
|
@ -9,13 +9,13 @@ $content = $__env->yieldContent('content');
|
||||||
$config = "{\n" . $__env->yieldContent('grocyConfigProps') . '}';
|
$config = "{\n" . $__env->yieldContent('grocyConfigProps') . '}';
|
||||||
$config = preg_replace('/(\n[\t ]*)([a-zA-Z0-9_]+):/','${1}"${2}":', $config);
|
$config = preg_replace('/(\n[\t ]*)([a-zA-Z0-9_]+):/','${1}"${2}":', $config);
|
||||||
$config = preg_replace('/: *\'(.*?)\',?\n/', ':"${1}",', $config);
|
$config = preg_replace('/: *\'(.*?)\',?\n/', ':"${1}",', $config);
|
||||||
$config = preg_replace('/,(\n[\t ]+)?}$/', '}', $config);
|
$config = preg_replace('/,(\n[\t ]*)?}$/', '}', $config);
|
||||||
$grocy_options = json_decode($config, true);
|
$grocy_options = json_decode($config, true);
|
||||||
|
|
||||||
$usersettings = "{\n" . $__env->yieldContent('forceUserSettings') . '}';
|
$usersettings = "{\n" . $__env->yieldContent('forceUserSettings') . '}';
|
||||||
$usersettings = preg_replace('/(\n[\t ]*)([a-zA-Z0-9_]+):/','${1}"${2}":', $usersettings);
|
$usersettings = preg_replace('/(\n[\t ]*)([a-zA-Z0-9_]+):/','${1}"${2}":', $usersettings);
|
||||||
$usersettings = preg_replace('/: *\'(.*?)\',?\n/', ':"${1}",', $usersettings);
|
$usersettings = preg_replace('/: *\'(.*?)\',?\n/', ':"${1}",', $usersettings);
|
||||||
$usersettings = preg_replace('/,(\n[\t ]+)?}$/', '}', $usersettings);
|
$usersettings = preg_replace('/,(\n[\t ]*)?}$/', '}', $usersettings);
|
||||||
$usersettings = json_decode($usersettings, true);
|
$usersettings = json_decode($usersettings, true);
|
||||||
if($usersettings != null)
|
if($usersettings != null)
|
||||||
$grocy_options["UserSettings"] = $usersettings;
|
$grocy_options["UserSettings"] = $usersettings;
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@
|
||||||
@section('viewJsName', 'stockentryform')
|
@section('viewJsName', 'stockentryform')
|
||||||
|
|
||||||
@section('grocyConfigProps')
|
@section('grocyConfigProps')
|
||||||
EditMode: '{{ $mode }}',
|
EditMode: "edit",
|
||||||
EditObjectId: {{ $stockEntry->id }},
|
EditObjectId: {{ $stockEntry->id }},
|
||||||
EditObjectProductId: {{ $stockEntry->product_id },
|
EditObjectProductId: {{ $stockEntry->product_id }},
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
@ -18,8 +18,12 @@ EditObjectProductId: {{ $stockEntry->product_id },
|
||||||
|
|
||||||
<hr class="my-2">
|
<hr class="my-2">
|
||||||
|
|
||||||
|
@php
|
||||||
|
$classes = $embedded ? '' : 'col-md-6 col-xl-4'
|
||||||
|
@endphp
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12 col-md-6 col-xl-4 pb-3">
|
<div class="col-12 {{ $classes }} pb-3">
|
||||||
|
|
||||||
<form id="stockentry-form"
|
<form id="stockentry-form"
|
||||||
novalidate>
|
novalidate>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user