This commit is contained in:
Jake Kasper
2025-09-04 09:39:06 -05:00
parent de056f3106
commit 7e893e5ef6

View File

@@ -464,7 +464,7 @@ const ApplicationPlanModal = ({
nozzleId: selectedNozzleId || null,
applicationType,
plannedDate,
notes
notes: applicationType === 'seed' ? `${notes || ''} [Seeding: ${seedMode.replace('_',' ')}]`.trim() : notes
};
// Add products in the format expected by Applications.js
@@ -660,6 +660,23 @@ const ApplicationPlanModal = ({
</div>
</div>
{/* Seed mode selector */}
{applicationType === 'seed' && (
<div className="mb-2">
<label className="block text-sm font-medium text-gray-700 mb-1">Seeding Scenario</label>
<div className="flex items-center gap-4 text-sm">
<label className="inline-flex items-center gap-2">
<input type="radio" name="seed-mode" value="overseed" checked={seedMode==='overseed'} onChange={()=> setSeedMode('overseed')} />
Overseed
</label>
<label className="inline-flex items-center gap-2">
<input type="radio" name="seed-mode" value="new_seed" checked={seedMode==='new_seed'} onChange={()=> setSeedMode('new_seed')} />
New lawn
</label>
</div>
</div>
)}
{/* Products */}
<div>
<div className="flex justify-between items-center mb-2">
@@ -710,7 +727,15 @@ const ApplicationPlanModal = ({
// For shared products: check rates array
if (selectedProduct.isShared && selectedProduct.rates && selectedProduct.rates.length > 0) {
const defaultRate = selectedProduct.rates[0];
let defaultRate = selectedProduct.rates[0];
if (applicationType === 'seed') {
const modeKey = seedMode === 'new_seed' ? 'new' : 'over';
const match = selectedProduct.rates.find(r => {
const t = (r.applicationType || '').toLowerCase();
return t.includes('seed') && t.includes(modeKey);
});
if (match) defaultRate = match;
}
updateProduct(index, 'rateAmount', defaultRate.rateAmount || defaultRate.amount);
updateProduct(index, 'rateUnit', defaultRate.rateUnit || defaultRate.unit);
rateSet = true;