Add PWA manifest, fix AI multi-coat pricing, and improve catalog lookup
- PWA: manifest.json + minimal service worker so iOS/Android persist camera permission after "Add to Home Screen"; theme-color and apple meta tags in layout - PWA icons: 192x192 and 512x512 from transparent PCL logo; updated pcl-logo.png - AI pricing: apply AdditionalCoatLaborPercent per extra coat on AI items, matching the calculated-item path (was ignoring extra coats entirely) - AI wizard: live price recalc when coats are added/removed; session-expiry errors now show a clear "refresh and sign in" message instead of raw HTTP status; smooth-scroll to follow-up/results sections on AI response - Catalog lookup: exclude SKUs already in company inventory from results; pass currentId on edit so own entry still appears; vendor-scoped search with cross-vendor fallback; result count shown in multi-match modal Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -252,11 +252,27 @@ public class PricingCalculationService : IPricingCalculationService
|
||||
};
|
||||
}
|
||||
|
||||
// AI items use ManualUnitPrice directly (set to either the AI estimate or the user's price override).
|
||||
// The AI already factored in all costs — skip the pricing engine entirely.
|
||||
// AI items use ManualUnitPrice as the single-coat base price.
|
||||
// Apply the same additional-coat charge as the calculated-item path so that
|
||||
// adding a 2nd or 3rd coat in step 3 increases the price by AdditionalCoatLaborPercent%
|
||||
// per coat — matching what catalog/calculated items charge.
|
||||
if (item.IsAiItem && item.ManualUnitPrice.HasValue)
|
||||
{
|
||||
var aiUnitPrice = item.ManualUnitPrice.Value;
|
||||
|
||||
int additionalAiCoats = 0;
|
||||
if (item.Coats != null)
|
||||
{
|
||||
for (int i = 1; i < item.Coats.Count; i++)
|
||||
{
|
||||
if (!item.Coats[i].NoExtraLayerCharge)
|
||||
additionalAiCoats++;
|
||||
}
|
||||
}
|
||||
if (additionalAiCoats > 0)
|
||||
aiUnitPrice = Math.Round(
|
||||
aiUnitPrice * (1m + additionalAiCoats * (costs.AdditionalCoatLaborPercent / 100m)), 2);
|
||||
|
||||
var aiTotal = aiUnitPrice * item.Quantity;
|
||||
return new QuoteItemPricingResult
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user