stockentryform amount doesn't need to handle tare weight

This commit is contained in:
Bernd Bestel
2020-11-14 22:54:29 +01:00
parent 28276191cc
commit db5c9ce3e8
3 changed files with 1 additions and 15 deletions

View File

@@ -58,7 +58,7 @@ _- (Because the stock quantity unit is now the base for everything, it cannot be
- Fixed that the aggregated amount of parent products was wrong on the stock overview page when the child products had not the same stock quantity units - Fixed that the aggregated amount of parent products was wrong on the stock overview page when the child products had not the same stock quantity units
- Fixed that edited stock entries were not considered for the price history chart on the product card - Fixed that edited stock entries were not considered for the price history chart on the product card
- Fixed that `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is set to `false`, the purchase page validation failed (thanks @fipwmaqzufheoxq92ebc) - Fixed that `FEATURE_FLAG_STOCK_BEST_BEFORE_DATE_TRACKING` is set to `false`, the purchase page validation failed (thanks @fipwmaqzufheoxq92ebc)
- Fixed that consuming products with enabled tare weight handling did not work on the stock entries page (also fixed that opening those products is not possible there) - Fixed that consuming (and editing the amount of) products with enabled tare weight handling did not work on the stock entries page
- Fixed that the recipes dropdown on the consume page also displayed internal recipes (thanks @kriddles) - Fixed that the recipes dropdown on the consume page also displayed internal recipes (thanks @kriddles)
- Fixed that opening tare weight handling enabled products is not possible via the UI and the API (as this makes no sense) - Fixed that opening tare weight handling enabled products is not possible via the UI and the API (as this makes no sense)

View File

@@ -109,18 +109,6 @@ Grocy.Api.Get('stock/products/' + Grocy.EditObjectProductId,
$("#amount").attr("step", "1"); $("#amount").attr("step", "1");
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s', '1')); $("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s', '1'));
} }
if (productDetails.product.enable_tare_weight_handling == 1)
{
$("#amount").attr("min", productDetails.product.tare_weight);
$("#amount").parent().find(".invalid-feedback").text(__t('The amount cannot be lower than %1$s', parseFloat(productDetails.product.tare_weight).toLocaleString({ minimumFractionDigits: 0, maximumFractionDigits: Grocy.UserSettings.stock_decimal_places_amounts })));
$("#tare-weight-handling-info").removeClass("d-none");
}
else
{
$("#tare-weight-handling-info").addClass("d-none");
}
}, },
function(xhr) function(xhr)
{ {

View File

@@ -60,8 +60,6 @@
'contextInfoId' => '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"
class="text-small text-info font-italic d-none">' . $__t('Tare weight handling enabled - please weigh the whole container, the amount to be posted will be automatically calculcated') . '</div>'
)) ))
@if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) @if(GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING)