From 83aed9efeb64ac352db9b3b4ae08ffc35d9d700b Mon Sep 17 00:00:00 2001 From: hodianto Date: Fri, 14 Dec 2018 12:11:46 +0700 Subject: [PATCH] NOTE !!! Production Order Documennt Action BUG !!! --HG-- branch : EDII --- .../src/andromedia/midsuit/model/MID_PPO.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/andromeida.midsuit.project/src/andromedia/midsuit/model/MID_PPO.java b/andromeida.midsuit.project/src/andromedia/midsuit/model/MID_PPO.java index 97eb897..883cbaa 100644 --- a/andromeida.midsuit.project/src/andromedia/midsuit/model/MID_PPO.java +++ b/andromeida.midsuit.project/src/andromedia/midsuit/model/MID_PPO.java @@ -40,7 +40,7 @@ public class MID_PPO extends X_ps_ppo implements DocAction, DocOptions{ public boolean processIt(String action) throws Exception { log.warning("Processing Action=" + action + " - DocStatus=" + getDocStatus() + " - DocAction=" + getDocAction()); DocumentEngine engine = new DocumentEngine(this, getDocStatus()); - return engine.processIt(action, getDocAction()); + return engine.processIt(getDocAction(), getDocAction()); } @Override @@ -56,7 +56,8 @@ public class MID_PPO extends X_ps_ppo implements DocAction, DocOptions{ @Override public String prepareIt() { setC_DocType_ID(getC_DocTypeTarget_ID()); - + if(getDocAction().equals(DocAction.ACTION_Void)) + return DocAction.STATUS_InProgress; List lines = new Query(getCtx(), MID_PPOLine.Table_Name, "ps_ppo_ID =? ", get_TrxName()) .setParameters(new Object[] { getps_ppo_ID() }) .setOnlyActiveRecords(true) @@ -135,12 +136,15 @@ public class MID_PPO extends X_ps_ppo implements DocAction, DocOptions{ @Override public boolean voidIt() { int count = new Query(getCtx(), MInventory.Table_Name, " ps_ppo_ID =? AND DocStatus NOT IN ('RE','VO')", get_TrxName()) + .setParameters(new Object[] { getps_ppo_ID() }) .setOnlyActiveRecords(true) .count(); if(count>0){ processMsg = "Reverse All Inventory Issue and Receipt before Void !!!"; return false; } + setDocAction(DocAction.ACTION_None); + setDocStatus(DocAction.STATUS_Voided); setProcessed(true); return true; } @@ -252,6 +256,9 @@ public class MID_PPO extends X_ps_ppo implements DocAction, DocOptions{ throw new IllegalArgumentException("Option array parameter is null"); if (docAction == null) throw new IllegalArgumentException("Doc action array parameter is null"); + for (int i = 0; i < options.length; i++) { + options[i] = null; + } index = 0; if (docStatus.equals(DocumentEngine.STATUS_Drafted) || docStatus.equals(DocumentEngine.STATUS_Invalid)) { options[index++] = DocumentEngine.ACTION_Complete;