asdfasf
This commit is contained in:
@@ -193,7 +193,7 @@ const ApplicationPlanModal = ({
|
||||
productBrand: '',
|
||||
productType: applicationType,
|
||||
rateAmount: '',
|
||||
rateUnit: applicationType === 'granular' ? 'lb/1000sqft' : 'oz/1000sqft',
|
||||
rateUnit: (applicationType === 'granular' || applicationType === 'seed') ? 'lb/1000sqft' : 'oz/1000sqft',
|
||||
isUserProduct: false
|
||||
}]);
|
||||
};
|
||||
@@ -213,7 +213,7 @@ const ApplicationPlanModal = ({
|
||||
productBrand: '',
|
||||
productType: type,
|
||||
rateAmount: '',
|
||||
rateUnit: type === 'granular' ? 'lb/1000sqft' : 'oz/1000sqft',
|
||||
rateUnit: (type === 'granular' || type === 'seed') ? 'lb/1000sqft' : 'oz/1000sqft',
|
||||
isUserProduct: false
|
||||
}]);
|
||||
}, 0);
|
||||
@@ -383,7 +383,7 @@ const ApplicationPlanModal = ({
|
||||
const calculations = selectedProducts.map(product => {
|
||||
const rateAmount = parseFloat(product.rateAmount) || 0;
|
||||
|
||||
if (product.productType === 'granular') {
|
||||
if (product.productType === 'granular' || product.productType === 'seed') {
|
||||
// Granular calculations - total product needed
|
||||
const totalProductNeeded = (rateAmount * totalArea) / 1000; // Rate is per 1000 sq ft
|
||||
return {
|
||||
@@ -576,6 +576,17 @@ const ApplicationPlanModal = ({
|
||||
/>
|
||||
Granular (Spreader)
|
||||
</label>
|
||||
<label className="flex items-center">
|
||||
<input
|
||||
type="radio"
|
||||
name="applicationType"
|
||||
value="seed"
|
||||
checked={applicationType === 'seed'}
|
||||
onChange={(e) => handleApplicationTypeChange(e.target.value)}
|
||||
className="mr-2"
|
||||
/>
|
||||
Seed (Spreader)
|
||||
</label>
|
||||
<label className="flex items-center">
|
||||
<input
|
||||
type="radio"
|
||||
@@ -607,7 +618,7 @@ const ApplicationPlanModal = ({
|
||||
.filter(eq => {
|
||||
if (!applicationType) return true;
|
||||
// Filter by application type - granular needs Spreader, liquid needs Sprayer
|
||||
if (applicationType === 'granular') {
|
||||
if (applicationType === 'granular' || applicationType === 'seed') {
|
||||
return eq.categoryName === 'Spreader';
|
||||
} else if (applicationType === 'liquid') {
|
||||
return eq.categoryName === 'Sprayer';
|
||||
@@ -713,15 +724,15 @@ const ApplicationPlanModal = ({
|
||||
|
||||
// Set default rate unit if no rate was found
|
||||
if (!rateSet) {
|
||||
if (selectedProduct.productType === 'granular') {
|
||||
if (selectedProduct.productType === 'granular' || selectedProduct.productType === 'seed') {
|
||||
updateProduct(index, 'rateUnit', 'lb/1000sqft');
|
||||
} else if (selectedProduct.productType === 'liquid') {
|
||||
updateProduct(index, 'rateUnit', 'oz/1000sqft');
|
||||
}
|
||||
}
|
||||
|
||||
// For granular products, check if spreader settings exist
|
||||
if (selectedProduct.productType === 'granular' && selectedEquipmentId) {
|
||||
// For granular or seed products, check if spreader settings exist
|
||||
if ((selectedProduct.productType === 'granular' || selectedProduct.productType === 'seed') && selectedEquipmentId) {
|
||||
checkSpreaderSettings(selectedProduct, selectedEquipmentId);
|
||||
}
|
||||
}
|
||||
@@ -762,11 +773,11 @@ const ApplicationPlanModal = ({
|
||||
<div>
|
||||
<label className="block text-xs text-gray-600 mb-1">Rate Unit</label>
|
||||
<select
|
||||
value={product.rateUnit || (applicationType === 'granular' ? 'lb/1000sqft' : 'oz/1000sqft')}
|
||||
value={product.rateUnit || ((applicationType === 'granular' || applicationType === 'seed') ? 'lb/1000sqft' : 'oz/1000sqft')}
|
||||
onChange={(e) => updateProduct(index, 'rateUnit', e.target.value)}
|
||||
className="w-full border border-gray-300 rounded px-3 py-2"
|
||||
>
|
||||
{applicationType === 'granular' ? (
|
||||
{(applicationType === 'granular' || applicationType === 'seed') ? (
|
||||
<>
|
||||
<option value="lb/1000sqft">lb/1000sqft</option>
|
||||
<option value="oz/1000sqft">oz/1000sqft</option>
|
||||
@@ -1027,4 +1038,4 @@ const ApplicationPlanModal = ({
|
||||
);
|
||||
};
|
||||
|
||||
export default ApplicationPlanModal;
|
||||
export default ApplicationPlanModal;
|
||||
|
||||
@@ -867,7 +867,7 @@ const Applications = () => {
|
||||
),
|
||||
rateAmount: parseFloat(item.rateAmount || 1),
|
||||
rateUnit: item.rateUnit || 'oz/1000 sq ft',
|
||||
applicationType: planData.applicationType
|
||||
applicationType: (planData.applicationType === 'seed' ? 'granular' : planData.applicationType)
|
||||
}))
|
||||
: [{
|
||||
...(planData.selectedProduct?.isShared
|
||||
@@ -876,7 +876,7 @@ const Applications = () => {
|
||||
),
|
||||
rateAmount: parseFloat(planData.selectedProduct?.customRateAmount || planData.selectedProduct?.rateAmount || 1),
|
||||
rateUnit: planData.selectedProduct?.customRateUnit || planData.selectedProduct?.rateUnit || 'per 1000sqft',
|
||||
applicationType: planData.applicationType
|
||||
applicationType: (planData.applicationType === 'seed' ? 'granular' : planData.applicationType)
|
||||
}]
|
||||
};
|
||||
|
||||
@@ -924,7 +924,7 @@ const Applications = () => {
|
||||
),
|
||||
rateAmount: parseFloat(item.rateAmount || 1),
|
||||
rateUnit: item.rateUnit || 'oz/1000 sq ft',
|
||||
applicationType: planData.applicationType
|
||||
applicationType: (planData.applicationType === 'seed' ? 'granular' : planData.applicationType)
|
||||
}))
|
||||
: [{
|
||||
...(planData.selectedProduct?.isShared
|
||||
@@ -933,7 +933,7 @@ const Applications = () => {
|
||||
),
|
||||
rateAmount: parseFloat(planData.selectedProduct?.customRateAmount || planData.selectedProduct?.rateAmount || 1),
|
||||
rateUnit: planData.selectedProduct?.customRateUnit || planData.selectedProduct?.rateUnit || 'per 1000sqft',
|
||||
applicationType: planData.applicationType
|
||||
applicationType: (planData.applicationType === 'seed' ? 'granular' : planData.applicationType)
|
||||
}]
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user