added place to set the actual yield for harvest plans at their completion

This commit is contained in:
csawatzky 2026-02-12 15:43:29 -06:00
parent e41670be8f
commit b5f6139bc0

View file

@ -178,6 +178,7 @@ export default function HarvestSettings(props: Props) {
const [variety, setVariety] = useState("");
const [harvestYear, setHarvestYear] = useState(new Date().getFullYear());
const [targetYield, setTargetYield] = useState(0);
const [actualYield, setActualYield] = useState(0);
const [price, setPrice] = useState("");
const [newTaskDialog, setNewTaskDialog] = useState(false);
const [type, setType] = useState("");
@ -365,6 +366,7 @@ export default function HarvestSettings(props: Props) {
tempPlan.settings.grainType = variety;
tempPlan.settings.harvestYear = harvestYear;
tempPlan.settings.yieldTarget = targetYield;
tempPlan.settings.actualYield =
tempPlan.settings.bushelPrice = !isNaN(parseFloat(price))
? Math.round(parseFloat(price) * 100) / 100
: 0;
@ -501,6 +503,16 @@ export default function HarvestSettings(props: Props) {
!isNaN(+e.target.value) && setTargetYield(+e.target.value);
}}
/>
<TextField
fullWidth
margin="normal"
type="number"
label="Actual Yield per acre"
value={actualYield}
onChange={e => {
!isNaN(+e.target.value) && setActualYield(+e.target.value);
}}
/>
<TextField
margin="dense"
id="bushPrice"