Advertisement
tko_pb

orderActionHandlerForWaitingRelease

Oct 24th, 2018
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1. package org.wirabumi.gen.oez.porting;
  2.  
  3. import java.util.List;
  4.  
  5. import org.openbravo.base.exception.OBException;
  6. import org.openbravo.base.secureApp.VariablesSecureApp;
  7. import org.openbravo.dal.service.OBDal;
  8. import org.openbravo.model.ad.ui.Tab;
  9. import org.openbravo.model.common.order.Order;
  10. import org.wirabumi.gen.oez.event.DocumentRoutingHandlerAction;
  11.  
  12. public class orderActionHandlerForWaitingRelease extends DocumentRoutingHandlerAction {
  13.  
  14.     @Override
  15.     public void doRouting(String adWindowId, String adTabId, String doc_status_to, VariablesSecureApp vars,
  16.             List<String> recordId) {
  17.         // TODO Auto-generated method stub
  18.         if (!doc_status_to.toLowerCase().contains("oez_waitingrelease")) {
  19.             throw new OBException("@ActionNotAllowedHere@");
  20.         }  
  21.         for (String orderID : recordId) {
  22.             Order order = OBDal.getInstance().get(Order.class, orderID);
  23.             order.setDocumentAction(doc_status_to);
  24.             order.setProcessed(true);          
  25.             OBDal.getInstance().save(order);
  26.             OBDal.getInstance().flush();
  27.         }
  28.     }
  29.  
  30.     @Override
  31.     public String getCoDocumentNo(String recordID, Tab tab) {
  32.         // TODO Auto-generated method stub
  33.         return null;
  34.     }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement