UI strings/tooltips/basic handling review/optimizations

This commit is contained in:
Bernd Bestel 2020-11-12 21:35:10 +01:00
parent c121c0483a
commit c360cbec4c
No known key found for this signature in database
GPG Key ID: 71BD34C0D4891300
40 changed files with 325 additions and 245 deletions

View File

@ -43,6 +43,8 @@
- When clicking the product name on the shopping list, the product card will now be displayed (like on the stock overview page) (thanks @kriddles) - When clicking the product name on the shopping list, the product card will now be displayed (like on the stock overview page) (thanks @kriddles)
- On the product card there is now also a button to jump directly to the stock entries of the corresponding product (thanks @kriddles) - On the product card there is now also a button to jump directly to the stock entries of the corresponding product (thanks @kriddles)
- The product picker workflows can now also be started by `ENTER` (additionally to `TAB`) - The product picker workflows can now also be started by `ENTER` (additionally to `TAB`)
- Added a grouped/summarized stock journal (new button "Journal summary" at the top of the stock journal page) (thanks @fipwmaqzufheoxq92ebc)
- Provides an overview of summarized transactions per product, transaction type and user + summarized amount
- Fixed that changing the products "Factor purchase to stock quantity unit" not longer messes up historical prices (which results for example in wrong recipe costs) (thanks @kriddles) - Fixed that changing the products "Factor purchase to stock quantity unit" not longer messes up historical prices (which results for example in wrong recipe costs) (thanks @kriddles)
- Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu) - Fixed that when adding products through a product picker workflow and when the created products contains special characters, the product was not preselected on the previous page (thanks @Forceu)
- Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles) - Fixed that when editing a product the default store was not visible / always empty regardless if the product had one set (thanks @kriddles)

View File

