Auto Close Requisiition SCheduler

This commit is contained in:
hodianto 2018-04-18 12:41:07 +07:00
parent d646a47f7f
commit 68a8cbe2cb
3 changed files with 33 additions and 1 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -0,0 +1,32 @@
package andromedia.midsuit.process;
import java.sql.Timestamp;
import java.util.List;
import org.compiere.model.Query;
import org.compiere.process.DocAction;
import org.compiere.process.SvrProcess;
import andromedia.midsuit.model.MID_MRequisitionTrx;
public class MID_AutoCloseRequisition extends SvrProcess{
@Override
protected void prepare() {
}
@Override
protected String doIt() throws Exception {
List<MID_MRequisitionTrx> lists = new Query(getCtx(), MID_MRequisitionTrx.Table_Name, MID_MRequisitionTrx.COLUMNNAME_DateDoc +" <? AND "+MID_MRequisitionTrx.COLUMNNAME_DocStatus+" =?", get_TrxName())
.setParameters(new Object[] { new Timestamp(System.currentTimeMillis()), DocAction.STATUS_Completed })
.setOnlyActiveRecords(true)
.list();
for(MID_MRequisitionTrx list : lists) {
list.processIt(DocAction.ACTION_Close);
list.saveEx();
}
return null;
}
}

View File

@ -180,7 +180,7 @@ public class MID_InsertIntoAllTable extends SvrProcess{
if(Trx.get(get_TrxName(), false).commit()){
return String.valueOf(po.get_ID());
}else
return "Failed to Save the Data !!!";
throw new AdempiereException(po.get_Logger().retrieveError().getName());
}