From 893be04fd9afa3e25cd256a09daf79fb83ea32ea Mon Sep 17 00:00:00 2001 From: vpj-cd Date: Wed, 7 Nov 2007 19:56:19 +0000 Subject: [PATCH] [ adempiere-Posterita-1827793 ] Error using U_Menu and should use U_WebMenu http://sourceforge.net/tracker/?func=detail&atid=928568&aid=1827793&group_id=176962 --- .../posterita/businesslogic/MenuManager.java | 8 ++-- .../businesslogic/RoleMenuManager.java | 2 +- .../posterita/businesslogic/StockManager.java | 37 +++++++++++++++++++ .../src/main/org/posterita/model/MMenu.java | 4 +- .../{UDIU_Menu.java => UDIU_WebMenu.java} | 4 +- 5 files changed, 46 insertions(+), 9 deletions(-) rename posterita/src/main/org/posterita/model/{UDIU_Menu.java => UDIU_WebMenu.java} (96%) diff --git a/posterita/src/main/org/posterita/businesslogic/MenuManager.java b/posterita/src/main/org/posterita/businesslogic/MenuManager.java index 46d9832344..eac44a3b6a 100644 --- a/posterita/src/main/org/posterita/businesslogic/MenuManager.java +++ b/posterita/src/main/org/posterita/businesslogic/MenuManager.java @@ -317,19 +317,19 @@ public class MenuManager String sqlStatement = ""; - sqlStatement = "select m.U_Menu_ID, " + + sqlStatement = "select m.U_WebMenu_ID, " + "m.Name, m.MenuLink, " + "m.Module, m.ParentMenu_ID, " + "m.isActive, " + "m.ImageLink, m.Position " + - "from U_MENU m where " + //m.AD_Client_ID = " + adClientId + + "from U_WEBMENU m where " + //m.AD_Client_ID = " + adClientId + " m.AD_CLIENT_ID=0"+ " and m.AD_ORG_ID=0" + " and m.isactive = 'Y'"; // sqlStatement += " and m." + OrganisationManager.getOrganisationSqlStatement(ctx); - sqlStatement += " order by m.U_Menu_ID"; + sqlStatement += " order by m.U_WebMenu_ID"; System.out.println(sqlStatement); @@ -526,7 +526,7 @@ public class MenuManager { int id = POSMenuFactory.getFactoryInstance(ctx).get(ctx,role).getID(); - String sql="select AD_ROLE_ID from U_ROLEMENU where U_MENU_ID="+id; + String sql="select AD_ROLE_ID from U_ROLEMENU where U_WEBMENU_ID="+id; boolean access=false; int currentRoleId=Env.getAD_Role_ID(ctx); diff --git a/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java b/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java index 5776bdf6cb..097a215a75 100644 --- a/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java +++ b/posterita/src/main/org/posterita/businesslogic/RoleMenuManager.java @@ -42,7 +42,7 @@ public class RoleMenuManager if(parentMenuId != 0) { - int[] parentRoleMenuIds = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, " ad_role_id = " + roleId + " and u_menu_id = " + parentMenuId, trxName); + int[] parentRoleMenuIds = MRoleMenu.getAllIDs(MRoleMenu.Table_Name, " ad_role_id = " + roleId + " and u_webmenu_id = " + parentMenuId, trxName); if (parentRoleMenuIds.length == 0) roleMenu = createRoleMenu(ctx,roleId,parentMenuId, trxName); diff --git a/posterita/src/main/org/posterita/businesslogic/StockManager.java b/posterita/src/main/org/posterita/businesslogic/StockManager.java index 18dea57f6a..43a073c9d5 100644 --- a/posterita/src/main/org/posterita/businesslogic/StockManager.java +++ b/posterita/src/main/org/posterita/businesslogic/StockManager.java @@ -706,6 +706,43 @@ public class StockManager pstmt = null; } + //begin e-evolution is necessary find also search key + if (productId == 0) + { + sql = "select m_product_id from m_product where value='"+barCode+"'" + +" and AD_CLIENT_ID="+Env.getAD_Client_ID(ctx); + + System.out.println("BarCode: " + barCode); + + pstmt = DB.prepareStatement(sql, null); + + try + { + ResultSet rs = pstmt.executeQuery(); + while (rs.next()) + { + productId=rs.getInt(1); + } + rs.close(); + } + catch (SQLException e) + { + throw new OperationException(e); + } + finally + { + try + { + pstmt.close(); + } + catch(Exception e) + {} + + pstmt = null; + } + } + //end e-evolution is necessary find also search key + return productId; } diff --git a/posterita/src/main/org/posterita/model/MMenu.java b/posterita/src/main/org/posterita/model/MMenu.java index 0fdece7d6b..2aa31567d3 100644 --- a/posterita/src/main/org/posterita/model/MMenu.java +++ b/posterita/src/main/org/posterita/model/MMenu.java @@ -37,8 +37,8 @@ public class MMenu extends X_U_WebMenu */ private static final long serialVersionUID = 1L; - public MMenu(Properties ctx, int U_Menu_ID, String trxName) + public MMenu(Properties ctx, int U_WebMenu_ID, String trxName) { - super(ctx, U_Menu_ID, trxName); + super(ctx, U_WebMenu_ID, trxName); } } diff --git a/posterita/src/main/org/posterita/model/UDIU_Menu.java b/posterita/src/main/org/posterita/model/UDIU_WebMenu.java similarity index 96% rename from posterita/src/main/org/posterita/model/UDIU_Menu.java rename to posterita/src/main/org/posterita/model/UDIU_WebMenu.java index 9b5a4fe231..4d4d3e1ae1 100644 --- a/posterita/src/main/org/posterita/model/UDIU_Menu.java +++ b/posterita/src/main/org/posterita/model/UDIU_WebMenu.java @@ -23,9 +23,9 @@ import org.compiere.model.X_U_WebMenu; import org.posterita.exceptions.OperationException; -public class UDIU_Menu extends UDIPO +public class UDIU_WebMenu extends UDIPO { - public UDIU_Menu(X_U_WebMenu menu) + public UDIU_WebMenu(X_U_WebMenu menu) { super(menu); }