From 9e99edf6f6f4c2c88509721ab0e9860771b9ee2f Mon Sep 17 00:00:00 2001 From: vabene1111 Date: Thu, 2 Jan 2025 09:39:47 +0100 Subject: [PATCH] shopping fixes --- .../dialogs/ShoppingLineItemDialog.vue | 3 ++ .../components/display/ShoppingLineItem.vue | 32 +++++++++++-------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/vue3/src/components/dialogs/ShoppingLineItemDialog.vue b/vue3/src/components/dialogs/ShoppingLineItemDialog.vue index 3629bc5a95..9637903ea5 100644 --- a/vue3/src/components/dialogs/ShoppingLineItemDialog.vue +++ b/vue3/src/components/dialogs/ShoppingLineItemDialog.vue @@ -58,6 +58,9 @@ {{ e.food.name }} + + {{$t('Completed')}} {{DateTime.fromJSDate(e.completedAt).toLocaleString(DateTime.DATETIME_SHORT)}} + {{ e.recipeMealplan.servings }} x diff --git a/vue3/src/components/display/ShoppingLineItem.vue b/vue3/src/components/display/ShoppingLineItem.vue index bb6a1948fa..0da08ed629 100644 --- a/vue3/src/components/display/ShoppingLineItem.vue +++ b/vue3/src/components/display/ShoppingLineItem.vue @@ -167,24 +167,30 @@ const infoRow = computed(() => { for (let i in entries.value) { let e = entries.value[i] - if (authors.indexOf(e.createdBy.displayName) === -1) { - authors.push(e.createdBy.displayName) - } + if (!e.checked && !isDelayed(e) + || (e.checked && useUserPreferenceStore().deviceSettings.shopping_show_checked_entries) + || (isDelayed(e) && useUserPreferenceStore().deviceSettings.shopping_show_delayed_entries)) { - if (e.listRecipe != null) { - if (e.listRecipeData.recipe != null) { - let recipe_name = e.listRecipeData.recipeData.name - if (recipes.indexOf(recipe_name) === -1) { - recipes.push(recipe_name.substring(0, 14) + (recipe_name.length > 14 ? '..' : '')) - } + if (authors.indexOf(e.createdBy.displayName) === -1) { + authors.push(e.createdBy.displayName) } - if (e.listRecipeData.mealplan != null) { - let meal_plan_entry = (e.listRecipeData.mealPlanData.mealType.name.substring(0, 8) || '') + ' (' + DateTime.fromJSDate(e.listRecipeData.mealPlanData.fromDate).toLocaleString(DateTime.DATE_SHORT) + ')' - if (meal_pans.indexOf(meal_plan_entry) === -1) { - meal_pans.push(meal_plan_entry) + if (e.listRecipe != null) { + if (e.listRecipeData.recipe != null) { + let recipe_name = e.listRecipeData.recipeData.name + if (recipes.indexOf(recipe_name) === -1) { + recipes.push(recipe_name.substring(0, 14) + (recipe_name.length > 14 ? '..' : '')) + } + } + + if (e.listRecipeData.mealplan != null) { + let meal_plan_entry = (e.listRecipeData.mealPlanData.mealType.name.substring(0, 8) || '') + ' (' + DateTime.fromJSDate(e.listRecipeData.mealPlanData.fromDate).toLocaleString(DateTime.DATE_SHORT) + ')' + if (meal_pans.indexOf(meal_plan_entry) === -1) { + meal_pans.push(meal_plan_entry) + } } } + } }