tiko_pb

WMSFreeStockAllocateIntegration.Java

Oct 17th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 17.93 KB | None | 0 0
  1. package org.aoi.enh.allocation.process;
  2.  
  3. import java.math.BigDecimal;
  4. import java.math.RoundingMode;
  5. import java.sql.PreparedStatement;
  6. import java.sql.ResultSet;
  7. import java.sql.Timestamp;
  8. import java.util.ArrayList;
  9. import java.util.List;
  10. import java.util.logging.Level;
  11.  
  12. import org.aoi.enh.model.MkstFSAllocation;
  13. import org.aoi.enh.model.MkstFSAllocationDetail;
  14. import org.aoi.mrp.model.X_kst_ImportSetting;
  15. import org.aoi.mrp.model.X_kst_PO_Allocation;
  16. import org.aoi.mrp.model.X_kst_PO_AllocationLine;
  17. import org.compiere.model.MOrderLine;
  18. import org.compiere.model.MProduct;
  19. import org.compiere.model.MUOM;
  20. import org.compiere.model.Query;
  21. import org.compiere.process.ProcessInfoParameter;
  22. import org.compiere.process.SvrProcess;
  23. import org.compiere.util.DB;
  24. import org.compiere.util.Env;
  25.  
  26. public class WMSFreeStockAllocateIntegration extends SvrProcess {
  27.     /** Client to be imported to        */
  28.     private int             m_AD_Client_ID = 0;
  29.     /** Organization to be imported to      */
  30.     private int             m_AD_Org_ID = 0;
  31.     /** RecevingDate        */
  32.     private Timestamp       p_DateFrom;
  33.     private Timestamp       p_DateTo;
  34.     /** Document Type       */
  35.     private int             p_C_DocType_ID = 0;
  36.     /** Document Type   Return  */
  37.     private int             p_C_DocType_ID_Return = 0; 
  38.  
  39.    
  40.     @Override
  41.     protected void prepare() {
  42.         ProcessInfoParameter[] para = getParameter();
  43.         for (int i = 0; i < para.length; i++)
  44.         {
  45.             String name = para[i].getParameterName();
  46.             if (name.equals("AD_Client_ID"))
  47.                 m_AD_Client_ID = para[i].getParameterAsInt();
  48.             else if (name.equals("AD_Org_ID"))
  49.                 m_AD_Org_ID = para[i].getParameterAsInt();
  50.             else
  51.                 log.log(Level.SEVERE, "Unknown Parameter: " + name);
  52.         }      
  53.     }
  54.  
  55.     @Override
  56.     protected String doIt() throws Exception {
  57.         String msg ="";
  58.         String msg2 ="";
  59.         String sqlSetting = " Name = 'WMS'";
  60.         List<String> wmsId = new ArrayList();
  61.         X_kst_ImportSetting impSett = new Query(Env.getCtx(),X_kst_ImportSetting.Table_Name,sqlSetting,null)
  62.                                         .setOrderBy("kst_importsetting_id desc")
  63.                                         .setOnlyActiveRecords(true)
  64.                                         .first();
  65.        
  66.         String ip = impSett.getkst_IP();
  67.         String dbname = impSett.getkst_DatabaseName();
  68.         String port = impSett.getkst_Port();
  69.         String user = impSett.getkst_UserName();
  70.         String password = impSett.getkst_Password();
  71.         int UpdateFlag = 0;
  72.         //MUTASI
  73. //      String sql = "SELECT * FROM("
  74. //              + " SELECT A.*,"
  75. //              + " CASE WHEN B.kst_FS_AllocationDetail_UU IS NULL AND C.kst_PO_AllocationLine_UU IS NULL THEN 0 ELSE 1 END as result FROM wms_move_mutasi A "
  76. //              + " LEFT JOIN kst_FS_AllocationDetail B ON A.id = B.kst_idwms"
  77. //              + " LEFT JOIN kst_PO_AllocationLine C ON A.id = C.kst_idwms"
  78. //              + " ) Z"
  79. //              + " WHERE result = 0 ORDER BY created_at FETCH FIRST 500 ROWS ONLY";    
  80.         String sql = "SELECT * FROM wms_move_mutasi2 where document_no NOT IN ('POAO1812A/E2244',"
  81.                 + "'POA21909A/E0936','POAO1906A/E0030','POA21809A/E4198','POA21809A/E4198','POAO1908A/E0020','POAO1801A/E0125'"
  82.                 + "'PFAO21811A/E0022','POAO1801A/E0125','PFAO21811A/E0022','PFAO21812A/E0060','POAO1711A/E0411',"
  83.                 + "'POAO1908A/E0020','POAO1901A/E0944','POA21812A/E0613','POA21907A/E2456','POA21902A/E0074',"
  84.                 + "'PFAO1812A/E0131','POA21903A/E2837','POA21903A/E2837',"
  85.                 + "'MFAO21901A/E0287','POA21907A/E0476','POAO1809A/E2415','POA21902A/E0097','POA21905A/E0017',"
  86.                 + "'PFAO21812A/E0147') FETCH FIRST 2500 ROWS ONLY";
  87.                 // "ORDER BY id ASC, created_at FETCH FIRST 500 ROWS ONLY";
  88.         PreparedStatement pstmt = null;
  89.         ResultSet rs = null;
  90.         try{
  91.             pstmt = DB.prepareStatement(sql.toString(), get_TrxName());
  92.             rs = pstmt.executeQuery();
  93.             while (rs.next()){
  94.                 MProduct prd = new Query(getCtx(), MProduct.Table_Name, " value = ?  ", get_TrxName())
  95.                     .setClient_ID()
  96.                     .setOnlyActiveRecords(true)
  97.                     .setParameters(rs.getString("item_code"))
  98.                     .first();
  99.                 MUOM uom = new Query(getCtx(), MUOM.Table_Name, " uomsymbol = ? ", get_TrxName())
  100.                     .setClient_ID()
  101.                     .setOnlyActiveRecords(true)
  102.                     .setParameters(rs.getString("uom"))
  103.                     .first();
  104.                 int State = 0;
  105.                 if(prd == null && uom == null ){
  106.                     msg = "Product or UOM is not Found";
  107.                 }else{
  108.                     if(rs.getString("is_stock_allocation").equals("f")){ // Free Stock
  109.                         MkstFSAllocation fs = null;
  110.                         String prtID = rs.getString("c_bpartner_id");
  111.                         if(prtID.equals("FREE STOCK")){
  112.                             fs = new Query(getCtx(), MkstFSAllocation.Table_Name, " m_product_id = ? AND  m_warehouse_id = ?  AND type_stock = ? ", get_TrxName())
  113.                             .setClient_ID()
  114.                             .setOnlyActiveRecords(true)
  115.                             .setParameters(prd.get_ID(),rs.getInt("warehouse_id"),rs.getString("type_stock_erp_code"))
  116.                             .first();
  117.                         }else{
  118.                             fs = new Query(getCtx(), MkstFSAllocation.Table_Name, " m_product_id = ? AND  m_warehouse_id = ?  AND type_stock = ? AND c_bpartner_ID = ? ", get_TrxName())
  119.                             .setClient_ID()
  120.                             .setOnlyActiveRecords(true)
  121.                             .setParameters(prd.get_ID(),rs.getInt("warehouse_id"),rs.getString("type_stock_erp_code"),Integer.parseInt(rs.getString("c_bpartner_id")))
  122.                             .first();
  123.                         }
  124.                         if(fs != null){ // Free Stock Exist
  125.                             if(rs.getString("po_buyer_allocation") != null){
  126.                                 MkstFSAllocationDetail line = null;
  127.                                 line  = new MkstFSAllocationDetail(getCtx(), 0, get_TrxName());
  128.                                
  129.                                 line.setAD_Org_ID(fs.getAD_Org_ID());
  130.                                 line.set_ValueOfColumn("AD_Client_ID", fs.getAD_Client_ID());
  131.                                 line.set_ValueOfColumn("Description", "ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source")+rs.getString("style_po_buyer_allocation")+" "+rs.getString("article_po_buyer_allocation"));
  132.                                 line.set_ValueOfColumn("kst_lcdate",  rs.getTimestamp("lc_date_po_buyer_allocation"));
  133.                                 line.setkst_FS_Allocation_ID(fs.get_ID());
  134.                                 line.setPOReference(rs.getString("po_buyer_allocation"));
  135.                                 line.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  136.                                 line.setM_Product_ID(prd.get_ID());
  137.                                 line.setqtyallocated(rs.getBigDecimal("qty_allocation"));
  138.                                 if(!line.save(get_TrxName())){
  139.                                     return "gagal save Existing FreeStock Line";
  140.                                 }else{
  141.                                     msg += rs.getString("id")+" , ";
  142.                                     State = 1;
  143.                                 }
  144.                                
  145.                             }else{
  146.                                 MkstFSAllocationDetail line = null;
  147.                                 if(rs.getBigDecimal("stock_new").compareTo(Env.ZERO) > 0){
  148.                                    
  149.                                     line  = new MkstFSAllocationDetail(getCtx(), 0, get_TrxName());
  150.                                     line.setM_Product_ID(prd.get_ID());
  151.                                     line.setAD_Org_ID(fs.getAD_Org_ID());
  152.                                     line.set_ValueOfColumn("AD_Client_ID", fs.getAD_Client_ID());
  153.                                     line.set_ValueOfColumn("Description", "ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  154.                                     //line_old.set_ValueOfColumn("C_UOM_ID", fsdata.get_ValueAsInt("C_UOM_ID"));
  155.                                     line.set_ValueOfColumn("kst_lcdate", rs.getTimestamp("lc_date"));
  156.                                     line.setkst_FS_Allocation_ID(fs.get_ID());
  157.                                     line.setPOReference(rs.getString("po_buyer"));
  158.                                     line.setqtyallocated(rs.getBigDecimal("stock_new").negate());
  159.                                     line.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  160.                                     line.setM_Product_ID(prd.get_ID());
  161.                                     if(!line.save(get_TrxName())){
  162.                                         return "gagal save";
  163.                                     }else{
  164.                                         msg += rs.getString("id")+" , ";
  165.                                         State = 1;
  166.                                     }
  167.                                 }
  168.                                 MkstFSAllocationDetail line_old = null;
  169.                                 if(rs.getBigDecimal("stock_old").compareTo(Env.ZERO) > 0){
  170.                                    
  171.                                     line_old  = new MkstFSAllocationDetail(getCtx(), 0, get_TrxName());
  172.                                     line_old.setM_Product_ID(prd.get_ID());
  173.                                     line_old.setAD_Org_ID(fs.getAD_Org_ID());
  174.                                     line_old.set_ValueOfColumn("AD_Client_ID", fs.getAD_Client_ID());
  175.                                     line_old.set_ValueOfColumn("Description", "ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  176.                                     //line_old.set_ValueOfColumn("C_UOM_ID", fsdata.get_ValueAsInt("C_UOM_ID"));
  177.                                     line_old.set_ValueOfColumn("kst_lcdate", rs.getTimestamp("lc_date"));
  178.                                     line_old.setkst_FS_Allocation_ID(fs.get_ID());
  179.                                     line_old.setPOReference(rs.getString("po_buyer"));
  180.                                     line_old.setqtyallocated(rs.getBigDecimal("stock_old"));
  181.                                     line_old.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  182.                                     line_old.setM_Product_ID(prd.get_ID());
  183.                                     //line_old.save();
  184.                                     if(!line_old.save(get_TrxName())){
  185.                                         line.delete(true);
  186.                                         State = 0;
  187.                                         return "gagal save";
  188.                                     }else{
  189.                                         msg += rs.getString("id")+" , ";
  190.                                         State = 1;
  191.                                     }
  192.                                
  193.                                 }
  194.                             }
  195.                            
  196.                         }else{ // New Free Stock
  197.                             fs = new MkstFSAllocation(getCtx(), 0, get_TrxName());
  198.                             fs.set_ValueOfColumn("AD_Client_ID", m_AD_Client_ID);
  199.                             fs.setAD_Org_ID(m_AD_Org_ID);
  200.                             fs.setM_Product_ID(prd.get_ID());
  201.                             fs.set_ValueOfColumn("M_Warehouse_ID", rs.getInt("warehouse_id"));
  202.                             fs.set_ValueOfColumn("M_Product_Category_ID", prd.getM_Product_Category_ID());
  203.                             BigDecimal NewQty = rs.getBigDecimal("stock_new").setScale(4, RoundingMode.UP);
  204.                             String sqlavail = "select kst_convertedqty("+NewQty+", "+prd.getM_Product_ID()+", "+uom.get_ID()+",  "+prd.getC_UOM_ID()+" ) ";
  205.                             BigDecimal qtyAvail = DB.getSQLValueBD(get_TrxName(), sqlavail);
  206.                             fs.setQty(NewQty);
  207.                             fs.setQtyAvailable(qtyAvail);
  208.                             fs.setqtyallocated(Env.ZERO);
  209.                            
  210.                             if(!prtID.equals("FREE STOCK")){
  211.                                 fs.set_ValueOfColumn("C_BPartner_ID", Integer.parseInt(rs.getString("c_bpartner_id")));
  212.                             }
  213.                             fs.set_ValueOfColumn("description", "Opening Balance New Integrate FreeStock ID "+rs.getString("id"));
  214.                             fs.set_ValueOfColumn("C_UOM_ID", uom.get_ID());
  215.                             fs.set_ValueOfColumn("type_stock", rs.getString("type_stock_erp_code"));
  216.                             if(!fs.save(get_TrxName())){
  217.                                 fs.delete(true);
  218.                                 rollback();
  219.                                 return "gagal Save";
  220.                             }else{
  221.                                 MkstFSAllocationDetail line = null;
  222.                                 line  = new MkstFSAllocationDetail(getCtx(), 0, get_TrxName());
  223.                                 line.setM_Product_ID(prd.get_ID());
  224.                                 line.setAD_Org_ID(fs.getAD_Org_ID());
  225.                                 line.set_ValueOfColumn("AD_Client_ID", fs.getAD_Client_ID());
  226.                                 line.set_ValueOfColumn("Description", "Opening Balance ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  227.                                 //line_old.set_ValueOfColumn("C_UOM_ID", fsdata.get_ValueAsInt("C_UOM_ID"));
  228.                                 line.set_ValueOfColumn("kst_lcdate", rs.getTimestamp("lc_date"));
  229.                                 line.setkst_FS_Allocation_ID(fs.get_ID());
  230.                                 line.setPOReference(rs.getString("po_buyer"));
  231.                                 line.setqtyallocated(Env.ZERO);
  232.                                 line.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  233.                                 if(!line.save(get_TrxName())){
  234.                                     rollback();
  235.                                     return "gagal save";
  236.                                 }else{
  237.                                     msg += rs.getString("id")+" , ";
  238.                                     State = 1;
  239.                                 }
  240.                             }
  241.                         }
  242.                        
  243.                     }else{ // PO Allocation
  244.                         X_kst_PO_Allocation poal = new Query(getCtx(), X_kst_PO_Allocation.Table_Name, " m_product_id = ? AND c_order_id = ? AND m_warehouse_id = ? AND type_stock = ? ", get_TrxName())
  245.                                 .setClient_ID()
  246.                                 .setOnlyActiveRecords(true)
  247.                                 .setParameters(prd.get_ID(),rs.getInt("c_order_id"),rs.getInt("warehouse_id"),rs.getString("type_stock_erp_code"))
  248.                                 .first();
  249.                         if(poal != null){ // PO Allocation Exist
  250.                            
  251.                             if(rs.getString("po_buyer_allocation") != null){
  252.                                 X_kst_PO_AllocationLine line = null;
  253.                                 line  = new X_kst_PO_AllocationLine(getCtx(), 0, get_TrxName());
  254.                                
  255.                                 line.setAD_Org_ID(poal.getAD_Org_ID());
  256.                                 line.set_ValueOfColumn("AD_Client_ID", poal.getAD_Client_ID());
  257.                                 line.set_ValueOfColumn("Description", "ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source")+rs.getString("style_po_buyer_allocation")+" "+rs.getString("article_po_buyer_allocation"));
  258.                                 line.set_ValueOfColumn("kst_lcdate",  rs.getTimestamp("lc_date_po_buyer_allocation"));
  259.                                 line.setkst_po_allocation_ID(poal.get_ID());
  260.                                 line.setPOReference(rs.getString("po_buyer_allocation"));
  261.                                 line.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  262.                                 line.setqtyallocated(rs.getBigDecimal("qty_allocation"));
  263.                                 if(!line.save(get_TrxName())){
  264.                                     String orderno = poal.getC_Order().getDocumentNo();
  265.                                     rollback();
  266.                                     return "gagal save Existing PO Alloc Line";
  267.                                 }else{
  268.                                     msg += rs.getString("id")+" , ";
  269.                                     State = 1;
  270.                                 }
  271.                                
  272.                             }else{
  273.                                 X_kst_PO_AllocationLine line = null;
  274.                                 if(rs.getBigDecimal("stock_new").compareTo(Env.ZERO) > 0){
  275.                                    
  276.                                     line  = new X_kst_PO_AllocationLine(getCtx(), 0, get_TrxName());
  277.                                    
  278.                                     line.setAD_Org_ID(poal.getAD_Org_ID());
  279.                                     line.set_ValueOfColumn("AD_Client_ID", poal.getAD_Client_ID());
  280.                                     line.set_ValueOfColumn("Description", "ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  281.                                     line.set_ValueOfColumn("kst_lcdate",  rs.getTimestamp("lc_date"));
  282.                                     line.setkst_po_allocation_ID(poal.get_ID());
  283.                                     line.setPOReference(rs.getString("po_buyer"));
  284.                                     line.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  285.                                     line.setqtyallocated(rs.getBigDecimal("stock_new").negate());
  286.                                     if(!line.save(get_TrxName())){
  287.                                         rollback();
  288.                                         return "gagal save Existing PO Alloc Line";
  289.                                     }else{
  290.                                         msg += rs.getString("id")+" , ";
  291.                                         State = 1;
  292.                                     }
  293.                                 }
  294.                                 X_kst_PO_AllocationLine line_old = null;
  295.                                 if(rs.getBigDecimal("stock_old").compareTo(Env.ZERO) > 0){
  296.                                    
  297.                                     line_old  = new X_kst_PO_AllocationLine(getCtx(), 0, get_TrxName());
  298.                                     line_old.setAD_Org_ID(poal.getAD_Org_ID());
  299.                                     line_old.set_ValueOfColumn("AD_Client_ID", poal.getAD_Client_ID());
  300.                                     line_old.set_ValueOfColumn("Description", "ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  301.                                     //line_old.set_ValueOfColumn("C_UOM_ID", fsdata.get_ValueAsInt("C_UOM_ID"));
  302.                                     line_old.set_ValueOfColumn("kst_lcdate", rs.getTimestamp("lc_date"));
  303.                                     line_old.setkst_po_allocation_ID(poal.get_ID());
  304.                                     line_old.setPOReference(rs.getString("po_buyer"));
  305.                                     line_old.setqtyallocated(rs.getBigDecimal("stock_old"));
  306.                                     line_old.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  307.                                     if(!line_old.save(get_TrxName())){
  308.                                         line.delete(true);
  309.                                         State = 0;
  310.                                         rollback();
  311.                                         return "gagal save";
  312.                                     }else{
  313.                                         msg += rs.getString("id")+" , ";
  314.                                         State = 1;
  315.                                     }
  316.                                 }  
  317.                             }
  318.                         }else{ // New PO Allocation
  319.                             MOrderLine po_supp_line = new Query(getCtx(), MOrderLine.Table_Name, " C_Order_ID = ? AND M_Product_ID = ? ", get_TrxName())
  320.                                     .setClient_ID()
  321.                                     .setOnlyActiveRecords(true)
  322.                                     .setParameters(rs.getInt("c_order_id"),prd.get_ID())
  323.                                     .first();
  324.                             if(po_supp_line == null)    {
  325.                                 msg = "Some datas is not found";
  326.                             }else{
  327.                                 BigDecimal NewQty = rs.getBigDecimal("stock_new").setScale(4, RoundingMode.UP);
  328.                                 String sqlavail = "select kst_convertedqty("+NewQty+", "+prd.getM_Product_ID()+", "+uom.get_ID()+",  "+prd.getC_UOM_ID()+" ) ";
  329.                                 BigDecimal qtyAvail = DB.getSQLValueBD(get_TrxName(), sqlavail);
  330.                                 poal = new X_kst_PO_Allocation(getCtx(), 0, get_TrxName());
  331.                                 poal.set_ValueOfColumn("AD_Client_ID", m_AD_Client_ID);
  332.                                 poal.setAD_Org_ID(m_AD_Org_ID);
  333.                                 poal.setC_Order_ID(rs.getInt("c_order_id"));
  334.                                 poal.setC_OrderLine_ID(po_supp_line.get_ID());
  335.                                 poal.setM_Product_ID(prd.getM_Product_ID());
  336.                                 poal.setQty(NewQty);
  337.                                 poal.setQtyAvailable(qtyAvail);
  338.                                 poal.set_ValueOfColumn("C_UOM_ID", uom.get_ID());
  339.                                 poal.set_ValueOfColumn("M_Product_Category_ID", prd.getM_Product_Category_ID());
  340.                                 poal.setqtyallocated(Env.ZERO);
  341.                                 poal.set_ValueOfColumn("Description", "Opening Balance ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  342.                                 poal.set_ValueOfColumn("M_Warehouse_ID", rs.getInt("warehouse_id"));
  343.                                 poal.set_ValueOfColumn("type_stock", rs.getString("type_stock_erp_code"));
  344.                                 if(!poal.save(get_TrxName())){
  345.                                     poal.delete(true);
  346.                                     rollback();
  347.                                     return "gagal Save PO Alloc Header";
  348.                                 }else{
  349.                                     X_kst_PO_AllocationLine line = null;
  350.                                     line  = new X_kst_PO_AllocationLine(getCtx(), 0, get_TrxName());
  351.                                    
  352.                                     line.setAD_Org_ID(poal.getAD_Org_ID());
  353.                                     line.set_ValueOfColumn("AD_Client_ID", poal.getAD_Client_ID());
  354.                                     line.set_ValueOfColumn("Description", "Opening Balance ID "+rs.getString("id")+" | "+rs.getString("note")+" | "+rs.getString("source"));
  355.                                     line.set_ValueOfColumn("kst_lcdate",  rs.getTimestamp("lc_date"));
  356.                                     line.setkst_po_allocation_ID(poal.get_ID());
  357.                                     line.setPOReference(rs.getString("po_buyer"));
  358.                                     line.set_ValueOfColumn("kst_idwms", rs.getString("id"));
  359.                                     line.setqtyallocated(Env.ZERO);
  360.                                    
  361.                                     if(!line.save(get_TrxName())){
  362.                                         rollback();
  363.                                         return "gagal save Existing PO Alloc Line";
  364.                                     }else{
  365.                                         msg += rs.getString("id")+" , ";
  366.                                         State = 1;
  367.                                     }
  368.                                 }
  369.                             }
  370.                         }
  371.                     }
  372.                 }
  373.                 wmsId.add(rs.getString("id"));
  374.             }
  375.         }catch (Exception e){
  376.             msg = e.toString();
  377.             return msg;
  378.         }finally{
  379.             DB.close(rs, pstmt);
  380.             pstmt = null;
  381.             rs = null;
  382.         }
  383.         for (int i = 0; i < wmsId.size(); i++ ){
  384.             String wms_id = (String)wmsId.get(i);
  385.             DB.executeUpdate(" select * "
  386.             + " FROM dblink('"
  387.             + "dbname=" + dbname +" port=" + port +" host=" + ip +" user=" + user +"  password=" + password +"' "
  388.             + ",'Update history_material_stocks set is_integrate = true, integration_date = now()  "
  389.             + "WHERE id =''" + wms_id  +"''' ) tt(updated text);");
  390.             System.out.println("WMS #"+wms_id+" Updated IsIntegration...");
  391.         }
  392.         //msg = " \n " + msg2;
  393.         return msg;
  394.     }
  395.  
  396. }
Add Comment
Please, Sign In to add comment