From 60894d8ffae066da7dbe305bcdbe37246269d027 Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Fri, 1 Aug 2008 22:32:11 +0000 Subject: [PATCH] [ 2035366 ] Implementing DocAction for new document. https://sourceforge.net/tracker/index.php?func=detail&aid=2035366&group_id=176962&atid=879335 --- .../org/compiere/process/DocumentEngine.java | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/base/src/org/compiere/process/DocumentEngine.java b/base/src/org/compiere/process/DocumentEngine.java index f8530e34fa..99b0a37e0c 100644 --- a/base/src/org/compiere/process/DocumentEngine.java +++ b/base/src/org/compiere/process/DocumentEngine.java @@ -48,6 +48,10 @@ import org.compiere.util.CLogger; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Ini; +import org.eevolution.model.MDDOrder; +import org.eevolution.model.MHRProcess; +import org.eevolution.model.MPPCostCollector; +import org.eevolution.model.MPPOrder; /** * Document Action Engine @@ -1040,6 +1044,82 @@ public class DocumentEngine implements DocAction options[index++] = DocumentEngine.ACTION_Reverse_Correct; } } + /******************** + * Manufacturing Order + */ + else if (AD_Table_ID == MPPOrder.Table_ID) + { + if (docStatus.equals(DocumentEngine.STATUS_Drafted) + || docStatus.equals(DocumentEngine.STATUS_InProgress) + || docStatus.equals(DocumentEngine.STATUS_Invalid)) + { + options[index++] = DocumentEngine.ACTION_Prepare; + options[index++] = DocumentEngine.ACTION_Close; + } + // Complete .. CO + else if (docStatus.equals(DocumentEngine.STATUS_Completed)) + { + options[index++] = DocumentEngine.ACTION_Void; + options[index++] = DocumentEngine.ACTION_ReActivate; + } + } + /******************** + * Manufacturing Cost Collector + */ + else if (AD_Table_ID == MPPCostCollector.Table_ID) + { + if (docStatus.equals(DocumentEngine.STATUS_Drafted) + || docStatus.equals(DocumentEngine.STATUS_InProgress) + || docStatus.equals(DocumentEngine.STATUS_Invalid)) + { + //options[index++] = DocumentEngine.ACTION_Prepare; + options[index++] = DocumentEngine.ACTION_Close; + } + // Complete .. CO + else if (docStatus.equals(DocumentEngine.STATUS_Completed)) + { + options[index++] = DocumentEngine.ACTION_Void; + options[index++] = DocumentEngine.ACTION_Reverse_Correct; + } + } + /******************** + * Distribution Order + */ + else if (AD_Table_ID == MDDOrder.Table_ID) + { + if (docStatus.equals(DocumentEngine.STATUS_Drafted) + || docStatus.equals(DocumentEngine.STATUS_InProgress) + || docStatus.equals(DocumentEngine.STATUS_Invalid)) + { + options[index++] = DocumentEngine.ACTION_Prepare; + options[index++] = DocumentEngine.ACTION_Close; + } + // Complete .. CO + else if (docStatus.equals(DocumentEngine.STATUS_Completed)) + { + options[index++] = DocumentEngine.ACTION_Void; + options[index++] = DocumentEngine.ACTION_ReActivate; + } + } + /******************** + * Payroll Process + */ + else if (AD_Table_ID == MHRProcess.Table_ID) + { + if (docStatus.equals(DocumentEngine.STATUS_Drafted) + || docStatus.equals(DocumentEngine.STATUS_InProgress) + || docStatus.equals(DocumentEngine.STATUS_Invalid)) + { + options[index++] = DocumentEngine.ACTION_Prepare; + options[index++] = DocumentEngine.ACTION_Close; + } + // Complete .. CO + else if (docStatus.equals(DocumentEngine.STATUS_Completed)) + { + options[index++] = DocumentEngine.ACTION_Void; + options[index++] = DocumentEngine.ACTION_ReActivate; + } + } return index; }