Fix 'Oven (1 batch × 0 min)' display when OvenCycleMinutes is null

Quote.OvenCycleMinutes is nullable — null means 'use company default'.
The Details and DownloadPdf actions were converting null → 0 before passing
it to the view, so the pricing summary showed '× 0 min' even though the
oven cost was correctly calculated from DefaultOvenCycleMinutes.

Fix: resolve null against operatingCosts.DefaultOvenCycleMinutes in both
controller actions (DownloadPdf now loads operating costs for this). Added
a defensive > 0 guard in the view so the minutes clause is omitted entirely
if it still comes through as 0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-06 15:35:38 -04:00
parent 4d10175ce3
commit 2d8827ad5c
2 changed files with 9 additions and 5 deletions
@@ -984,8 +984,7 @@
<div class="d-flex justify-content-between mb-2">
<span>
<i class="bi bi-fire me-1"></i>Oven
(@Model.PricingBreakdown.OvenBatches batch@(Model.PricingBreakdown.OvenBatches != 1 ? "es" : "")
&times; @Model.PricingBreakdown.OvenCycleMinutes min):
(@Model.PricingBreakdown.OvenBatches batch@(Model.PricingBreakdown.OvenBatches != 1 ? "es" : "")@(Model.PricingBreakdown.OvenCycleMinutes > 0 ? $" × {Model.PricingBreakdown.OvenCycleMinutes} min" : "")):
</span>
<strong>@Model.PricingBreakdown.OvenBatchCost.ToString("C")</strong>
</div>
@@ -1148,7 +1147,7 @@
@if (pb.OvenBatchCost > 0)
{
<div class="d-flex justify-content-between small mb-1">
<span class="text-muted">Oven batch (@pb.OvenBatches batch@(pb.OvenBatches != 1 ? "es" : ""), @pb.OvenCycleMinutes min/cycle)</span>
<span class="text-muted">Oven batch (@pb.OvenBatches batch@(pb.OvenBatches != 1 ? "es" : "")@(pb.OvenCycleMinutes > 0 ? $", {pb.OvenCycleMinutes} min/cycle" : ""))</span>
<span>@pb.OvenBatchCost.ToString("C")</span>
</div>
}