diff --git a/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx b/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx index b01a479d..91a56085 100644 --- a/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx +++ b/src/components/pages/production/transfer-to-laying/TransferToLayingFormModal.tsx @@ -478,6 +478,16 @@ const TransferToLayingFormModal = () => { } }, [totalTransferedChicken]); + useEffect(() => { + if ( + formik.values.flockSourceKandangs.length > 0 && + formik.values.flockSourceKandangs[0].maxQuantity && + maxSourceQuantity === 0 + ) { + setMaxSourceQuantity(formik.values.flockSourceKandangs[0].maxQuantity); + } + }, [formik.values.flockSourceKandangs, maxSourceQuantity]); + return ( <>