@ -414,35 +414,30 @@ class StockApiController extends BaseApiController
} }
$bestBeforeDate = null; $bestBeforeDate = null;
if (array_key_exists('best_before_date', $requestBody) && IsIsoDate($requestBody['best_before_date'])) if (array_key_exists('best_before_date', $requestBody) && IsIsoDate($requestBody['best_before_date']))
{ {
$bestBeforeDate = $requestBody['best_before_date']; $bestBeforeDate = $requestBody['best_before_date'];
} }
$purchasedDate = null; $purchasedDate = null;
if (array_key_exists('purchased_date', $requestBody) && IsIsoDate($requestBody['purchased_date'])) if (array_key_exists('purchased_date', $requestBody) && IsIsoDate($requestBody['purchased_date']))
{ {
$bestBeforeDate = $requestBody['purchased_date']; $purchasedDate = $requestBody['purchased_date'];
} }
$locationId = null; $locationId = null;
if (array_key_exists('location_id', $requestBody) && is_numeric($requestBody['location_id'])) if (array_key_exists('location_id', $requestBody) && is_numeric($requestBody['location_id']))
{ {
$locationId = $requestBody['location_id']; $locationId = $requestBody['location_id'];
} }
$price = null; $price = null;
if (array_key_exists('price', $requestBody) && is_numeric($requestBody['price'])) if (array_key_exists('price', $requestBody) && is_numeric($requestBody['price']))
{ {
$price = $requestBody['price']; $price = $requestBody['price'];
} }
$shoppingLocationId = null; $shoppingLocationId = null;
if (array_key_exists('shopping_location_id', $requestBody) && is_numeric($requestBody['shopping_location_id'])) if (array_key_exists('shopping_location_id', $requestBody) && is_numeric($requestBody['shopping_location_id']))
{ {
$shoppingLocationId = $requestBody['shopping_location_id']; $shoppingLocationId = $requestBody['shopping_location_id'];

View File

@ -1233,7 +1233,7 @@
"price": { "price": {
"type": "number", "type": "number",
"format": "number", "format": "number",
"description": "The price per purchase quantity unit in configured currency" "description": "The price per stock quantity unit in configured currency"
}, },
"open": { "open": {
"type": "boolean", "type": "boolean",
@ -1549,7 +1549,7 @@
"price": { "price": {
"type": "number", "type": "number",
"format": "number", "format": "number",
"description": "The price per purchase quantity unit in configured currency" "description": "The price per stock quantity unit in configured currency"
}, },
"location_id": { "location_id": {
"type": "number", "type": "number",
@ -1977,7 +1977,7 @@
"price": { "price": {
"type": "number", "type": "number",
"format": "number", "format": "number",
"description": "The price per purchase quantity unit in configured currency" "description": "The price per stock quantity unit in configured currency"
}, },
"location_id": { "location_id": {
"type": "number", "type": "number",

View File

@ -394,15 +394,6 @@ msgstr ""
msgid "All" msgid "All"
msgstr "" msgstr ""
msgid "Track charge cycle of battery %s"
msgstr ""
msgid "Track execution of chore %s"
msgstr ""
msgid "Filter by location"
msgstr ""
msgid "Search" msgid "Search"
msgstr "" msgstr ""
@ -561,9 +552,6 @@ msgstr ""
msgid "Unknown" msgid "Unknown"
msgstr "" msgstr ""
msgid "Filter by chore"
msgstr ""
msgid "Chores journal" msgid "Chores journal"
msgstr "" msgstr ""
@ -585,9 +573,6 @@ msgstr ""
msgid "Price" msgid "Price"
msgstr "" msgstr ""
msgid "in %s per purchase quantity unit"
msgstr ""
msgid "The price cannot be lower than %s" msgid "The price cannot be lower than %s"
msgstr "" msgstr ""
@ -824,9 +809,6 @@ msgstr ""
msgid "No picture available" msgid "No picture available"
msgstr "" msgstr ""
msgid "Filter by product group"
msgstr ""
msgid "Presets for new products" msgid "Presets for new products"
msgstr "" msgstr ""
@ -854,27 +836,12 @@ msgstr ""
msgid "Stock journal" msgid "Stock journal"
msgstr "" msgstr ""
msgid "Filter by product"
msgstr ""
msgid "Booking time"
msgstr ""
msgid "Booking type"
msgstr ""
msgid "Undo booking"
msgstr ""
msgid "Undone on" msgid "Undone on"
msgstr "" msgstr ""
msgid "Batteries journal" msgid "Batteries journal"
msgstr "" msgstr ""
msgid "Filter by battery"
msgstr ""
msgid "Undo charge cycle" msgid "Undo charge cycle"
msgstr "" msgstr ""
@ -1034,21 +1001,6 @@ msgstr ""
msgid "The current picture will be deleted when you save the recipe" msgid "The current picture will be deleted when you save the recipe"
msgstr "" msgstr ""
msgid "Show product details"
msgstr ""
msgid "Stock journal for this product"
msgstr ""
msgid "Show chore details"
msgstr ""
msgid "Journal for this chore"
msgstr ""
msgid "Show battery details"
msgstr ""
msgid "Journal for this battery" msgid "Journal for this battery"
msgstr "" msgstr ""
@ -1145,9 +1097,6 @@ msgstr ""
msgid "Userfields" msgid "Userfields"
msgstr "" msgstr ""
msgid "Filter by entity"
msgstr ""
msgid "Entity" msgid "Entity"
msgstr "" msgstr ""
@ -1586,9 +1535,6 @@ msgstr ""
msgid "Transfered %1$s of %2$s from %3$s to %4$s" msgid "Transfered %1$s of %2$s from %3$s to %4$s"
msgstr "" msgstr ""
msgid "Show stock entries"
msgstr ""
msgid "Stock entries" msgid "Stock entries"
msgstr "" msgstr ""
@ -1945,3 +1891,48 @@ msgstr ""
msgid "Hide/view columns" msgid "Hide/view columns"
msgstr "" msgstr ""
msgid "This product is currently on a shopping list"
msgstr ""
msgid "Undo transaction"
msgstr ""
msgid "Transaction type"
msgstr ""
msgid "Transaction time"
msgstr ""
msgid "Edit this timee"
msgstr ""
msgid "Delete this tiem"
msgstr ""
msgid "Chore journal"
msgstr ""
msgid "Track chore execution"
msgstr ""
msgid "Mark task as completed"
msgstr ""
msgid "Track charge cycle"
msgstr ""
msgid "Battery journal"
msgstr ""
msgid "This product has a picture"
msgstr ""
msgid "Consume this stock entry as spoiled"
msgstr ""
msgid "Configure user permissions"
msgstr ""
msgid "Show a QR-Code for this API key"
msgstr ""

View File

@ -764,6 +764,8 @@ $(window).on("message", function(e)
$(".change-table-columns-visibility-button").on("click", function(e) $(".change-table-columns-visibility-button").on("click", function(e)
{ {
e.preventDefault();
var dataTableSelector = $(e.currentTarget).attr("data-table-selector"); var dataTableSelector = $(e.currentTarget).attr("data-table-selector");
var dataTable = $(dataTableSelector).DataTable(); var dataTable = $(dataTableSelector).DataTable();

View File

@ -122,12 +122,12 @@ $('.input-group-chore-period-type').on('change', function(e)
$(".period-type-input").addClass("d-none"); $(".period-type-input").addClass("d-none");
$(".period-type-" + periodType).removeClass("d-none"); $(".period-type-" + periodType).removeClass("d-none");
$('#chore-period-type-info').attr("title", ""); $('#chore-period-type-info').attr("data-original-title", "");
$("#period_config").val(""); $("#period_config").val("");
if (periodType === 'manually') if (periodType === 'manually')
{ {
$('#chore-period-type-info').attr("title", __t('This means the next execution of this chore is not scheduled')); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is not scheduled'));
} }
else if (periodType === 'dynamic-regular') else if (periodType === 'dynamic-regular')
{ {
@ -135,32 +135,32 @@ $('.input-group-chore-period-type').on('change', function(e)
$("#period_days").attr("min", "0"); $("#period_days").attr("min", "0");
$("#period_days").attr("max", "9999"); $("#period_days").attr("max", "9999");
$("#period_days").parent().find(".invalid-feedback").text(__t('This cannot be negative')); $("#period_days").parent().find(".invalid-feedback").text(__t('This cannot be negative'));
$('#chore-period-type-info').attr("title", __t('This means the next execution of this chore is scheduled %s days after the last execution', periodDays.toString())); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled %s days after the last execution', periodDays.toString()));
} }
else if (periodType === 'daily') else if (periodType === 'daily')
{ {
$('#chore-period-type-info').attr("title", __t('This means the next execution of this chore is scheduled 1 day after the last execution')); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled 1 day after the last execution'));
$('#chore-period-interval-info').attr("title", __t('This means the next execution of this chore should only be scheduled every %s days', periodInterval.toString())); $('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s days', periodInterval.toString()));
} }
else if (periodType === 'weekly') else if (periodType === 'weekly')
{ {
$('#chore-period-type-info').attr("title", __t('This means the next execution of this chore is scheduled 1 day after the last execution, but only for the weekdays selected below')); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled 1 day after the last execution, but only for the weekdays selected below'));
$("#period_config").val($(".period-type-weekly input:checkbox:checked").map(function() { return this.value; }).get().join(",")); $("#period_config").val($(".period-type-weekly input:checkbox:checked").map(function() { return this.value; }).get().join(","));
$('#chore-period-interval-info').attr("title", __t('This means the next execution of this chore should only be scheduled every %s weeks', periodInterval.toString())); $('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s weeks', periodInterval.toString()));
} }
else if (periodType === 'monthly') else if (periodType === 'monthly')
{ {
$('#chore-period-type-info').attr("title", __t('This means the next execution of this chore is scheduled on the below selected day of each month')); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled on the below selected day of each month'));
$("label[for='period_days']").text(__t("Day of month")); $("label[for='period_days']").text(__t("Day of month"));
$("#period_days").attr("min", "1"); $("#period_days").attr("min", "1");
$("#period_days").attr("max", "31"); $("#period_days").attr("max", "31");
$("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", "31")); $("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", "31"));
$('#chore-period-interval-info').attr("title", __t('This means the next execution of this chore should only be scheduled every %s months', periodInterval.toString())); $('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s months', periodInterval.toString()));
} }
else if (periodType === 'yearly') else if (periodType === 'yearly')
{ {
$('#chore-period-type-info').attr("title", __t('This means the next execution of this chore is scheduled 1 year after the last execution')); $('#chore-period-type-info').attr("data-original-title", __t('This means the next execution of this chore is scheduled 1 year after the last execution'));
$('#chore-period-interval-info').attr("title", __t('This means the next execution of this chore should only be scheduled every %s years', periodInterval.toString())); $('#chore-period-interval-info').attr("data-original-title", __t('This means the next execution of this chore should only be scheduled every %s years', periodInterval.toString()));
} }
Grocy.FrontendHelpers.ValidateForm('chore-form'); Grocy.FrontendHelpers.ValidateForm('chore-form');
@ -176,23 +176,23 @@ $('.input-group-chore-assignment-type').on('change', function(e)
if (assignmentType === 'no-assignment') if (assignmentType === 'no-assignment')
{ {
$('#chore-assignment-type-info').attr("title", __t('This means the next execution of this chore will not be assigned to anyone')); $('#chore-assignment-type-info').attr("data-original-title", __t('This means the next execution of this chore will not be assigned to anyone'));
} }
else if (assignmentType === 'who-least-did-first') else if (assignmentType === 'who-least-did-first')
{ {
$('#chore-assignment-type-info').attr("title", __t('This means the next execution of this chore will be assigned to the one who executed it least')); $('#chore-assignment-type-info').attr("data-original-title", __t('This means the next execution of this chore will be assigned to the one who executed it least'));
$("#assignment_config").attr("required", ""); $("#assignment_config").attr("required", "");
$("#assignment_config").removeAttr("disabled"); $("#assignment_config").removeAttr("disabled");
} }
else if (assignmentType === 'random') else if (assignmentType === 'random')
{ {
$('#chore-assignment-type-info').attr("title", __t('This means the next execution of this chore will be assigned randomly')); $('#chore-assignment-type-info').attr("data-original-title", __t('This means the next execution of this chore will be assigned randomly'));
$("#assignment_config").attr("required", ""); $("#assignment_config").attr("required", "");
$("#assignment_config").removeAttr("disabled"); $("#assignment_config").removeAttr("disabled");
} }
else if (assignmentType === 'in-alphabetical-order') else if (assignmentType === 'in-alphabetical-order')
{ {
$('#chore-assignment-type-info').attr("title", __t('This means the next execution of this chore will be assigned to the next one in alphabetical order')); $('#chore-assignment-type-info').attr("data-original-title", __t('This means the next execution of this chore will be assigned to the next one in alphabetical order'));
$("#assignment_config").attr("required", ""); $("#assignment_config").attr("required", "");
$("#assignment_config").removeAttr("disabled"); $("#assignment_config").removeAttr("disabled");
} }

View File

@ -16,7 +16,7 @@ $(".numberpicker-up-button").unbind('click').on("click", function()
$(".numberpicker").on("keyup", function() $(".numberpicker").on("keyup", function()
{ {
if ($(this).data("not-equal") && !$(this).data("not-equal").toString().isEmpty() && $(this).data("not-equal") == $(this).val()) if ($(this).attr("data-not-equal") && !$(this).attr("data-not-equal").toString().isEmpty() && $(this).attr("data-not-equal") == $(this).val())
{ {
$(this)[0].setCustomValidity("error"); $(this)[0].setCustomValidity("error");
} }

View File

@ -94,7 +94,7 @@ $(".input-group-productamountpicker").on("change", function()
var destinationAmount = amount / quFactor; var destinationAmount = amount / quFactor;
var destinationQuName = __n(destinationAmount, $("#qu_id").attr("data-destination-qu-name"), $("#qu_id").attr("data-destination-qu-name-plural")) var destinationQuName = __n(destinationAmount, $("#qu_id").attr("data-destination-qu-name"), $("#qu_id").attr("data-destination-qu-name-plural"))
if (destinationQuName == selectedQuName || Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled || amount.toString().isEmpty() || selectedQuName.toString().isEmpty()) if ($("#qu_id").attr("data-destination-qu-name") == selectedQuName || Grocy.Components.ProductAmountPicker.AllowAnyQuEnabled || amount.toString().isEmpty() || selectedQuName.toString().isEmpty())
{ {
$("#qu-conversion-info").addClass("d-none"); $("#qu-conversion-info").addClass("d-none");
} }

View File

@ -134,7 +134,8 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id); Grocy.Components.ProductAmountPicker.Reload(productDetails.product.id, productDetails.quantity_unit_stock.id);
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id); Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_stock.id);
$('#display_amount').attr('data-not-equal', productDetails.stock_amount); $('#display_amount').attr("data-stock-amount", productDetails.stock_amount)
$('#display_amount').attr('data-not-equal', productDetails.stock_amount * $("#qu_id option:selected").attr("data-qu-factor"));
if (productDetails.product.allow_partial_units_in_stock == 1) if (productDetails.product.allow_partial_units_in_stock == 1)
{ {
@ -228,9 +229,12 @@ $('#inventory-form input').keydown(function(event)
} }
}); });
$('#display_amount').on('keypress', function(e)
$('#qu_id').on('change', function(e)
{ {
$('#display_amount').trigger('change'); $('#display_amount').attr('data-not-equal', parseFloat($('#display_amount').attr('data-stock-amount')) * parseFloat($("#qu_id option:selected").attr("data-qu-factor")));
$("#display_amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s or equal %2$s', "0." + "0".repeat(parseInt(Grocy.UserSettings.stock_decimal_places_amounts) - 1) + "1", parseFloat($('#display_amount').attr('data-not-equal')).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
Grocy.FrontendHelpers.ValidateForm('inventory-form');
}); });
Grocy.Components.DateTimePicker.GetInputElement().on('change', function(e) Grocy.Components.DateTimePicker.GetInputElement().on('change', function(e)
@ -246,7 +250,7 @@ Grocy.Components.DateTimePicker.GetInputElement().on('keypress', function(e)
$('#display_amount').on('keyup', function(e) $('#display_amount').on('keyup', function(e)
{ {
var productId = Grocy.Components.ProductPicker.GetValue(); var productId = Grocy.Components.ProductPicker.GetValue();
var newAmount = parseInt($('#display_amount').val()); var newAmount = parseInt($('#amount').val());
if (productId) if (productId)
{ {

View File

@ -133,8 +133,8 @@ var calendar = $("#calendar").fullCalendar({
<h5 class="small timeago-contextual text-truncate">' + fulfillmentIconHtml + " " + fulfillmentInfoHtml + '</h5> \ <h5 class="small timeago-contextual text-truncate">' + fulfillmentIconHtml + " " + fulfillmentInfoHtml + '</h5> \
' + costsAndCaloriesPerServing + ' \ ' + costsAndCaloriesPerServing + ' \
<h5> \ <h5> \
<a class="ml-1 btn btn-outline-danger btn-xs remove-recipe-button" href="#"><i class="fas fa-trash"></i></a> \ <a class="ml-1 btn btn-outline-info btn-xs edit-meal-plan-entry-button" href="#" data-toggle="tooltip" title="' + __t("Edit this item") + '"><i class="fas fa-edit"></i></a> \
<a class="ml-1 btn btn-outline-info btn-xs edit-meal-plan-entry-button" href="#"><i class="fas fa-edit"></i></a> \ <a class="ml-1 btn btn-outline-danger btn-xs remove-recipe-button" href="#" data-toggle="tooltip" title="' + __t("Delete this item") + '"><i class="fas fa-trash"></i></a> \
<a class="ml-1 btn btn-outline-primary btn-xs recipe-order-missing-button ' + recipeOrderMissingButtonDisabledClasses + '" href="#" data-toggle="tooltip" title="' + __t("Put missing products on shopping list") + '" data-recipe-id="' + recipe.id.toString() + '" data-mealplan-servings="' + mealPlanEntry.recipe_servings + '" data-recipe-name="' + recipe.name + '" data-recipe-type="' + recipe.type + '"><i class="fas fa-cart-plus"></i></a> \ <a class="ml-1 btn btn-outline-primary btn-xs recipe-order-missing-button ' + recipeOrderMissingButtonDisabledClasses + '" href="#" data-toggle="tooltip" title="' + __t("Put missing products on shopping list") + '" data-recipe-id="' + recipe.id.toString() + '" data-mealplan-servings="' + mealPlanEntry.recipe_servings + '" data-recipe-name="' + recipe.name + '" data-recipe-type="' + recipe.type + '"><i class="fas fa-cart-plus"></i></a> \
<a class="ml-1 btn btn-outline-success btn-xs recipe-consume-button ' + recipeConsumeButtonDisabledClasses + '" href="#" data-toggle="tooltip" title="' + __t("Consume all ingredients needed by this recipe") + '" data-recipe-id="' + recipe.id.toString() + '" data-mealplan-servings="' + mealPlanEntry.recipe_servings + '" data-recipe-name="' + recipe.name + '" data-recipe-type="' + recipe.type + '"><i class="fas fa-utensils"></i></a> \ <a class="ml-1 btn btn-outline-success btn-xs recipe-consume-button ' + recipeConsumeButtonDisabledClasses + '" href="#" data-toggle="tooltip" title="' + __t("Consume all ingredients needed by this recipe") + '" data-recipe-id="' + recipe.id.toString() + '" data-mealplan-servings="' + mealPlanEntry.recipe_servings + '" data-recipe-name="' + recipe.name + '" data-recipe-type="' + recipe.type + '"><i class="fas fa-utensils"></i></a> \
<a class="ml-1 btn btn-outline-secondary btn-xs recipe-popup-button" href="#" data-toggle="tooltip" title="' + __t("Display recipe") + '" data-recipe-id="' + recipe.id.toString() + '" data-recipe-name="' + recipe.name + '" data-mealplan-servings="' + mealPlanEntry.recipe_servings + '" data-recipe-type="' + recipe.type + '"><i class="fas fa-eye"></i></a> \ <a class="ml-1 btn btn-outline-secondary btn-xs recipe-popup-button" href="#" data-toggle="tooltip" title="' + __t("Display recipe") + '" data-recipe-id="' + recipe.id.toString() + '" data-recipe-name="' + recipe.name + '" data-mealplan-servings="' + mealPlanEntry.recipe_servings + '" data-recipe-type="' + recipe.type + '"><i class="fas fa-eye"></i></a> \

View File

@ -165,6 +165,11 @@ if (Grocy.Components.ProductPicker !== undefined)
Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_purchase.id); Grocy.Components.ProductAmountPicker.SetQuantityUnit(productDetails.quantity_unit_purchase.id);
$('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_purchase_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })); $('#display_amount').val(parseFloat(Grocy.UserSettings.stock_default_purchase_amount).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }));
if (GetUriParam("flow") === "shoppinglistitemtostock")
{
$('#display_amount').val(parseFloat(GetUriParam("amount")).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }));
}
if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
{ {
if (productDetails.last_shopping_location_id != null) if (productDetails.last_shopping_location_id != null)
@ -266,23 +271,26 @@ if (Grocy.Components.ProductPicker !== undefined)
{ {
var barcode = barcodeResult[0]; var barcode = barcodeResult[0];
if (barcode.amount != null) if (barcode != null)
{ {
$("#display_amount").val(barcode.amount); if (barcode.amount != null)
$("#display_amount").select(); {
} $("#display_amount").val(barcode.amount);
$("#display_amount").select();
}
if (barcode.qu_id != null) if (barcode.qu_id != null)
{ {
Grocy.Components.ProductAmountPicker.SetQuantityUnit(barcode.qu_id); Grocy.Components.ProductAmountPicker.SetQuantityUnit(barcode.qu_id);
} }
if (barcode.shopping_location_id != null) if (barcode.shopping_location_id != null)
{ {
Grocy.Components.ShoppingLocationPicker.SetId(barcode.shopping_location_id); Grocy.Components.ShoppingLocationPicker.SetId(barcode.shopping_location_id);
} }
Grocy.FrontendHelpers.ValidateForm('purchase-form'); Grocy.FrontendHelpers.ValidateForm('purchase-form');
}
} }
}, },
function(xhr) function(xhr)
@ -406,11 +414,6 @@ $('#display_amount').on('change', function(e)
Grocy.FrontendHelpers.ValidateForm('purchase-form'); Grocy.FrontendHelpers.ValidateForm('purchase-form');
}); });
if (GetUriParam("flow") === "shoppinglistitemtostock")
{
$('#display_amount').val(parseFloat(GetUriParam("amount")).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts }));
}
function refreshPriceHint() function refreshPriceHint()
{ {
if ($('#amount').val() == 0 || $('#price').val() == 0) if ($('#amount').val() == 0 || $('#price').val() == 0)

View File

@ -92,13 +92,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm permission-MASTER_DATA_EDIT show-as-dialog-link" <a class="btn btn-info btn-sm permission-MASTER_DATA_EDIT show-as-dialog-link"
href="{{ $U('/battery/') }}{{ $battery->id }}?embedded"> href="{{ $U('/battery/') }}{{ $battery->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm battery-delete-button permission-MASTER_DATA_EDIT" <a class="btn btn-danger btn-sm battery-delete-button permission-MASTER_DATA_EDIT"
href="#" href="#"
data-battery-id="{{ $battery->id }}" data-battery-id="{{ $battery->id }}"
data-battery-name="{{ $battery->name }}"> data-battery-name="{{ $battery->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -117,7 +117,7 @@
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="left" data-placement="left"
title="{{ $__t('Track charge cycle of battery %s', FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name) }}" title="{{ $__t('Track charge cycle') }}"
data-battery-id="{{ $currentBatteryEntry->battery_id }}" data-battery-id="{{ $currentBatteryEntry->battery_id }}"
data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name }}"> data-battery-name="{{ FindObjectInArrayByPropertyValue($batteries, 'id', $currentBatteryEntry->battery_id)->name }}">
<i class="fas fa-fire"></i> <i class="fas fa-fire"></i>
@ -133,17 +133,17 @@
data-battery-id="{{ $currentBatteryEntry->battery_id }}" data-battery-id="{{ $currentBatteryEntry->battery_id }}"
type="button" type="button"
href="#"> href="#">
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show battery details') }}</span> <span class="dropdown-item-text">{{ $__t('Battery overview') }}</span>
</a> </a>
<a class="dropdown-item show-as-dialog-link" <a class="dropdown-item show-as-dialog-link"
type="button" type="button"
href="{{ $U('/batteriesjournal?embedded&battery=') }}{{ $currentBatteryEntry->battery_id }}"> href="{{ $U('/batteriesjournal?embedded&battery=') }}{{ $currentBatteryEntry->battery_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Journal for this battery') }}</span> <span class="dropdown-item-text">{{ $__t('Battery journal') }}</span>
</a> </a>
<a class="dropdown-item permission-MASTER_DATA_EDIT" <a class="dropdown-item permission-MASTER_DATA_EDIT show-as-dialog-link"
type="button" type="button"
href="{{ $U('/battery/') }}{{ $currentBatteryEntry->battery_id }}"> href="{{ $U('/battery/') }}{{ $currentBatteryEntry->battery_id }}?embedded">
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit battery') }}</span> <span class="dropdown-item-text">{{ $__t('Edit battery') }}</span>
</a> </a>
</div> </div>
</div> </div>

View File

@ -92,13 +92,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm" <a class="btn btn-info btn-sm"
href="{{ $U('/chore/') }}{{ $chore->id }}"> href="{{ $U('/chore/') }}{{ $chore->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm chore-delete-button" <a class="btn btn-danger btn-sm chore-delete-button"
href="#" href="#"
data-chore-id="{{ $chore->id }}" data-chore-id="{{ $chore->id }}"
data-chore-name="{{ $chore->name }}"> data-chore-name="{{ $chore->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -144,7 +144,7 @@
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="left" data-placement="left"
title="{{ $__t('Track execution of chore %s', FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name) }}" title="{{ $__t('Track chore execution') }}"
data-chore-id="{{ $curentChoreEntry->chore_id }}" data-chore-id="{{ $curentChoreEntry->chore_id }}"
data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}"> data-chore-name="{{ FindObjectInArrayByPropertyValue($chores, 'id', $curentChoreEntry->chore_id)->name }}">
<i class="fas fa-play"></i> <i class="fas fa-play"></i>
@ -160,17 +160,17 @@
data-chore-id="{{ $curentChoreEntry->chore_id }}" data-chore-id="{{ $curentChoreEntry->chore_id }}"
type="button" type="button"
href="#"> href="#">
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show chore details') }}</span> <span class="dropdown-item-text">{{ $__t('Chore overview') }}</span>
</a> </a>
<a class="dropdown-item show-as-dialog-link" <a class="dropdown-item show-as-dialog-link"
type="button" type="button"
href="{{ $U('/choresjournal?embedded&chore=') }}{{ $curentChoreEntry->chore_id }}"> href="{{ $U('/choresjournal?embedded&chore=') }}{{ $curentChoreEntry->chore_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Journal for this chore') }}</span> <span class="dropdown-item-text">{{ $__t('Chore journal') }}</span>
</a> </a>
<a class="dropdown-item permission-MASTER_DATA_EDIT" <a class="dropdown-item permission-MASTER_DATA_EDIT"
type="button" type="button"
href="{{ $U('/chore/') }}{{ $curentChoreEntry->chore_id }}"> href="{{ $U('/chore/') }}{{ $curentChoreEntry->chore_id }}">
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit chore') }}</span> <span class="dropdown-item-text">{{ $__t('Edit chore') }}</span>
</a> </a>
</div> </div>
</div> </div>

View File

@ -16,7 +16,7 @@
class="btn btn-sm btn-outline-secondary py-0 mr-1 float-right disabled show-as-dialog-link" class="btn btn-sm btn-outline-secondary py-0 mr-1 float-right disabled show-as-dialog-link"
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('Journal for this chore') }}"> title="{{ $__t('Chore journal') }}">
<i class="fas fa-file-alt"></i> <i class="fas fa-file-alt"></i>
</a> </a>
</div> </div>

View File

@ -17,14 +17,14 @@
class="btn btn-sm btn-outline-secondary py-0 mr-1 float-right disabled show-as-dialog-link" class="btn btn-sm btn-outline-secondary py-0 mr-1 float-right disabled show-as-dialog-link"
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('Stock journal for this product') }}"> title="{{ $__t('Stock journal') }}">
<i class="fas fa-file-alt"></i> <i class="fas fa-file-alt"></i>
</a> </a>
<a id="productcard-product-stock-button" <a id="productcard-product-stock-button"
class="btn btn-sm btn-outline-info py-0 mr-1 float-right disabled show-as-dialog-link" class="btn btn-sm btn-outline-info py-0 mr-1 float-right disabled show-as-dialog-link"
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ $__t('Stock entries for this product') }}"> title="{{ $__t('Stock entries') }}">
<i class="fas fa-boxes"></i> <i class="fas fa-boxes"></i>
</a> </a>
</div> </div>

View File

@ -81,13 +81,17 @@
<tr data-equipment-id="{{ $equipmentItem->id }}"> <tr data-equipment-id="{{ $equipmentItem->id }}">
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm hide-when-embedded hide-on-fullscreen-card" <a class="btn btn-info btn-sm hide-when-embedded hide-on-fullscreen-card"
href="{{ $U('/equipment/') }}{{ $equipmentItem->id }}"> href="{{ $U('/equipment/') }}{{ $equipmentItem->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-sm btn-danger hide-when-embedded hide-on-fullscreen-card equipment-delete-button" <a class="btn btn-sm btn-danger hide-when-embedded hide-on-fullscreen-card equipment-delete-button"
href="#" href="#"
data-equipment-id="{{ $equipmentItem->id }}" data-equipment-id="{{ $equipmentItem->id }}"
data-equipment-name="{{ $equipmentItem->name }}"> data-equipment-name="{{ $equipmentItem->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -81,11 +81,11 @@
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)
@include('components.numberpicker', array( @include('components.numberpicker', array(
'id' => 'price', 'id' => 'price',
'label' => 'Price per stock unit', 'label' => 'Price',
'min' => 0, 'min' => 0,
'decimals' => $userSettings['stock_decimal_places_prices'], 'decimals' => $userSettings['stock_decimal_places_prices'],
'value' => '', 'value' => '',
'hint' => $__t('in %s per purchase quantity unit', GROCY_CURRENCY), 'hint' => $__t('Per stock quantity unit', GROCY_CURRENCY),
'additionalHtmlContextHelp' => '<i class="fas fa-question-circle" 'additionalHtmlContextHelp' => '<i class="fas fa-question-circle"
data-toggle="tooltip" data-toggle="tooltip"
title="' . $__t('This will apply to added products') . '"></i>', title="' . $__t('This will apply to added products') . '"></i>',

View File

@ -91,13 +91,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" <a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/location/') }}{{ $location->id }}?embedded"> href="{{ $U('/location/') }}{{ $location->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm location-delete-button" <a class="btn btn-danger btn-sm location-delete-button"
href="#" href="#"
data-location-id="{{ $location->id }}" data-location-id="{{ $location->id }}"
data-location-name="{{ $location->name }}"> data-location-name="{{ $location->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -97,13 +97,17 @@
<a class="btn btn-danger btn-sm apikey-delete-button" <a class="btn btn-danger btn-sm apikey-delete-button"
href="#" href="#"
data-apikey-id="{{ $apiKey->id }}" data-apikey-id="{{ $apiKey->id }}"
data-apikey-apikey="{{ $apiKey->api_key }}"> data-apikey-apikey="{{ $apiKey->api_key }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
<a class="btn btn-info btn-sm apikey-show-qr-button" <a class="btn btn-info btn-sm apikey-show-qr-button"
href="#" href="#"
data-apikey-key="{{ $apiKey->api_key }}" data-apikey-key="{{ $apiKey->api_key }}"
data-apikey-type="{{ $apiKey->key_type }}"> data-apikey-type="{{ $apiKey->key_type }}"
data-toggle="tooltip"
title="{{ $__t('Show a QR-Code for this API key') }}">
<i class="fas fa-qrcode"></i> <i class="fas fa-qrcode"></i>
</a> </a>
</td> </td>

View File

@ -91,13 +91,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" <a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/productgroup/') }}{{ $productGroup->id }}?embedded"> href="{{ $U('/productgroup/') }}{{ $productGroup->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm product-group-delete-button" <a class="btn btn-danger btn-sm product-group-delete-button"
href="#" href="#"
data-group-id="{{ $productGroup->id }}" data-group-id="{{ $productGroup->id }}"
data-group-name="{{ $productGroup->name }}"> data-group-name="{{ $productGroup->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -113,18 +113,24 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm" <a class="btn btn-info btn-sm"
href="{{ $U('/product/') }}{{ $product->id }}"> href="{{ $U('/product/') }}{{ $product->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm product-delete-button @if($product->active == 0) disabled @endif" <a class="btn btn-danger btn-sm product-delete-button @if($product->active == 0) disabled @endif"
href="#" href="#"
data-product-id="{{ $product->id }}" data-product-id="{{ $product->id }}"
data-product-name="{{ $product->name }}"> data-product-name="{{ $product->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>
<td> <td>
@if($product->active == 0) (deactivated) @endif {{ $product->name }}@if(!empty($product->picture_file_name)) <i class="fas fa-image text-muted"></i>@endif @if($product->active == 0) (deactivated) @endif {{ $product->name }}@if(!empty($product->picture_file_name)) <i class="fas fa-image text-muted"
data-toggle="tooltip"
title="{{ $__t('This product has a picture') }}"></i>@endif
</td> </td>
<td class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif"> <td class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif">
{{ FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id)->name }} {{ FindObjectInArrayByPropertyValue($locations, 'id', $product->location_id)->name }}

View File

@ -90,13 +90,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm" <a class="btn btn-info btn-sm"
href="{{ $U('/quantityunit/') }}{{ $quantityunit->id }}"> href="{{ $U('/quantityunit/') }}{{ $quantityunit->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm quantityunit-delete-button" <a class="btn btn-danger btn-sm quantityunit-delete-button"
href="#" href="#"
data-quantityunit-id="{{ $quantityunit->id }}" data-quantityunit-id="{{ $quantityunit->id }}"
data-quantityunit-name="{{ $quantityunit->name }}"> data-quantityunit-name="{{ $quantityunit->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -125,13 +125,17 @@
data-recipe-id="{{ $recipe->id }}"> data-recipe-id="{{ $recipe->id }}">
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm hide-when-embedded hide-on-fullscreen-card" <a class="btn btn-info btn-sm hide-when-embedded hide-on-fullscreen-card"
href="{{ $U('/recipe/') }}{{ $recipe->id }}"> href="{{ $U('/recipe/') }}{{ $recipe->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-sm btn-danger hide-when-embedded hide-on-fullscreen-card recipe-delete" <a class="btn btn-sm btn-danger hide-when-embedded hide-on-fullscreen-card recipe-delete"
href="#" href="#"
data-recipe-id="{{ $recipe->id }}" data-recipe-id="{{ $recipe->id }}"
data-recipe-name="{{ $recipe->name }}"> data-recipe-name="{{ $recipe->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -17,12 +17,14 @@
<div class="col-lg-6 col-xs-12"> <div class="col-lg-6 col-xs-12">
<h4 class="mt-2">{{ $__t('Recipe card') }}</h4> <h4 class="mt-2">{{ $__t('Recipe card') }}</h4>
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="custom-control custom-checkbox">
<label for="recipe_ingredients_group_by_product_group"> <input type="checkbox"
<input type="checkbox" class="form-check-input custom-control-input user-setting-control"
class="user-setting-control" id="recipe_ingredients_group_by_product_group"
id="recipe_ingredients_group_by_product_group" data-setting-key="recipe_ingredients_group_by_product_group">
data-setting-key="recipe_ingredients_group_by_product_group"> {{ $__t('Group ingredients by their product group') }} <label class="form-check-label custom-control-label"
for="recipe_ingredients_group_by_product_group">
{{ $__t('Group ingredients by their product group') }}
</label> </label>
</div> </div>
</div> </div>

View File

@ -17,26 +17,28 @@
<div class="col-lg-6 col-xs-12"> <div class="col-lg-6 col-xs-12">
<h4 class="mt-2">{{ $__t('Shopping list') }}</h4> <h4 class="mt-2">{{ $__t('Shopping list') }}</h4>
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="custom-control custom-checkbox">
<label for="shopping-list-show-calendar"> <input type="checkbox"
<input type="checkbox" class="form-check-input custom-control-input user-setting-control"
class="user-setting-control" id="shopping_list_show_calendar"
id="shopping-list-show-calendar" data-setting-key="shopping_list_show_calendar">
name="shopping-list-show-calendar" <label class="form-check-label custom-control-label"
data-setting-key="shopping_list_show_calendar"> {{ $__t('Show a month-view calendar') }} for="shopping_list_show_calendar">
{{ $__t('Show a month-view calendar') }}
</label> </label>
</div> </div>
</div> </div>
<h4 class="mt-2">{{ $__t('Shopping list to stock workflow') }}</h4> <h4 class="mt-2">{{ $__t('Shopping list to stock workflow') }}</h4>
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="custom-control custom-checkbox">
<label for="shopping-list-to-stock-workflow-auto-submit-when-prefilled"> <input type="checkbox"
<input type="checkbox" class="form-check-input custom-control-input user-setting-control"
class="user-setting-control" id="shopping_list_to_stock_workflow_auto_submit_when_prefilled"
id="shopping-list-to-stock-workflow-auto-submit-when-prefilled" data-setting-key="shopping_list_to_stock_workflow_auto_submit_when_prefilled">
name="shopping-list-to-stock-workflow-auto-submit-when-prefilled" <label class="form-check-label custom-control-label"
data-setting-key="shopping_list_to_stock_workflow_auto_submit_when_prefilled"> {{ $__t('Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set') }} for="shopping_list_to_stock_workflow_auto_submit_when_prefilled">
{{ $__t('Automatically do the booking using the last price and the amount of the shopping list item, if the product has "Default best before days" set') }}
</label> </label>
</div> </div>
</div> </div>

View File

@ -91,13 +91,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" <a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/shoppinglocation/') }}{{ $shoppinglocation->id }}?embedded"> href="{{ $U('/shoppinglocation/') }}{{ $shoppinglocation->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm shoppinglocation-delete-button" <a class="btn btn-danger btn-sm shoppinglocation-delete-button"
href="#" href="#"
data-shoppinglocation-id="{{ $shoppinglocation->id }}" data-shoppinglocation-id="{{ $shoppinglocation->id }}"
data-shoppinglocation-name="{{ $shoppinglocation->name }}"> data-shoppinglocation-name="{{ $shoppinglocation->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -139,23 +139,6 @@
<i class="fas fa-list"></i> {{ $__t('Inventory') }} <i class="fas fa-list"></i> {{ $__t('Inventory') }}
</a> </a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item product-name-cell"
data-product-id="{{ $stockEntry->product_id }}"
type="button"
href="#">
<i class="fas fa-info"></i> {{ $__t('Show product details') }}
</a>
<a class="dropdown-item"
type="button"
href="{{ $U('/stockjournal?product=') }}{{ $stockEntry->product_id }}">
<i class="fas fa-file-alt"></i> {{ $__t('Stock journal for this product') }}
</a>
<a class="dropdown-item"
type="button"
href="{{ $U('/product/') }}{{ $stockEntry->product_id . '?returnto=/stockentries' }}">
<i class="fas fa-edit"></i> {{ $__t('Edit product') }}
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item stock-consume-button stock-consume-button-spoiled @if($stockEntry->amount < 1) disabled @endif" <a class="dropdown-item stock-consume-button stock-consume-button-spoiled @if($stockEntry->amount < 1) disabled @endif"
type="button" type="button"
href="#" href="#"
@ -166,15 +149,37 @@
data-stockrow-id="{{ $stockEntry->id }}" data-stockrow-id="{{ $stockEntry->id }}"
data-location-id="{{ $stockEntry->location_id }}" data-location-id="{{ $stockEntry->location_id }}"
data-consume-amount="1"> data-consume-amount="1">
<i class="fas fa-utensils"></i> {{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name) }} {{ $__t('Consume this stock entry as spoiled', '1 ' . FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->qu_id_stock)->name, FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name) }}
</a> </a>
@if(GROCY_FEATURE_FLAG_RECIPES) @if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item" <a class="dropdown-item"
type="button" type="button"
href="{{ $U('/recipes?search=') }}{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}"> href="{{ $U('/recipes?search=') }}{{ FindObjectInArrayByPropertyValue($products, 'id', $stockEntry->product_id)->name }}">
<i class="fas fa-cocktail"></i> {{ $__t('Search for recipes containing this product') }} {{ $__t('Search for recipes containing this product') }}
</a> </a>
@endif @endif
<div class="dropdown-divider"></div>
<a class="dropdown-item product-name-cell"
data-product-id="{{ $stockEntry->product_id }}"
type="button"
href="#">
{{ $__t('Product overview') }}
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockjournal?embedded&product=') }}{{ $stockEntry->product_id }}">
{{ $__t('Stock journal') }}
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockjournal/summary?embedded&product=') }}{{ $stockEntry->product_id }}">
{{ $__t('Stock journal summary') }}
</a>
<a class="dropdown-item"
type="button"
href="{{ $U('/product/') }}{{ $stockEntry->product_id . '?returnto=/stockentries' }}">
{{ $__t('Edit product') }}
</a>
</div> </div>
</div> </div>
</td> </td>

View File

@ -57,7 +57,7 @@
'id' => 'amount', 'id' => 'amount',
'value' => $stockEntry->amount, 'value' => $stockEntry->amount,
'label' => 'Amount', 'label' => 'Amount',
'hintId' => 'amount_qu_unit', 'contextInfoId' => 'amount_qu_unit',
'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'), 'invalidFeedback' => $__t('The amount cannot be lower than %s', '0'),
'additionalAttributes' => 'data-not-equal="-1"', 'additionalAttributes' => 'data-not-equal="-1"',
'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info" 'additionalHtmlContextHelp' => '<div id="tare-weight-handling-info"
@ -81,7 +81,7 @@
'label' => 'Price', 'label' => 'Price',
'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_prices'] - 1) . '1', 'min' => '0.' . str_repeat('0', $userSettings['stock_decimal_places_prices'] - 1) . '1',
'decimals' => $userSettings['stock_decimal_places_prices'], 'decimals' => $userSettings['stock_decimal_places_prices'],
'hint' => $__t('in %s per purchase quantity unit', GROCY_CURRENCY), 'hint' => $__t('Per stock quantity unit'),
'invalidFeedback' => $__t('The price cannot be lower than %s', '0'), 'invalidFeedback' => $__t('The price cannot be lower than %s', '0'),
'isRequired' => false 'isRequired' => false
)) ))

View File

@ -85,8 +85,8 @@
</th> </th>
<th>{{ $__t('Product') }}</th> <th>{{ $__t('Product') }}</th>
<th>{{ $__t('Amount') }}</th> <th>{{ $__t('Amount') }}</th>
<th>{{ $__t('Booking time') }}</th> <th>{{ $__t('Transaction time') }}</th>
<th>{{ $__t('Booking type') }}</th> <th>{{ $__t('Transaction type') }}</th>
<th class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif">{{ $__t('Location') }}</th> <th class="@if(!GROCY_FEATURE_FLAG_STOCK_LOCATION_TRACKING) d-none @endif">{{ $__t('Location') }}</th>
<th>{{ $__t('Done by') }}</th> <th>{{ $__t('Done by') }}</th>
</tr> </tr>
@ -102,7 +102,7 @@
data-booking-id="{{ $stockLogEntry->id }}" data-booking-id="{{ $stockLogEntry->id }}"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="left" data-placement="left"
title="{{ $__t('Undo booking') }}"> title="{{ $__t('Undo transaction') }}">
<i class="fas fa-undo"></i> <i class="fas fa-undo"></i>
</a> </a>
</td> </td>

View File

@ -20,7 +20,7 @@
<thead> <thead>
<tr> <tr>
<th>{{ $__t('Product') }}</th> <th>{{ $__t('Product') }}</th>
<th>{{ $__t('Booking type') }}</th> <th>{{ $__t('Transaction type') }}</th>
<th>{{ $__t('User') }}</th> <th>{{ $__t('User') }}</th>
<th>{{ $__t('Amount') }}</th> <th>{{ $__t('Amount') }}</th>
</tr> </tr>

View File

@ -257,34 +257,6 @@
<span class="dropdown-item-icon"><i class="fas fa-list"></i></span> <span class="dropdown-item-text">{{ $__t('Inventory') }}</span> <span class="dropdown-item-icon"><i class="fas fa-list"></i></span> <span class="dropdown-item-text">{{ $__t('Inventory') }}</span>
</a> </a>
<div class="dropdown-divider"></div> <div class="dropdown-divider"></div>
<a class="dropdown-item product-name-cell"
data-product-id="{{ $currentStockEntry->product_id }}"
type="button"
href="#">
<span class="dropdown-item-icon"><i class="fas fa-info"></i></span> <span class="dropdown-item-text">{{ $__t('Show product details') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockentries?embedded&product=') }}{{ $currentStockEntry->product_id }}"
data-product-id="{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-icon"><i class="fas fa-boxes"></i></span> <span class="dropdown-item-text">{{ $__t('Show stock entries') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockjournal?embedded&product=') }}{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-alt"></i></span> <span class="dropdown-item-text">{{ $__t('Stock journal for this product') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockjournal/summary?embedded&product_id=') }}{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-icon"><i class="fas fa-file-archive"></i></span> <span class="dropdown-item-text">{{ $__t('Journal summary for this product') }}</span>
</a>
<a class="dropdown-item permission-MASTER_DATA_EDIT"
type="button"
href="{{ $U('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}">
<span class="dropdown-item-icon"><i class="fas fa-edit"></i></span> <span class="dropdown-item-text">{{ $__t('Edit product') }}</span>
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item product-consume-button product-consume-button-spoiled permission-STOCK_CONSUME @if($currentStockEntry->amount < 1) disabled @endif" <a class="dropdown-item product-consume-button product-consume-button-spoiled permission-STOCK_CONSUME @if($currentStockEntry->amount < 1) disabled @endif"
type="button" type="button"
href="#" href="#"
@ -292,15 +264,43 @@
data-product-name="{{ $currentStockEntry->product_name }}" data-product-name="{{ $currentStockEntry->product_name }}"
data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}" data-product-qu-name="{{ $currentStockEntry->qu_unit_name }}"
data-consume-amount="1"> data-consume-amount="1">
<span class="dropdown-item-icon"><i class="fas fa-utensils"></i></span> <span class="dropdown-item-text">{{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}</span> <span class="dropdown-item-text">{{ $__t('Consume %1$s of %2$s as spoiled', '1 ' . $currentStockEntry->qu_unit_name, $currentStockEntry->product_name) }}</span>
</a> </a>
@if(GROCY_FEATURE_FLAG_RECIPES) @if(GROCY_FEATURE_FLAG_RECIPES)
<a class="dropdown-item" <a class="dropdown-item"
type="button" type="button"
href="{{ $U('/recipes?search=') }}{{ $currentStockEntry->product_name }}"> href="{{ $U('/recipes?search=') }}{{ $currentStockEntry->product_name }}">
<span class="dropdown-item-icon"><i class="fas fa-cocktail"></i></span> <span class="dropdown-item-text">{{ $__t('Search for recipes containing this product') }}</span> <span class="dropdown-item-text">{{ $__t('Search for recipes containing this product') }}</span>
</a> </a>
@endif @endif
<div class="dropdown-divider"></div>
<a class="dropdown-item product-name-cell"
data-product-id="{{ $currentStockEntry->product_id }}"
type="button"
href="#">
<span class="dropdown-item-text">{{ $__t('Product overview') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockentries?embedded&product=') }}{{ $currentStockEntry->product_id }}"
data-product-id="{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-text">{{ $__t('Stock entries') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockjournal?embedded&product=') }}{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-text">{{ $__t('Stock journal') }}</span>
</a>
<a class="dropdown-item show-as-dialog-link"
type="button"
href="{{ $U('/stockjournal/summary?embedded&product_id=') }}{{ $currentStockEntry->product_id }}">
<span class="dropdown-item-text">{{ $__t('Stock journal summary') }}</span>
</a>
<a class="dropdown-item permission-MASTER_DATA_EDIT"
type="button"
href="{{ $U('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}">
<span class="dropdown-item-text">{{ $__t('Edit product') }}</span>
</a>
</div> </div>
</div> </div>
</td> </td>
@ -326,7 +326,9 @@
@endif @endif
@if(boolval($userSettings['show_icon_on_stock_overview_page_when_product_is_on_shopping_list'])) @if(boolval($userSettings['show_icon_on_stock_overview_page_when_product_is_on_shopping_list']))
@if($currentStockEntry->on_shopping_list) @if($currentStockEntry->on_shopping_list)
<span class="btn btn-link btn-sm text-muted"> <span class="text-muted cursor-normal"
data-toggle="tooltip"
title="{{ $__t('This product is currently on a shopping list') }}">
<i class="fas fa-shopping-cart"></i> <i class="fas fa-shopping-cart"></i>
</span> </span>
@endif @endif

View File

@ -68,12 +68,14 @@
)) ))
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="custom-control custom-checkbox">
<label for="show_icon_on_stock_overview_page_when_product_is_on_shopping_list"> <input type="checkbox"
<input type="checkbox" class="form-check-input custom-control-input user-setting-control"
class="user-setting-control" id="show_icon_on_stock_overview_page_when_product_is_on_shopping_list"
id="show_icon_on_stock_overview_page_when_product_is_on_shopping_list" data-setting-key="show_icon_on_stock_overview_page_when_product_is_on_shopping_list">
data-setting-key="show_icon_on_stock_overview_page_when_product_is_on_shopping_list"> {{ $__t('Show an icon if the product is already on the shopping list') }} <label class="form-check-label custom-control-label"
for="show_icon_on_stock_overview_page_when_product_is_on_shopping_list">
{{ $__t('Show an icon if the product is already on the shopping list') }}
</label> </label>
</div> </div>
</div> </div>
@ -90,12 +92,14 @@
)) ))
<div class="form-group"> <div class="form-group">
<div class="checkbox"> <div class="custom-control custom-checkbox">
<label for="show_purchased_date_on_purchase"> <input type="checkbox"
<input type="checkbox" class="form-check-input custom-control-input user-setting-control"
class="user-setting-control" id="show_purchased_date_on_purchase"
id="show_purchased_date_on_purchase" data-setting-key="show_purchased_date_on_purchase">
data-setting-key="show_purchased_date_on_purchase"> {{ $__t('Show purchased date on purchase and inventory page (otherwise the purchased date defaults to today)') }} <label class="form-check-label custom-control-label"
for="show_purchased_date_on_purchase">
{{ $__t('Show purchased date on purchase and inventory page (otherwise the purchased date defaults to today)') }}
</label> </label>
</div> </div>
</div> </div>

