The app calculates ingredient cost using the weighted average of usable invoice lines inside the selected window. A one-time sale or emergency purchase will not distort recipe cost as badly as latest-price-only costing.
Use weighted average from recent non-excluded invoice lines.
If no recent invoice exists, use the latest non-excluded invoice and warn if stale.
If no invoice exists, use the manual inventory price and warn that it is a fallback.
If no price exists, show missing-price warnings in recipes, production, and price alerts.