Auto Close Requisiition SCheduler
This commit is contained in:
parent
d646a47f7f
commit
68a8cbe2cb
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -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());
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue