Fix Facility Overhead not appearing on Quote Details view

Both PricingBreakdown constructions in QuotesController.Details were
missing FacilityOverheadCost and FacilityOverheadRatePerHour mappings,
so the view condition (FacilityOverheadCost > 0) was always false even
though the overhead was correctly stored on the Quote entity and included
in the total. The quote-to-job conversion block already had them; now all
three are consistent.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 13:11:52 -04:00
parent e6c4cfb38b
commit f625be01a3
@@ -386,27 +386,29 @@ public class QuotesController : Controller
// never displays "× 0 min" when the oven was priced against DefaultOvenCycleMinutes. // never displays "× 0 min" when the oven was priced against DefaultOvenCycleMinutes.
quoteDto.PricingBreakdown = new QuotePricingBreakdownDto quoteDto.PricingBreakdown = new QuotePricingBreakdownDto
{ {
MaterialCosts = quote.MaterialCosts, MaterialCosts = quote.MaterialCosts,
LaborCosts = quote.LaborCosts, LaborCosts = quote.LaborCosts,
EquipmentCosts = quote.EquipmentCosts, EquipmentCosts = quote.EquipmentCosts,
ItemsSubtotal = quote.ItemsSubtotal, ItemsSubtotal = quote.ItemsSubtotal,
OvenBatchCost = quote.OvenBatchCost, OvenBatchCost = quote.OvenBatchCost,
OvenBatches = quote.OvenBatches, OvenBatches = quote.OvenBatches,
OvenCycleMinutes = quote.OvenCycleMinutes ?? operatingCosts?.DefaultOvenCycleMinutes ?? 0, OvenCycleMinutes = quote.OvenCycleMinutes ?? operatingCosts?.DefaultOvenCycleMinutes ?? 0,
ShopSuppliesAmount = quote.ShopSuppliesAmount, FacilityOverheadCost = quote.FacilityOverheadCost,
ShopSuppliesPercent = quote.ShopSuppliesPercent, FacilityOverheadRatePerHour = quote.FacilityOverheadRatePerHour,
OverheadCosts = quote.OverheadAmount, ShopSuppliesAmount = quote.ShopSuppliesAmount,
OverheadPercent = quote.OverheadPercent, ShopSuppliesPercent = quote.ShopSuppliesPercent,
ProfitMargin = quote.ProfitMargin, OverheadCosts = quote.OverheadAmount,
ProfitPercent = quote.ProfitPercent, OverheadPercent = quote.OverheadPercent,
SubtotalBeforeDiscount = quote.SubTotal, ProfitMargin = quote.ProfitMargin,
DiscountAmount = quote.DiscountAmount, ProfitPercent = quote.ProfitPercent,
DiscountPercent = quote.DiscountPercent, SubtotalBeforeDiscount = quote.SubTotal,
SubtotalAfterDiscount = quote.SubTotal - quote.DiscountAmount, DiscountAmount = quote.DiscountAmount,
RushFee = quote.RushFee, DiscountPercent = quote.DiscountPercent,
TaxPercent = quote.TaxPercent, SubtotalAfterDiscount = quote.SubTotal - quote.DiscountAmount,
TaxAmount = quote.TaxAmount, RushFee = quote.RushFee,
Total = quote.Total TaxPercent = quote.TaxPercent,
TaxAmount = quote.TaxAmount,
Total = quote.Total
}; };
// Load change history // Load change history
@@ -570,27 +572,29 @@ public class QuotesController : Controller
// Populate pricing breakdown from stored snapshot values — never recalculate on load // Populate pricing breakdown from stored snapshot values — never recalculate on load
quoteDto.PricingBreakdown = new QuotePricingBreakdownDto quoteDto.PricingBreakdown = new QuotePricingBreakdownDto
{ {
MaterialCosts = quote.MaterialCosts, MaterialCosts = quote.MaterialCosts,
LaborCosts = quote.LaborCosts, LaborCosts = quote.LaborCosts,
EquipmentCosts = quote.EquipmentCosts, EquipmentCosts = quote.EquipmentCosts,
ItemsSubtotal = quote.ItemsSubtotal, ItemsSubtotal = quote.ItemsSubtotal,
OvenBatchCost = quote.OvenBatchCost, OvenBatchCost = quote.OvenBatchCost,
OvenBatches = quote.OvenBatches, OvenBatches = quote.OvenBatches,
OvenCycleMinutes = quote.OvenCycleMinutes ?? pdfOperatingCosts?.DefaultOvenCycleMinutes ?? 0, OvenCycleMinutes = quote.OvenCycleMinutes ?? pdfOperatingCosts?.DefaultOvenCycleMinutes ?? 0,
ShopSuppliesAmount = quote.ShopSuppliesAmount, FacilityOverheadCost = quote.FacilityOverheadCost,
ShopSuppliesPercent = quote.ShopSuppliesPercent, FacilityOverheadRatePerHour = quote.FacilityOverheadRatePerHour,
OverheadCosts = quote.OverheadAmount, ShopSuppliesAmount = quote.ShopSuppliesAmount,
OverheadPercent = quote.OverheadPercent, ShopSuppliesPercent = quote.ShopSuppliesPercent,
ProfitMargin = quote.ProfitMargin, OverheadCosts = quote.OverheadAmount,
ProfitPercent = quote.ProfitPercent, OverheadPercent = quote.OverheadPercent,
SubtotalBeforeDiscount = quote.SubTotal, ProfitMargin = quote.ProfitMargin,
DiscountAmount = quote.DiscountAmount, ProfitPercent = quote.ProfitPercent,
DiscountPercent = quote.DiscountPercent, SubtotalBeforeDiscount = quote.SubTotal,
SubtotalAfterDiscount = quote.SubTotal - quote.DiscountAmount, DiscountAmount = quote.DiscountAmount,
RushFee = quote.RushFee, DiscountPercent = quote.DiscountPercent,
TaxPercent = quote.TaxPercent, SubtotalAfterDiscount = quote.SubTotal - quote.DiscountAmount,
TaxAmount = quote.TaxAmount, RushFee = quote.RushFee,
Total = quote.Total TaxPercent = quote.TaxPercent,
TaxAmount = quote.TaxAmount,
Total = quote.Total
}; };
if (currentUser?.CompanyId == null) if (currentUser?.CompanyId == null)
{ {