seed
This commit is contained in:
@@ -464,7 +464,7 @@ const ApplicationPlanModal = ({
|
|||||||
nozzleId: selectedNozzleId || null,
|
nozzleId: selectedNozzleId || null,
|
||||||
applicationType,
|
applicationType,
|
||||||
plannedDate,
|
plannedDate,
|
||||||
notes
|
notes: applicationType === 'seed' ? `${notes || ''} [Seeding: ${seedMode.replace('_',' ')}]`.trim() : notes
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add products in the format expected by Applications.js
|
// Add products in the format expected by Applications.js
|
||||||
@@ -660,6 +660,23 @@ const ApplicationPlanModal = ({
|
|||||||
</div>
|
</div>
|
||||||
</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 */}
|
{/* Products */}
|
||||||
<div>
|
<div>
|
||||||
<div className="flex justify-between items-center mb-2">
|
<div className="flex justify-between items-center mb-2">
|
||||||
@@ -710,7 +727,15 @@ const ApplicationPlanModal = ({
|
|||||||
|
|
||||||
// For shared products: check rates array
|
// For shared products: check rates array
|
||||||
if (selectedProduct.isShared && selectedProduct.rates && selectedProduct.rates.length > 0) {
|
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, 'rateAmount', defaultRate.rateAmount || defaultRate.amount);
|
||||||
updateProduct(index, 'rateUnit', defaultRate.rateUnit || defaultRate.unit);
|
updateProduct(index, 'rateUnit', defaultRate.rateUnit || defaultRate.unit);
|
||||||
rateSet = true;
|
rateSet = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user