mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Added an option to reprint stock entry labels when editing them (closes #2092)
This commit is contained in:
parent
daf5ad33c7
commit
83fa02d8ad
@ -21,6 +21,8 @@
|
||||
- Changed that when the ingredient option "Only check if any amount is in stock" is enabled, costs and calories are now based on the original entered amount instead of an "virtual" fixed amount of `1`
|
||||
- When using the "Add as barcode to existing product" workflow on a purchase transaction, the selected quantity unit and the entered amount is now also added to the new barcode
|
||||
- When using the "Add as barcode to existing product" workflow on a purchase or inventory transaction, the entered note is now also added to the new barcode
|
||||
- Added a new option "Reprint stock entry label" on the stock entry edit page (will print the correspondind stock entry label on save)
|
||||
- This option will be automatically set when on changing the due date
|
||||
- Fixed that hiding the "Purchased date" column (table options) on the stock entries page didn't work
|
||||
- Fixed that sorting by the "Value" column on the stock overview page didn't work
|
||||
- Fixed that the consumed amount was wrong, when consuming multiple substituted subproducts at once and when multiple/different conversion factors were involved
|
||||
|
@ -2356,3 +2356,6 @@ msgstr ""
|
||||
|
||||
msgid "Successfully added the recipe to the meal plan"
|
||||
msgstr ""
|
||||
|
||||
msgid "Reprint stock entry label"
|
||||
msgstr ""
|
||||
|
@ -25,10 +25,14 @@
|
||||
jsonData.best_before_date = Grocy.Components.DateTimePicker.GetValue();
|
||||
jsonData.purchased_date = Grocy.Components.DateTimePicker2.GetValue();
|
||||
jsonData.note = jsonForm.note;
|
||||
jsonData.price = price;
|
||||
jsonData.open = $("#open").is(":checked");
|
||||
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
|
||||
{
|
||||
jsonData.shopping_location_id = Grocy.Components.ShoppingLocationPicker.GetValue();
|
||||
}
|
||||
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING)
|
||||
{
|
||||
jsonData.location_id = Grocy.Components.LocationPicker.GetValue();
|
||||
@ -37,14 +41,23 @@
|
||||
{
|
||||
jsonData.location_id = 1;
|
||||
}
|
||||
jsonData.price = price;
|
||||
|
||||
jsonData.open = $("#open").is(":checked");
|
||||
|
||||
Grocy.Api.Put("stock/entry/" + Grocy.EditObjectRowId, jsonData,
|
||||
function(result)
|
||||
{
|
||||
Grocy.EditObjectId = result[0].transaction_id;
|
||||
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_LABEL_PRINTER && $("#print-label").is(":checked"))
|
||||
{
|
||||
Grocy.Api.Get('stock/entry/' + result[0].stock_id + '/printlabel', function(labelData)
|
||||
{
|
||||
if (Grocy.Webhooks.labelprinter !== undefined)
|
||||
{
|
||||
Grocy.FrontendHelpers.RunWebhook(Grocy.Webhooks.labelprinter, labelData);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Grocy.Components.UserfieldsForm.Save(function()
|
||||
{
|
||||
var successMessage = __t('Stock entry successfully updated') + '<br><a class="btn btn-secondary btn-sm mt-2" href="#" onclick="UndoStockBookingEntry(\'' + result.id + '\',\'' + Grocy.EditObjectRowId + '\')"><i class="fa-solid fa-undo"></i> ' + __t("Undo") + '</a>';
|
||||
@ -123,6 +136,14 @@ $("#amount").on("focus", function(e)
|
||||
$(this).select();
|
||||
});
|
||||
|
||||
Grocy.Components.DateTimePicker.GetInputElement().on('change', function(e)
|
||||
{
|
||||
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_LABEL_PRINTER)
|
||||
{
|
||||
$("#print-label").prop("checked", true);
|
||||
}
|
||||
});
|
||||
|
||||
Grocy.Components.UserfieldsForm.Load();
|
||||
setTimeout(function()
|
||||
{
|
||||
|
@ -133,6 +133,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_STOCK_PRODUCT_OPENED_TRACKING)
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input @if($stockEntry->open == 1) checked @endif class="form-check-input custom-control-input" type="checkbox" id="open" name="open" value="1">
|
||||
@ -140,12 +141,26 @@
|
||||
for="open">{{ $__t('Opened') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@include('components.userfieldsform', array(
|
||||
'userfields' => $userfields,
|
||||
'entity' => 'stock'
|
||||
))
|
||||
|
||||
@if(GROCY_FEATURE_FLAG_LABEL_PRINTER)
|
||||
<div class="form-group">
|
||||
<div class="custom-control custom-checkbox">
|
||||
<input class="form-check-input custom-control-input"
|
||||
type="checkbox"
|
||||
id="print-label"
|
||||
value="1">
|
||||
<label class="form-check-label custom-control-label"
|
||||
for="print-label">{{ $__t('Reprint stock entry label') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<button id="save-stockentry-button"
|
||||
class="btn btn-success">{{ $__t('OK') }}</button>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user