Project

General

Profile

Actions

Feature #684

open
NP

Recipes: manual cost-per-portion override

Feature #684: Recipes: manual cost-per-portion override

Added by Navya P. 14 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
10/30/2026
Due date:
% Done:

0%

Estimated time:
Resolved By:

Description

Adds an optional "Override cost per portion" field to the recipe dialog. When set, Recipe.ManualCostPerPortion takes over as the cost everywhere this recipe is read -- recipe list, menu margin, the cook sheet -- via a new Recipe.EffectiveCostPerPortion(ingredientLines) helper (ManualCostPerPortion ?? the ingredient total). Unlike the ingredient total it is frozen: a posted GRN does not move it until the field is edited again. The ingredient-computed figure is still exposed separately as ComputedCostPerPortion, shown live in the dialog next to the override field, so the two can be compared.

New nullable recipes.ManualCostPerPortion column (migration AddRecipeManualCostPerPortion). Updated the 3 cost call sites (RecipeService, MenuService, ProductionPlanService) to use the new entity method instead of calling RecipeCostCalculator directly. Recipes list shows a small lock icon next to an overridden cost.

Verified live in the browser: set Dhosha to a 6.50 override, confirmed the list shows the lock icon and 6.50; cleared it, confirmed it reverts to the live ingredient-computed 4.48 with no lock. Full backend suite green (2 pre-existing unrelated coupon failures only), full frontend suite green.

No data to display

Actions

Also available in: PDF Atom