View File

@ -91,13 +91,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" <a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/taskcategory/') }}{{ $taskCategory->id }}?embedded"> href="{{ $U('/taskcategory/') }}{{ $taskCategory->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm task-category-delete-button" <a class="btn btn-danger btn-sm task-category-delete-button"
href="#" href="#"
data-category-id="{{ $taskCategory->id }}" data-category-id="{{ $taskCategory->id }}"
data-category-name="{{ $taskCategory->name }}"> data-category-name="{{ $taskCategory->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -136,7 +136,7 @@
href="#" href="#"
data-toggle="tooltip" data-toggle="tooltip"
data-placement="left" data-placement="left"
title="{{ $__t('Mark task "%s" as completed', $task->name) }}" title="{{ $__t('Mark task as completed') }}"
data-task-id="{{ $task->id }}" data-task-id="{{ $task->id }}"
data-task-name="{{ $task->name }}"> data-task-name="{{ $task->name }}">
<i class="fas fa-check"></i> <i class="fas fa-check"></i>
@ -152,16 +152,20 @@
<i class="fas fa-undo"></i> <i class="fas fa-undo"></i>
</a> </a>
@endif @endif
<a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/task/') }}{{ $task->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i>
</a>
<a class="btn btn-sm btn-danger delete-task-button" <a class="btn btn-sm btn-danger delete-task-button"
href="#" href="#"
data-task-id="{{ $task->id }}" data-task-id="{{ $task->id }}"
data-task-name="{{ $task->name }}"> data-task-name="{{ $task->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
<a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/task/') }}{{ $task->id }}?embedded">
<i class="fas fa-edit"></i>
</a>
</td> </td>
<td id="task-{{ $task->id }}-name" <td id="task-{{ $task->id }}-name"
class="@if($task->done == 1) text-strike-through @endif"> class="@if($task->done == 1) text-strike-through @endif">

