Add oven batch cost to AI Quick Quote (1 batch, DefaultOvenCycleMinutes or 50 min)
Previously the quick quote omitted the oven charge entirely, so saved quotes were under-priced relative to full quotes from the same items. Pricing: CalculatePricing now calculates ovenBatchCost = (cycleMin/60) × OvenOperatingCostPerHour using DefaultOvenCycleMinutes (fallback 50 min), then adds it to the total as a quote-level charge matching how PricingCalculationService handles oven costs. Save path: SaveQuickQuoteRequest gains OvenBatchCost + OvenCycleMinutes; the Quote record now stores OvenBatchCost, OvenCycleMinutes, and Total = ItemsSubtotal + OvenBatchCost. Display: results card shows a sub-line under the estimate price: "incl. oven 1 batch 50 min: $12.00" Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
resComplexity:document.getElementById('qq-res-complexity'),
|
||||
resMinutes: document.getElementById('qq-res-minutes'),
|
||||
resPrice: document.getElementById('qq-res-price'),
|
||||
resOven: document.getElementById('qq-res-oven'),
|
||||
resConfidence:document.getElementById('qq-res-confidence'),
|
||||
resReasoning: document.getElementById('qq-res-reasoning'),
|
||||
powderSection:document.getElementById('qq-powder-section'),
|
||||
@@ -150,6 +151,15 @@
|
||||
el.resComplexity.textContent = r.complexity || '—';
|
||||
el.resMinutes.textContent = r.estimatedMinutes ? r.estimatedMinutes + ' min' : '—';
|
||||
el.resPrice.textContent = formatCurrency(r.estimatedTotal || r.estimatedUnitPrice);
|
||||
|
||||
const ovenCost = r.breakdown?.ovenCost;
|
||||
const ovenMin = r.breakdown?.ovenCycleMinutes;
|
||||
if (ovenCost && ovenCost > 0) {
|
||||
el.resOven.textContent = `incl. oven 1 batch ${ovenMin ? ovenMin + ' min' : ''}: ${formatCurrency(ovenCost)}`;
|
||||
} else {
|
||||
el.resOven.textContent = '';
|
||||
}
|
||||
|
||||
el.resReasoning.textContent = r.reasoning || '';
|
||||
|
||||
// Confidence badge
|
||||
@@ -220,7 +230,9 @@
|
||||
coatCount: parseInt(el.coats.value, 10) || 1,
|
||||
estimatedUnitPrice: lastResult.estimatedUnitPrice,
|
||||
materialCost: lastResult.breakdown?.materialCost ?? 0,
|
||||
laborCost: lastResult.breakdown?.laborCost ?? 0
|
||||
laborCost: lastResult.breakdown?.laborCost ?? 0,
|
||||
ovenBatchCost: lastResult.breakdown?.ovenCost ?? 0,
|
||||
ovenCycleMinutes: lastResult.breakdown?.ovenCycleMinutes ?? 50
|
||||
};
|
||||
|
||||
const response = await post('/AiQuickQuote/Save', body);
|
||||
|
||||
Reference in New Issue
Block a user