refactor(FE-208,212): enhance PurchaseOrderDetail and PurchaseOrderStaffApprovalForm to conditionally render invoice and item receipt based on approval steps

This commit is contained in:
rstubryan
2025-11-18 23:10:49 +07:00
parent 89b54f6f87
commit 25544e2e38
2 changed files with 39 additions and 12 deletions
@@ -43,7 +43,7 @@ const PurchaseOrderStaffApprovalForm = ({
if (!initialValues?.approval) return false;
const currentStep = initialValues.approval.step_number;
return currentStep >= 4;
return currentStep >= 3;
}, [initialValues?.approval]);
const getPurchaseItemError = (
@@ -127,7 +127,7 @@ const PurchaseOrderStaffApprovalForm = ({
onSubmit: async (values) => {
if (type === 'edit' && !canUpdatePurchaseItems) {
setPurchaseOrderFormErrorMessage(
'Tidak bisa diupdate. Harus melewati step 4 dahulu (Tahapan Penerimaan Produk).'
'Tidak bisa diupdate. Harus melewati step 3 dahulu (Approval dari Manager Purchasing).'
);
return;
}