View File

@ -82,13 +82,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" <a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/userentity/') }}{{ $userentity->id }}?embedded"> href="{{ $U('/userentity/') }}{{ $userentity->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm userentity-delete-button" <a class="btn btn-danger btn-sm userentity-delete-button"
href="#" href="#"
data-userentity-id="{{ $userentity->id }}" data-userentity-id="{{ $userentity->id }}"
data-userentity-name="{{ $userentity->name }}"> data-userentity-name="{{ $userentity->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
<a class="btn btn-secondary btn-sm" <a class="btn btn-secondary btn-sm"

View File

@ -98,13 +98,17 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm show-as-dialog-link" <a class="btn btn-info btn-sm show-as-dialog-link"
href="{{ $U('/userfield/') }}{{ $userfield->id }}?embedded"> href="{{ $U('/userfield/') }}{{ $userfield->id }}?embedded"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm userfield-delete-button" <a class="btn btn-danger btn-sm userfield-delete-button"
href="#" href="#"
data-userfield-id="{{ $userfield->id }}" data-userfield-id="{{ $userfield->id }}"
data-userfield-name="{{ $userfield->name }}"> data-userfield-name="{{ $userfield->name }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -88,12 +88,16 @@
<tr> <tr>
<td class="fit-content border-right d-print-none"> <td class="fit-content border-right d-print-none">
<a class="btn btn-info btn-sm" <a class="btn btn-info btn-sm"
href="{{ $U('/userobject/' . $userentity->name . '/') }}{{ $userobject->id }}"> href="{{ $U('/userobject/' . $userentity->name . '/') }}{{ $userobject->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-danger btn-sm userobject-delete-button" <a class="btn btn-danger btn-sm userobject-delete-button"
href="#" href="#"
data-userobject-id="{{ $userobject->id }}"> data-userobject-id="{{ $userobject->id }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>

