Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.wirabumi.gen.oez.porting;
- import java.util.List;
- import org.openbravo.base.exception.OBException;
- import org.openbravo.base.secureApp.VariablesSecureApp;
- import org.openbravo.dal.service.OBDal;
- import org.openbravo.model.ad.ui.Tab;
- import org.openbravo.model.materialmgmt.transaction.InternalMovement;
- import org.wirabumi.gen.oez.event.DocumentRoutingHandlerAction;
- public class GoodsMovemenForFaildedApproved extends DocumentRoutingHandlerAction {
- private final String completeStatus="CO";
- @Override
- public void doRouting(String adWindowId, String adTabId, String doc_status_to, VariablesSecureApp vars,
- List<String> recordId) {
- for (String goodsMovementID : recordId){
- InternalMovement goodMovId = OBDal.getInstance().get(InternalMovement.class, goodsMovementID);
- String docstatus = goodMovId.getOezDocstatus();
- Boolean recordIsProcessed = goodMovId.isProcessed();
- Boolean recordIsCompleted = docstatus.equalsIgnoreCase(completeStatus) ;
- if (recordIsProcessed && !recordIsCompleted) {
- goodMovId.setOezDocstatus(completeStatus);
- OBDal.getInstance().save(goodMovId);
- OBDal.getInstance().flush();
- continue;
- }
- else {
- throw new OBException("@ActionNotAllowedHere@");
- }
- }
- }
- @Override
- public String getCoDocumentNo(String recordID, Tab tab) {
- // TODO Auto-generated method stub
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement