diff --git a/src/components/purchase/ManagePurchase.jsx b/src/components/purchase/ManagePurchase.jsx index 262238bf..89c1b1b3 100644 --- a/src/components/purchase/ManagePurchase.jsx +++ b/src/components/purchase/ManagePurchase.jsx @@ -127,8 +127,6 @@ const ManagePurchase = ({ onClose, purchaseId }) => { const onSubmit = useCallback( (formData) => { - if (activeTab !== 2) return; - if (purchaseId) { const payload = generatePatchOps(formData); updatePurchase({ purchaseId, payload }); @@ -136,7 +134,7 @@ const ManagePurchase = ({ onClose, purchaseId }) => { CreateInvoice(formData); } }, - [activeTab, purchaseId, generatePatchOps, updatePurchase, CreateInvoice] + [purchaseId, generatePatchOps, updatePurchase, CreateInvoice] ); return (
@@ -184,50 +182,53 @@ const ManagePurchase = ({ onClose, purchaseId }) => { {/* --- Form Content --- */}
-
{ - if (activeTab !== 2) { - e.preventDefault(); - e.stopPropagation(); - } - }} - onSubmit={purchaseOrder.handleSubmit(onSubmit)} - > - {stepsConfig[activeTab].component} + {activeTab !== 2 && ( +
+ {stepsConfig[activeTab].component} - {/* Buttons */} -
- +
+ -
- {activeTab < stepsConfig.length - 1 ? ( - - ) : ( - - )} +
- + )} + {activeTab === 2 && ( +
+ {stepsConfig[2].component} + +
+ + + +
+
+ )}