View File

@ -83,17 +83,23 @@
<tr> <tr>
<td class="fit-content border-right"> <td class="fit-content border-right">
<a class="btn btn-info btn-sm" <a class="btn btn-info btn-sm"
href="{{ $U('/user/') }}{{ $user->id }}"> href="{{ $U('/user/') }}{{ $user->id }}"
data-toggle="tooltip"
title="{{ $__t('Edit this item') }}">
<i class="fas fa-edit"></i> <i class="fas fa-edit"></i>
</a> </a>
<a class="btn btn-info btn-sm" <a class="btn btn-info btn-sm"
href="{{ $U('/user/' . $user->id . '/permissions') }}"> href="{{ $U('/user/' . $user->id . '/permissions') }}"
data-toggle="tooltip"
title="{{ $__t('Configure user permissions') }}">
<i class="fas fa-lock"></i> <i class="fas fa-lock"></i>
</a> </a>
<a class="btn btn-danger btn-sm user-delete-button @if($user->id == GROCY_USER_ID) disabled @endif" <a class="btn btn-danger btn-sm user-delete-button @if($user->id == GROCY_USER_ID) disabled @endif"
href="#" href="#"
data-user-id="{{ $user->id }}" data-user-id="{{ $user->id }}"
data-user-username="{{ $user->username }}"> data-user-username="{{ $user->username }}"
data-toggle="tooltip"
title="{{ $__t('Delete this item') }}">
<i class="fas fa-trash"></i> <i class="fas fa-trash"></i>
</a> </a>
</td> </td>