From d64a1a546c4cd773b38e7f7a6c935687ebc40e4f Mon Sep 17 00:00:00 2001 From: Bernd Bestel Date: Sat, 25 Jan 2020 19:42:46 +0100 Subject: [PATCH] Finalize products on meal plan feature (references #450) --- public/viewjs/mealplan.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/public/viewjs/mealplan.js b/public/viewjs/mealplan.js index 7801973d..4d465037 100644 --- a/public/viewjs/mealplan.js +++ b/public/viewjs/mealplan.js @@ -172,8 +172,7 @@ var calendar = $("#calendar").fullCalendar({ } element.attr("data-product-details", event.productDetails); - console.log(productDetails); - console.log(mealPlanEntry); + var productOrderMissingButtonDisabledClasses = "disabled"; if (parseFloat(productDetails.stock_amount_aggregated) < parseFloat(mealPlanEntry.product_amount)) { @@ -197,7 +196,7 @@ var calendar = $("#calendar").fullCalendar({ var costsAndCaloriesPerServing = "" if (Grocy.FeatureFlags.GROCY_FEATURE_FLAG_STOCK_PRICE_TRACKING) { - costsAndCaloriesPerServing = '
' + productDetails.last_price * mealPlanEntry.product_amount + ' / ' + productDetails.product.calories * mealPlanEntry.product_amount + ' kcal ' + '
'; + costsAndCaloriesPerServing = '
' + productDetails.last_price / productDetails.product.qu_factor_purchase_to_stock * mealPlanEntry.product_amount + ' / ' + productDetails.product.calories * mealPlanEntry.product_amount + ' kcal ' + '
'; } else {