Update of /cvsroot/compiere/base/src/org/compiere/model In directory sc8-pr-cvs1:/tmp/cvs-serv1596/src/org/compiere/model Modified Files: Tag: pbs_payment MOrderLine.java MAttributeSetInstance.java PaymentProcessor.java CalloutRequest.java MPeriodControl.java UOM.java MSerNoCtl.java CalloutProduction.java CalloutEngine.java MLocatorLookup.java MPeriod.java MLot.java MBPartner.java CalloutOrder.java NaturalAccountMap.java MLocator.java MPayment.java MProject.java MOrder.java MCustomer.java MTree.java MInvoice.java CalloutSystem.java MDocType.java CalloutInvoice.java MLotCtl.java MPaySelectionCheck.java UOMConversion.java Tax.java MTable.java MProductPricing.java CalloutMovement.java MSetup.java MAsset.java CalloutInventory.java MStorage.java MTax.java MSchedule.java MField.java MTab.java MProductPriceVO.java MRef_List.java MProductPrice.java MWindow.java MInvoiceLine.java Removed Files: Tag: pbs_payment MRecordAccess.java Log Message: IFM + UI og andre Jacobting Index: MOrderLine.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MOrderLine.java,v retrieving revision 1.8.2.2 retrieving revision 1.8.2.3 diff -C2 -d -r1.8.2.2 -r1.8.2.3 Index: MAttributeSetInstance.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MAttributeSetInstance.java,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 Index: PaymentProcessor.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/PaymentProcessor.java,v retrieving revision 1.9.2.2 retrieving revision 1.9.2.3 diff -C2 -d -r1.9.2.2 -r1.9.2.3 Index: CalloutRequest.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutRequest.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Index: MPeriodControl.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MPeriodControl.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** MPeriodControl.java 14 Oct 2003 23:17:04 -0000 1.1.2.1 --- MPeriodControl.java 25 Nov 2003 14:20:56 -0000 1.1.2.2 *************** *** 37,42 **** // setC_Period_ID (0); // setDocBaseType (null); ! setPeriodAction (PERIODACTION_LENoActionGT); ! setPeriodStatus(PERIODSTATUS_Neveropened); } } // MPeriodControl --- 37,42 ---- // setC_Period_ID (0); // setDocBaseType (null); ! setPeriodAction (PERIODACTION_LeNoActionGt); ! setPeriodStatus(PERIODSTATUS_NeverOpened); } } // MPeriodControl Index: UOM.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/UOM.java,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** UOM.java 29 Oct 2003 14:16:11 -0000 1.4.2.1 --- UOM.java 25 Nov 2003 14:20:56 -0000 1.4.2.2 *************** *** 183,187 **** private static void loadUOMs (Properties ctx) { ! String sql = MRole.getDefault().addAccessSQL( "SELECT * FROM C_UOM " + "WHERE IsActive='Y'", --- 183,187 ---- private static void loadUOMs (Properties ctx) { ! String sql = MRole.getDefault(ctx, false).addAccessSQL( "SELECT * FROM C_UOM " + "WHERE IsActive='Y'", Index: MSerNoCtl.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MSerNoCtl.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 Index: CalloutProduction.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutProduction.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Index: CalloutEngine.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutEngine.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 Index: MLocatorLookup.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MLocatorLookup.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** MLocatorLookup.java 29 Oct 2003 14:16:11 -0000 1.1.2.2 --- MLocatorLookup.java 25 Nov 2003 14:20:56 -0000 1.1.2.3 *************** *** 273,277 **** if (m_only_Warehouse_ID != 0) sql.append("AND M_Warehouse_ID=").append(m_only_Warehouse_ID); ! String finalSql = MRole.getDefault().addAccessSQL( sql.toString(), "M_Locator", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); if (isInterrupted()) --- 273,277 ---- if (m_only_Warehouse_ID != 0) sql.append("AND M_Warehouse_ID=").append(m_only_Warehouse_ID); ! String finalSql = MRole.getDefault(m_ctx, false).addAccessSQL( sql.toString(), "M_Locator", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); if (isInterrupted()) Index: MPeriod.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MPeriod.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 Index: MLot.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MLot.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 Index: MBPartner.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MBPartner.java,v retrieving revision 1.13.2.3 retrieving revision 1.13.2.4 diff -C2 -d -r1.13.2.3 -r1.13.2.4 Index: CalloutOrder.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutOrder.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** CalloutOrder.java 29 Oct 2003 14:16:12 -0000 1.1.2.1 --- CalloutOrder.java 25 Nov 2003 14:20:56 -0000 1.1.2.2 *************** *** 128,132 **** newDocNo = true; if (newDocNo) ! if (Env.getContext(ctx, "#CompiereSys").equals("Y") && Env.getContextAsInt(ctx, "#AD_Client_ID") < 1000000) mTab.setValue("DocumentNo", "<" + rs.getString(6) + ">"); else --- 128,132 ---- newDocNo = true; if (newDocNo) ! if (Ini.getPropertyBool(Ini.P_COMPIERESYS) && Env.getAD_Client_ID(Env.getCtx()) < 1000000) mTab.setValue("DocumentNo", "<" + rs.getString(6) + ">"); else Index: NaturalAccountMap.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/NaturalAccountMap.java,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** NaturalAccountMap.java 13 Jul 2003 06:30:44 -0000 1.9 --- NaturalAccountMap.java 25 Nov 2003 14:20:56 -0000 1.9.2.1 *************** *** 45,49 **** /** Delimiter */ ! private String m_delim = ","; /** KeyNo */ private static int s_keyNo = 0; --- 45,49 ---- /** Delimiter */ ! // private String m_delim = ","; /** KeyNo */ private static int s_keyNo = 0; *************** *** 88,103 **** /** ! * Create Account Entry. * @param line line with info * Line format (9 fields) ! * A [Account Value] ! * B [Account Name] ! * C [Description] ! * D [Account Type] ! * E [Account Sign] ! * F [Document Controlled] ! * G [Summary Account] ! * H [Default_Account] ! * I [Parent Value] - ignored * * @return error message or "" if OK --- 88,103 ---- /** ! * Create Account Entry for Default Accounts only. * @param line line with info * Line format (9 fields) ! * 1 A [Account Value] ! * 2 B [Account Name] ! * 3 C [Description] ! * 4 D [Account Type] ! * 5 E [Account Sign] ! * 6 F [Document Controlled] ! * 7 G [Summary Account] ! * 8 H [Default_Account] ! * 9 I [Parent Value] - ignored * * @return error message or "" if OK *************** *** 122,130 **** // Parse Line - replace ",," with ", ," - tokenizer does not count empty fields ! st = new StringTokenizer(Util.replace(newLine.toString(), ",,", ", ,"), m_delim, false); // All fields there ? if (st.countTokens() < 9) { ! Log.error("NaturalAccountMap.parseLine - FieldNumber wrong: " + st.countTokens()); return ""; } --- 122,132 ---- // Parse Line - replace ",," with ", ," - tokenizer does not count empty fields ! String pLine = Util.replace(newLine.toString(), ",,", ", ,"); ! pLine = Util.replace(pLine, ",,", ", ,"); ! st = new StringTokenizer(pLine, ",", false); // All fields there ? if (st.countTokens() < 9) { ! Log.error("NaturalAccountMap.parseLine - FieldNumber wrong: " + st.countTokens() + " - " + pLine); return ""; } *************** *** 168,177 **** // Default Account may be blank if (Default_Account == null || Default_Account.length() == 0) ! Default_Account = String.valueOf(s_keyNo++); // Validation if (AccountType == null || AccountType.length() == 0) AccountType = "E"; ! if (IsSummary == null || IsSummary.length() == 0) ! IsSummary = "N"; if (AccountSign == null || AccountSign.length() == 0) AccountSign = "N"; --- 170,186 ---- // Default Account may be blank if (Default_Account == null || Default_Account.length() == 0) ! // Default_Account = String.valueOf(s_keyNo++); ! return ""; ! ! // No Summary Account ! if (IsSummary == null || IsSummary.length() == 0) ! IsSummary = "N"; ! if (!IsSummary.equals("N")) ! return ""; ! // Validation if (AccountType == null || AccountType.length() == 0) AccountType = "E"; ! if (AccountSign == null || AccountSign.length() == 0) AccountSign = "N"; Index: MLocator.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MLocator.java,v retrieving revision 1.9.2.2 retrieving revision 1.9.2.3 diff -C2 -d -r1.9.2.2 -r1.9.2.3 Index: MPayment.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MPayment.java,v retrieving revision 1.24.2.7 retrieving revision 1.24.2.8 diff -C2 -d -r1.24.2.7 -r1.24.2.8 Index: MProject.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MProject.java,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -C2 -d -r1.6.2.1 -r1.6.2.2 *** MProject.java 25 Sep 2003 14:36:35 -0000 1.6.2.1 --- MProject.java 25 Nov 2003 14:20:56 -0000 1.6.2.2 *************** *** 43,48 **** setPlannedQty (Env.ZERO); setProjectBalanceAmt (Env.ZERO); setIsCommitCeiling (false); - setIsService (false); setIsCommitment (false); setIsSummary (false); --- 43,48 ---- setPlannedQty (Env.ZERO); setProjectBalanceAmt (Env.ZERO); + // setProjectCategory(PROJECTCATEGORY_General); setIsCommitCeiling (false); setIsCommitment (false); setIsSummary (false); *************** *** 60,83 **** /** - * Set Service. - * (defined as button) - * @param IsService service - */ - public void setIsService (boolean IsService) - { - setValueNoCheck ("IsService", IsService ? "Y" : "N"); - } // setIsService - - /** - * Is Service. - * (defined as button) - * @return true if Service - */ - public boolean isService() - { - return "Y".equals(getValue("IsService")); - } // isService - - /** * Get Project Type as Int (is Button). * @return C_ProjectType_ID id --- 60,63 ---- *************** *** 119,123 **** { StringBuffer sb = new StringBuffer ("MProject[").append(getID()) ! .append("-").append(getValue()).append(",IsService=").append(isService()) .append("]"); return sb.toString(); --- 99,103 ---- { StringBuffer sb = new StringBuffer ("MProject[").append(getID()) ! .append("-").append(getValue()).append(",ProjectCategory=").append(getProjectCategory()) .append("]"); return sb.toString(); Index: MOrder.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MOrder.java,v retrieving revision 1.15.2.4 retrieving revision 1.15.2.5 diff -C2 -d -r1.15.2.4 -r1.15.2.5 *** MOrder.java 29 Oct 2003 14:16:12 -0000 1.15.2.4 --- MOrder.java 25 Nov 2003 14:20:57 -0000 1.15.2.5 *************** *** 47,51 **** // setDeliveryRule (DELIVERYRULE_Availability); ! setFreightCostRule (FREIGHTCOSTRULE_Freightincluded); setInvoiceRule (INVOICERULE_Immediate); setPaymentRule(PAYMENTRULE_OnCredit); --- 47,51 ---- // setDeliveryRule (DELIVERYRULE_Availability); ! setFreightCostRule (FREIGHTCOSTRULE_FreightIncluded); setInvoiceRule (INVOICERULE_Immediate); setPaymentRule(PAYMENTRULE_OnCredit); Index: MCustomer.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MCustomer.java,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** MCustomer.java 14 Oct 2003 23:17:05 -0000 1.3.2.1 --- MCustomer.java 25 Nov 2003 14:20:57 -0000 1.3.2.2 *************** *** 252,256 **** if (C_BPartner_ID == 0) { ! C_BPartner_ID = DB.getKeyNextNo(AD_Client_ID, "N", "C_BPartner"); log.debug("save - Insert BPartner " + C_BPartner_ID); String gr = "NULL"; --- 252,256 ---- if (C_BPartner_ID == 0) { ! C_BPartner_ID = DB.getKeyNextNo(AD_Client_ID, "C_BPartner"); log.debug("save - Insert BPartner " + C_BPartner_ID); String gr = "NULL"; *************** *** 309,313 **** if (C_BPartner_Location_ID == 0 && C_Location_ID != 0) { ! C_BPartner_Location_ID = DB.getKeyNextNo(AD_Client_ID, "N", "C_BPartner_Location"); log.debug("Insert BPartner Location " + C_BPartner_Location_ID + " (" + C_Location_ID + ")"); SQL = "INSERT INTO C_BPartner_Location" --- 309,313 ---- if (C_BPartner_Location_ID == 0 && C_Location_ID != 0) { ! C_BPartner_Location_ID = DB.getKeyNextNo(AD_Client_ID, "C_BPartner_Location"); log.debug("Insert BPartner Location " + C_BPartner_Location_ID + " (" + C_Location_ID + ")"); SQL = "INSERT INTO C_BPartner_Location" *************** *** 351,355 **** if (AD_User_ID == 0 && Contact.length() != 0) { ! AD_User_ID = DB.getKeyNextNo (AD_Client_ID, "N", "AD_User"); log.debug("Insert BPartner User/Contact " + AD_User_ID); String gr = "NULL"; --- 351,355 ---- if (AD_User_ID == 0 && Contact.length() != 0) { ! AD_User_ID = DB.getKeyNextNo (AD_Client_ID, "AD_User"); log.debug("Insert BPartner User/Contact " + AD_User_ID); String gr = "NULL"; Index: MTree.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MTree.java,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** MTree.java 29 Oct 2003 14:16:12 -0000 1.2.4.1 --- MTree.java 25 Nov 2003 14:20:57 -0000 1.2.4.2 *************** *** 16,19 **** --- 16,20 ---- import java.sql.*; import java.util.*; + import javax.sql.*; import org.compiere.util.*; *************** *** 26,30 **** * @version $Id$ */ ! public class MTree { /** --- 27,31 ---- * @version $Id$ */ ! public class MTree extends X_AD_Tree { /** *************** *** 33,83 **** * @param editable True, if tree can be modified * - includes inactive and empty summary nodes */ ! public MTree (int AD_Tree_ID, boolean editable) ! { ! this (AD_Tree_ID, 0, 0, editable); ! } // MTree ! ! /** ! * Construct Tree ! * @param AD_Tree_ID The tree to build ! * @param AD_User_ID Tree Bar Access control - optional ! * @param AD_Role_ID Menu Access control ! * @param editable True, if tree can be modified ! * - includes inactive and empty summary nodes ! */ ! public MTree (int AD_Tree_ID, ! int AD_User_ID, int AD_Role_ID, boolean editable) { ! Log.trace(Log.l4_Data, "MTree - AD_Tree_ID=" + AD_Tree_ID, ! "AD_Role_ID=" + AD_Role_ID + ", AD_User_ID=" + AD_User_ID ! + ", Editable=" + editable); ! ! m_AD_Tree_ID = AD_Tree_ID; ! m_AD_User_ID = AD_User_ID; ! m_AD_Role_ID = AD_Role_ID; m_editable = editable; - loadTree(); - } // MTree - - /** Tree ID */ - private int m_AD_Tree_ID; - /** Tree for User */ - private int m_AD_User_ID; - /** Role Access Control */ - private int m_AD_Role_ID; - /** Is Tree editable */ - private boolean m_editable; - - /** Tree Name */ - private String m_name; - /** Tree Description */ - private String m_description; - /** Tree Type */ - private String m_treeType; ! /** Table Name */ ! private String m_tableName = "AD_TreeNode"; /** Root Node */ private MTreeNode m_root = null; --- 34,53 ---- * @param editable True, if tree can be modified * - includes inactive and empty summary nodes + * @param ctx context for security */ ! public MTree (Properties ctx, int AD_Tree_ID, boolean editable) { ! super(ctx, AD_Tree_ID); ! log.info("AD_Tree_ID=" + AD_Tree_ID + ", Editable=" + editable); m_editable = editable; ! int AD_User_ID = Env.getContextAsInt(ctx, "AD_User_ID"); ! loadNodes(AD_User_ID); ! } // MTree + /** Is Tree editable */ + private boolean m_editable; + /** Table Name */ + private String m_nodeTableName = "AD_TreeNode"; /** Root Node */ private MTreeNode m_root = null; *************** *** 85,89 **** private ArrayList m_buffer = new ArrayList(); /** Prepared Statement for Node Details */ ! private PreparedStatement m_pstmtDetail; /*************************************************************************/ --- 55,59 ---- private ArrayList m_buffer = new ArrayList(); /** Prepared Statement for Node Details */ ! private RowSet m_nodeRowSet; /*************************************************************************/ *************** *** 103,127 **** String TreeType = null; if (keyColumnName.equals("AD_Menu_ID")) ! TreeType = X_AD_Tree.TREETYPE_Menu; else if (keyColumnName.equals("C_ElementValue_ID")) ! TreeType = X_AD_Tree.TREETYPE_ElementValueAccountetc; else if (keyColumnName.equals("M_Product_ID")) ! TreeType = X_AD_Tree.TREETYPE_Product; else if (keyColumnName.equals("C_BPartner_ID")) ! TreeType = X_AD_Tree.TREETYPE_BusPartner; else if (keyColumnName.equals("AD_Org_ID")) ! TreeType = X_AD_Tree.TREETYPE_Organization; else if (keyColumnName.equals("C_Project_ID")) ! TreeType = X_AD_Tree.TREETYPE_Project; else if (keyColumnName.equals("M_ProductCategory_ID")) ! TreeType = X_AD_Tree.TREETYPE_ProductCategory; else if (keyColumnName.equals("M_BOM_ID")) ! TreeType = X_AD_Tree.TREETYPE_BoM; else if (keyColumnName.equals("C_SalesRegion_ID")) ! TreeType = X_AD_Tree.TREETYPE_SalesRegion; else if (keyColumnName.equals("C_Campaign_ID")) ! TreeType = X_AD_Tree.TREETYPE_Campaign; else if (keyColumnName.equals("C_Activity_ID")) ! TreeType = X_AD_Tree.TREETYPE_Activity; else { --- 73,97 ---- String TreeType = null; if (keyColumnName.equals("AD_Menu_ID")) ! TreeType = TREETYPE_Menu; else if (keyColumnName.equals("C_ElementValue_ID")) ! TreeType = TREETYPE_ElementValueAccountEtc; else if (keyColumnName.equals("M_Product_ID")) ! TreeType = TREETYPE_Product; else if (keyColumnName.equals("C_BPartner_ID")) ! TreeType = TREETYPE_BusPartner; else if (keyColumnName.equals("AD_Org_ID")) ! TreeType = TREETYPE_Organization; else if (keyColumnName.equals("C_Project_ID")) ! TreeType = TREETYPE_Project; else if (keyColumnName.equals("M_ProductCategory_ID")) ! TreeType = TREETYPE_ProductCategory; else if (keyColumnName.equals("M_BOM_ID")) ! TreeType = TREETYPE_BoM; else if (keyColumnName.equals("C_SalesRegion_ID")) ! TreeType = TREETYPE_SalesRegion; else if (keyColumnName.equals("C_Campaign_ID")) ! TreeType = TREETYPE_Campaign; else if (keyColumnName.equals("C_Activity_ID")) ! TreeType = TREETYPE_Activity; else { *************** *** 157,163 **** * Get Primary Tree of Tree Type * @param TreeType see TREETYPE_ * @return MTree */ ! public static MTree getTree (String TreeType) { int AD_Tree_ID = 0; --- 127,134 ---- * Get Primary Tree of Tree Type * @param TreeType see TREETYPE_ + * @param ctx context for Security * @return MTree */ ! public static MTree getTree (Properties ctx, String TreeType) { int AD_Tree_ID = 0; *************** *** 187,248 **** } // ! MTree tree = new MTree (AD_Tree_ID, false); return tree; } // getTree ! /*************************************************************************/ ! ! /** ! * Load Tree ! */ ! private void loadTree() ! { ! // Get Tree info ! String sql = "SELECT Name, Description, TreeType " ! + "FROM AD_Tree " ! + "WHERE AD_Tree_ID=?" ! + " AND IsActive='Y'"; ! try ! { ! PreparedStatement pstmt = DB.prepareStatement(sql); ! pstmt.setInt(1, m_AD_Tree_ID); ! ResultSet rs = pstmt.executeQuery(); ! if (rs.next()) ! { ! m_name = rs.getString(1); ! m_description = rs.getString(2); ! if (m_description == null) ! m_description = ""; ! m_treeType = rs.getString(3); ! } ! rs.close(); ! pstmt.close(); ! } ! catch (SQLException e) ! { ! Log.error("MTree.loadTree", e); ! return; ! } ! loadNodes(); ! } // loadTree /** ! * Load Nodes */ ! private void loadNodes() { // TableName: AD_TreeNode ! if (m_treeType.equals(X_AD_Tree.TREETYPE_Menu)) ; // m_tableName += "MM"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_BusPartner)) ! m_tableName += "BP"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_Product)) ! m_tableName += "PR"; // SQL for TreeNodes StringBuffer cmd = new StringBuffer("SELECT " + "tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive " ! + "FROM ").append(m_tableName).append(" tn" + " LEFT OUTER JOIN AD_TreeBar tb ON (tn.AD_Tree_ID=tb.AD_Tree_ID" + " AND tn.Node_ID=tb.Node_ID AND tb.AD_User_ID=?) " // #1 --- 158,186 ---- } // ! MTree tree = new MTree (ctx, AD_Tree_ID, false); return tree; } // getTree ! /************************************************************************* /** ! * Load Nodes and Bar ! * @param AD_User_ID user */ ! private void loadNodes (int AD_User_ID) { // TableName: AD_TreeNode ! if (getTreeType().equals(TREETYPE_Menu)) ; // m_tableName += "MM"; ! else if (getTreeType().equals(TREETYPE_BusPartner)) ! m_nodeTableName += "BP"; ! else if (getTreeType().equals(TREETYPE_Product)) ! m_nodeTableName += "PR"; // SQL for TreeNodes StringBuffer cmd = new StringBuffer("SELECT " + "tn.Node_ID,tn.Parent_ID,tn.SeqNo,tb.IsActive " ! + "FROM ").append(m_nodeTableName).append(" tn" + " LEFT OUTER JOIN AD_TreeBar tb ON (tn.AD_Tree_ID=tb.AD_Tree_ID" + " AND tn.Node_ID=tb.Node_ID AND tb.AD_User_ID=?) " // #1 *************** *** 256,265 **** try { ! // Used in addToTree -> getNodeDetail ! m_pstmtDetail = DB.prepareStatement(prepareNodeDetail()); // PreparedStatement pstmt = DB.prepareStatement(cmd.toString()); ! pstmt.setInt(1, m_AD_User_ID); ! pstmt.setInt(2, m_AD_Tree_ID); // Get Tree & Bar ResultSet rs = pstmt.executeQuery(); --- 194,203 ---- try { ! // load Node details - addToTree -> getNodeDetail ! getNodeDetails(); // PreparedStatement pstmt = DB.prepareStatement(cmd.toString()); ! pstmt.setInt(1, AD_User_ID); ! pstmt.setInt(2, getAD_Tree_ID()); // Get Tree & Bar ResultSet rs = pstmt.executeQuery(); *************** *** 272,276 **** // if (node_ID == 0 && parent_ID == 0) ! m_root = new MTreeNode (node_ID, 0, m_name, m_description, 0, true, null, onBar); else addToTree (node_ID, parent_ID, seqNo, onBar); // calls getNodeDetail --- 210,214 ---- // if (node_ID == 0 && parent_ID == 0) ! m_root = new MTreeNode (node_ID, 0, getName(), getDescription(), 0, true, null, onBar); else addToTree (node_ID, parent_ID, seqNo, onBar); // calls getNodeDetail *************** *** 279,288 **** pstmt.close(); // ! m_pstmtDetail.close(); } catch (SQLException e) { Log.error("MTree.loadNodes", e); } // Done with loading - add remainder from buffer if (m_buffer.size() != 0) --- 217,229 ---- pstmt.close(); // ! m_nodeRowSet.close(); ! m_nodeRowSet = null; } catch (SQLException e) { Log.error("MTree.loadNodes", e); + m_nodeRowSet = null; } + // Done with loading - add remainder from buffer if (m_buffer.size() != 0) *************** *** 377,386 **** /** ! * Prepare Node Detail. * Columns: * - Name * - Description * - IsSummary * - ImageIndicator * Parameter: * - Node_ID --- 318,330 ---- /** ! * Get Node Detail. ! * Loads data into RowSet m_nodeRowSet * Columns: + * - ID * - Name * - Description * - IsSummary * - ImageIndicator + * - additional for Menu * Parameter: * - Node_ID *************** *** 388,458 **** * @return SQL to get Node Detail Info */ ! private String prepareNodeDetail () { // SQL for Node Info ! StringBuffer cmdNode = new StringBuffer(); ! if (m_treeType.equals(X_AD_Tree.TREETYPE_Menu)) { boolean base = Env.isBaseLanguage(Env.getCtx(), "AD_Menu"); if (base) ! cmdNode.append("SELECT m.Name,m.Description,m.IsSummary,m.Action " + "FROM AD_Menu m"); else ! cmdNode.append("SELECT t.Name,t.Description,m.IsSummary,m.Action " + "FROM AD_Menu m, AD_Menu_Trl t"); - if (!m_editable) - cmdNode.append(", (SELECT ").append(m_AD_Role_ID).append(" AS XRole FROM DUAL) x"); - // WHERE - cmdNode.append(" WHERE m.AD_Menu_ID=?"); // #1 if (!base) ! cmdNode.append(" AND m.AD_Menu_ID=t.AD_Menu_ID AND t.AD_Language='") .append(Env.getAD_Language(Env.getCtx())).append("'"); if (!m_editable) ! cmdNode.append(" AND m.IsActive='Y' " ! + "AND (m.IsSummary='Y' OR m.Action='B'" ! + " OR EXISTS (SELECT * FROM AD_Window_Access wa WHERE wa.AD_Window_ID=m.AD_Window_ID AND wa.AD_Role_ID=XRole AND wa.IsActive='Y')" ! + " OR EXISTS (SELECT * FROM AD_Process_Access wa WHERE wa.AD_Process_ID=m.AD_Process_ID AND wa.AD_Role_ID=XRole AND wa.IsActive='Y')" ! + " OR EXISTS (SELECT * FROM AD_Form_Access wa WHERE wa.AD_Form_ID=m.AD_Form_ID AND wa.AD_Role_ID=XRole AND wa.IsActive='Y')" ! + " OR EXISTS (SELECT * FROM AD_Task_Access wa WHERE wa.AD_Task_ID=m.AD_Task_ID AND wa.AD_Role_ID=XRole AND wa.IsActive='Y')" ! + " OR EXISTS (SELECT * FROM AD_Workflow_Access wa WHERE wa.AD_Workflow_ID=m.AD_Workflow_ID AND wa.AD_Role_ID=XRole AND wa.IsActive='Y')" ! + ")"); } else { ! cmdNode.append("SELECT Name,Description,IsSummary,NULL FROM "); ! // ! String sourceTable = null; ! if (m_treeType.equals(X_AD_Tree.TREETYPE_Organization)) sourceTable = "AD_Org"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_Product)) sourceTable = "M_Product"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_ProductCategory)) sourceTable = "M_Product_Category"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_BoM)) sourceTable = "M_BOM"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_ElementValueAccountetc)) sourceTable = "C_ElementValue"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_BusPartner)) sourceTable = "C_BPartner"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_Campaign)) sourceTable = "C_Campaign"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_Project)) sourceTable = "C_Project"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_Activity)) sourceTable = "C_Activity"; ! else if (m_treeType.equals(X_AD_Tree.TREETYPE_SalesRegion)) sourceTable = "C_SalesRegion"; if (sourceTable == null) { ! throw new IllegalArgumentException("MTree.prepareNodeDetail - Unknown TreeType=" + m_treeType); } ! cmdNode.append(sourceTable).append(" WHERE ") ! .append(sourceTable).append("_ID=?"); // #1 if (!m_editable) ! cmdNode.append(" AND IsActive='Y'"); } ! Log.trace(Log.l6_Database, "MTree.prepareNodeDetail", cmdNode.toString()); ! return cmdNode.toString(); ! } // prepareNodeDetail /** --- 332,397 ---- * @return SQL to get Node Detail Info */ ! private void getNodeDetails () { // SQL for Node Info ! StringBuffer sqlNode = new StringBuffer(); ! String sourceTable = null; ! if (getTreeType().equals(TREETYPE_Menu)) { boolean base = Env.isBaseLanguage(Env.getCtx(), "AD_Menu"); + sourceTable = "m"; if (base) ! sqlNode.append("SELECT m.AD_Menu_ID, m.Name,m.Description,m.IsSummary,m.Action, " ! + "m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID, m.AD_Workflow_ID, m.AD_Task_ID, m.AD_Workbench_ID " + "FROM AD_Menu m"); else ! sqlNode.append("SELECT m_AD_Menu_ID, t.Name,t.Description,m.IsSummary,m.Action, " ! + "m.AD_Window_ID, m.AD_Process_ID, m.AD_Form_ID, m.AD_Workflow_ID, m.AD_Task_ID, m.AD_Workbench_ID " + "FROM AD_Menu m, AD_Menu_Trl t"); if (!base) ! sqlNode.append(" WHERE m.AD_Menu_ID=t.AD_Menu_ID AND t.AD_Language='") .append(Env.getAD_Language(Env.getCtx())).append("'"); if (!m_editable) ! { ! boolean hasWhere = sqlNode.indexOf(" WHERE ") != -1; ! sqlNode.append(hasWhere ? " AND " : " WHERE ").append(" m.IsActive='Y' "); ! } } else { ! if (getTreeType().equals(TREETYPE_Organization)) sourceTable = "AD_Org"; ! else if (getTreeType().equals(TREETYPE_Product)) sourceTable = "M_Product"; ! else if (getTreeType().equals(TREETYPE_ProductCategory)) sourceTable = "M_Product_Category"; ! else if (getTreeType().equals(TREETYPE_BoM)) sourceTable = "M_BOM"; ! else if (getTreeType().equals(TREETYPE_ElementValueAccountEtc)) sourceTable = "C_ElementValue"; ! else if (getTreeType().equals(TREETYPE_BusPartner)) sourceTable = "C_BPartner"; ! else if (getTreeType().equals(TREETYPE_Campaign)) sourceTable = "C_Campaign"; ! else if (getTreeType().equals(TREETYPE_Project)) sourceTable = "C_Project"; ! else if (getTreeType().equals(TREETYPE_Activity)) sourceTable = "C_Activity"; ! else if (getTreeType().equals(TREETYPE_SalesRegion)) sourceTable = "C_SalesRegion"; if (sourceTable == null) { ! throw new IllegalArgumentException("MTree.prepareNodeDetail - Unknown TreeType=" + getTreeType()); } ! sqlNode.append("SELECT ").append(sourceTable).append("_ID,Name,Description,IsSummary,NULL FROM ") ! .append(sourceTable); if (!m_editable) ! sqlNode.append(" WHERE IsActive='Y'"); } ! String sql = MRole.getDefault(getCtx(), false).addAccessSQL(sqlNode.toString(), ! sourceTable, MRole.SQL_FULLYQUALIFIED, m_editable); ! log.debug("getNodeDetails - " + sql); ! m_nodeRowSet = DB.getRowSet (sql); ! } // getNodeDetails /** *************** *** 470,490 **** try { ! m_pstmtDetail.setInt(1, node_ID); ! ResultSet rs = m_pstmtDetail.executeQuery(); ! if (rs.next()) { ! retValue = new MTreeNode (node_ID, seqNo, ! rs.getString(1), // name ! rs.getString(2), // description ! parent_ID, ! "Y".equals(rs.getString(3)), // IsSummary ! rs.getString(4), // ImageIndicator ! onBar); } - rs.close(); } catch (SQLException e) { ! Log.error("MTree.getNodeDetail", e); } return retValue; --- 409,468 ---- try { ! m_nodeRowSet.beforeFirst(); ! while (m_nodeRowSet.next()) { ! int node = m_nodeRowSet.getInt(1); ! if (node_ID != node) // search for correct one ! continue; ! // ! int index = 2; ! String name = m_nodeRowSet.getString(index++); ! String description = m_nodeRowSet.getString(index++); ! boolean isSummary = "Y".equals(m_nodeRowSet.getString(index++)); ! String action = m_nodeRowSet.getString(index++); ! // ! if (getTreeType().equals(TREETYPE_Menu) && !isSummary) ! { ! int AD_Window_ID = m_nodeRowSet.getInt(index++); ! int AD_Process_ID = m_nodeRowSet.getInt(index++); ! int AD_Form_ID = m_nodeRowSet.getInt(index++); ! int AD_Workflow_ID = m_nodeRowSet.getInt(index++); ! int AD_Task_ID = m_nodeRowSet.getInt(index++); ! int AD_Workbench_ID = m_nodeRowSet.getInt(index++); ! // ! MRole role = MRole.getDefault(getCtx(), false); ! Boolean access = null; ! if (X_AD_Menu.ACTION_Window.equals(action)) ! access = role.getWindowAccess(AD_Window_ID); ! else if (X_AD_Menu.ACTION_Process.equals(action) || X_AD_Menu.ACTION_Report.equals(action)) ! access = role.getProcessAccess(AD_Process_ID); ! else if (X_AD_Menu.ACTION_Form.equals(action)) ! access = role.getFormAccess(AD_Form_ID); ! else if (X_AD_Menu.ACTION_WorkFlow.equals(action)) ! access = role.getWorkflowAccess(AD_Workflow_ID); ! else if (X_AD_Menu.ACTION_Task.equals(action)) ! access = role.getTaskAccess(AD_Task_ID); ! // else if (X_AD_Menu.ACTION_Workbench.equals(action)) ! // access = role.getWorkbenchAccess(AD_Window_ID); ! // log.debug("getNodeDetail - " + name + " - " + action + " - " + access); ! // ! if (access != null) // rw or ro ! { ! retValue = new MTreeNode (node_ID, seqNo, ! name, description, parent_ID, isSummary, ! action, onBar); ! } ! } ! else ! { // always add ! retValue = new MTreeNode (node_ID, seqNo, ! name, description, parent_ID, isSummary, ! action, onBar); ! } } } catch (SQLException e) { ! log.error("getNodeDetails", e); } return retValue; *************** *** 547,556 **** /** ! * Get Table Name * @return Table Name */ ! public String getTableName() { ! return m_tableName; } // getTableName --- 525,534 ---- /** ! * Get Node Table Name * @return Table Name */ ! public String getNodeTableName() { ! return m_nodeTableName; } // getTableName *************** *** 562,567 **** { StringBuffer sb = new StringBuffer("MTree["); ! sb.append("AD_Tree_ID=").append(m_AD_Tree_ID) ! .append(", Name=").append(m_name); sb.append("]"); return sb.toString(); --- 540,545 ---- { StringBuffer sb = new StringBuffer("MTree["); ! sb.append("AD_Tree_ID=").append(getAD_Tree_ID()) ! .append(", Name=").append(getName()); sb.append("]"); return sb.toString(); Index: MInvoice.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MInvoice.java,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** MInvoice.java 14 Oct 2003 23:17:05 -0000 1.11.2.2 --- MInvoice.java 25 Nov 2003 14:20:57 -0000 1.11.2.3 *************** *** 146,150 **** // Set Contact MUser[] contacts = bp.getContacts(); ! if (contacts != null && contacts.length == 1) setAD_User_ID(contacts[0].getAD_User_ID()); } // setBPartner --- 146,150 ---- // Set Contact MUser[] contacts = bp.getContacts(); ! if (contacts != null && contacts.length > 0) // get first User setAD_User_ID(contacts[0].getAD_User_ID()); } // setBPartner Index: CalloutSystem.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutSystem.java,v retrieving revision 1.43.2.3 retrieving revision 1.43.2.4 diff -C2 -d -r1.43.2.3 -r1.43.2.4 Index: MDocType.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MDocType.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Index: CalloutInvoice.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutInvoice.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Index: MLotCtl.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MLotCtl.java,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 Index: MPaySelectionCheck.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MPaySelectionCheck.java,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 Index: UOMConversion.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/UOMConversion.java,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** UOMConversion.java 29 Oct 2003 14:16:11 -0000 1.4.2.1 --- UOMConversion.java 25 Nov 2003 14:20:57 -0000 1.4.2.2 *************** *** 214,218 **** s_conversions = new HashMap(); // ! String sql = MRole.getDefault().addAccessSQL ( "SELECT C_UOM_ID, C_UOM_To_ID, MultiplyRate, DivideRate " + "FROM C_UOM_Conversion " --- 214,218 ---- s_conversions = new HashMap(); // ! String sql = MRole.getDefault(ctx, false).addAccessSQL ( "SELECT C_UOM_ID, C_UOM_To_ID, MultiplyRate, DivideRate " + "FROM C_UOM_Conversion " Index: Tax.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/Tax.java,v retrieving revision 1.10.4.4 retrieving revision 1.10.4.5 diff -C2 -d -r1.10.4.4 -r1.10.4.5 *** Tax.java 29 Oct 2003 14:16:11 -0000 1.10.4.4 --- Tax.java 25 Nov 2003 14:20:57 -0000 1.10.4.5 *************** *** 24,28 **** * @author Jorg Janke * @version $Id$ ! */ public class Tax { --- 24,29 ---- * @author Jorg Janke * @version $Id$ ! * PN-Changed ! **/ public class Tax { Index: MTable.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MTable.java,v retrieving revision 1.40.2.3 retrieving revision 1.40.2.4 diff -C2 -d -r1.40.2.3 -r1.40.2.4 *** MTable.java 29 Oct 2003 14:16:11 -0000 1.40.2.3 --- MTable.java 25 Nov 2003 14:20:57 -0000 1.40.2.4 *************** *** 288,294 **** // if (!m_readOnly) // ro = MRole.SQL_RW; ! m_SQL = MRole.getDefault().addAccessSQL(m_SQL, m_tableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); ! m_SQL_Count = MRole.getDefault().addAccessSQL(m_SQL_Count, m_tableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); } --- 288,294 ---- // if (!m_readOnly) // ro = MRole.SQL_RW; ! m_SQL = MRole.getDefault(m_ctx, false).addAccessSQL(m_SQL, m_tableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); ! m_SQL_Count = MRole.getDefault(m_ctx, false).addAccessSQL(m_SQL_Count, m_tableName, MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); } *************** *** 315,319 **** return; } ! if (!MRole.getDefault().isColumnAccess (m_AD_Table_ID, field.getAD_Column_ID(), true)) { log.debug ("addField - No Column Access " + field.getColumnName()); --- 315,319 ---- return; } ! if (!MRole.getDefault(m_ctx, false).isColumnAccess (m_AD_Table_ID, field.getAD_Column_ID(), true)) { log.debug ("addField - No Column Access " + field.getColumnName()); *************** *** 1156,1160 **** int AD_Client_ID = co[0]; int AD_Org_ID = co[1]; ! if (!MRole.getDefault().canUpdate(AD_Client_ID, AD_Org_ID, m_AD_Table_ID, true)) { fireDataStatusEEvent(Log.retrieveError()); --- 1156,1160 ---- int AD_Client_ID = co[0]; int AD_Org_ID = co[1]; ! if (!MRole.getDefault(m_ctx, false).canUpdate(AD_Client_ID, AD_Org_ID, m_AD_Table_ID, true)) { fireDataStatusEEvent(Log.retrieveError()); *************** *** 1451,1455 **** } ! // Data changed else if (m_inserting || (m_rowData[col] == null && rowData[col] != null) --- 1451,1455 ---- } ! // *** Data changed *** else if (m_inserting || (m_rowData[col] == null && rowData[col] != null) *************** *** 1470,1473 **** --- 1470,1474 ---- rs.updateNull (col + 1); // *** } + // Numeric - BigDecimal else if (DisplayType.isNumeric (field.getDisplayType ())) { *************** *** 1478,1481 **** --- 1479,1483 ---- type = "Number"; } + // ID - int else if (DisplayType.isID (field.getDisplayType ())) { *************** *** 1498,1501 **** --- 1500,1504 ---- type = "ID"; } + // Date - Timestamp else if (DisplayType.isDate (field.getDisplayType ())) { *************** *** 1506,1510 **** type = "Date"; } ! else // String and others { if (manualUpdate) --- 1509,1523 ---- type = "Date"; } ! // LOB ! else if (field.getDisplayType() == DisplayType.TextLong) ! { ! if (manualUpdate) ! createUpdateSql (columnName, "empty_clob()"); ! // else ! // rs.updateClob(col + 1, ); // *** ! type = "CLOB"; ! } ! // String and others ! else { if (manualUpdate) *************** *** 2149,2153 **** int AD_Client_ID = co[0]; int AD_Org_ID = co[1]; ! return MRole.getDefault().canUpdate(AD_Client_ID, AD_Org_ID, m_AD_Table_ID, false); } // isRowEditable --- 2162,2166 ---- int AD_Client_ID = co[0]; int AD_Org_ID = co[1]; ! return MRole.getDefault(m_ctx, false).canUpdate(AD_Client_ID, AD_Org_ID, m_AD_Table_ID, false); } // isRowEditable *************** *** 2282,2285 **** --- 2295,2311 ---- rid[1] = new Boolean(false); rowData[j] = rid; + } + // LOB + else if (displayType == DisplayType.TextLong) + { + Object value = rs.getObject(j+1); + if (rs.wasNull()) + rowData[j] = null; + else if (value instanceof Clob) + { + Clob lob = (Clob)value; + long length = lob.length(); + rowData[j] = lob.getSubString(1, (int)length); + } } // String Index: MProductPricing.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MProductPricing.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Index: CalloutMovement.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/CalloutMovement.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Index: MSetup.java =================================================================== RCS file: /cvsroot/compiere/base/src/org/compiere/model/MSetup.java,v retrieving revision 1.24.2.2 retrieving revision 1.24.2.3 diff -C2 -d -r1.24.2.2 -r1.24.2.3 *** MSetup.java 25 Sep 2003 14:36:36 -0000 1.24.2.2 --- MSetup.java 25 Nov 2003 14:20:57 -0000 1.24.2.3 *************** *** 54,59 **** private NaturalAccountMap m_nap = null; // ! private final String CompiereSys = "N"; // Should NOT be changed ! private int AD_Client_ID = 1000000; // initial Client_ID // private int AD_Org_ID; --- 54,58 ---- private NaturalAccountMap m_nap = null; // ! private int AD_Client_ID = 1000001; // initial Client_ID // private int AD_Org_ID; *************** *** 98,103 **** * Create Client */ ! Env.setContext(m_ctx, "#CompiereSys", CompiereSys); ! AD_Client_ID = DB.getKeyNextNo (AD_Client_ID, CompiereSys, "AD_Client"); Env.setContext(m_ctx, m_WindowNo, "AD_Client_ID", AD_Client_ID); --- 97,101 ---- * Create Client */ ! AD_Client_ID = DB.getKeyNextNo (AD_Client_ID, "AD_Client"); Env.setContext(m_ctx, m_WindowNo, "AD_Client_ID", AD_Client_ID); *************** *** 148,177 **** if (value.equals("OO")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); AD_Tree_Org_ID = AD_Tree_ID; } else if (value.equals("BP")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); AD_Tree_BPartner_ID = AD_Tree_ID; } else if (value.equals("PJ")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); AD_Tree_Project_ID = AD_Tree_ID; } else if (value.equals("SR")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); AD_Tree_SalesRegion_ID = AD_Tree_ID; } else if (value.equals("PR")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); AD_Tree_Product_ID = AD_Tree_ID; } else if (value.endsWith("EV")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); AD_Tree_Account_ID = AD_Tree_ID; } --- 146,175 ---- if (value.equals("OO")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); AD_Tree_Org_ID = AD_Tree_ID; } else if (value.equals("BP")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); AD_Tree_BPartner_ID = AD_Tree_ID; } else if (value.equals("PJ")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); AD_Tree_Project_ID = AD_Tree_ID; } else if (value.equals("SR")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); AD_Tree_SalesRegion_ID = AD_Tree_ID; } else if (value.equals("PR")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); AD_Tree_Product_ID = AD_Tree_ID; } else if (value.endsWith("EV")) { ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); AD_Tree_Account_ID = AD_Tree_ID; } *************** *** 180,184 **** else // PC (Product Category), BB (BOM), MC (Marketing Campaign), AY (Activity) ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Tree"); // --- 178,182 ---- else // PC (Product Category), BB (BOM), MC (Marketing Campaign), AY (Activity) ! AD_Tree_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Tree"); // *************** *** 225,229 **** * Create Org */ ! AD_Org_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Org"); m_stdValuesOrg = AD_Client_ID + "," + AD_Org_ID + ",'Y',SysDate,0,SysDate,0"; --- 223,227 ---- * Create Org */ ! AD_Org_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Org"); m_stdValuesOrg = AD_Client_ID + "," + AD_Org_ID + ",'Y',SysDate,0,SysDate,0"; *************** *** 251,255 **** */ name = m_clientName + " Admin"; ! AD_Role_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Role"); sql = "INSERT INTO AD_Role(" + m_stdColumns + ",AD_Role_ID," + "Name,Description,UserLevel,ClientList,OrgList)" --- 249,253 ---- */ name = m_clientName + " Admin"; ! AD_Role_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Role"); sql = "INSERT INTO AD_Role(" + m_stdColumns + ",AD_Role_ID," + "Name,Description,UserLevel,ClientList,OrgList)" *************** *** 281,285 **** // name = m_clientName + " User"; ! int AD_Role_ID_U = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Role"); sql = "INSERT INTO AD_Role(" + m_stdColumns + ",AD_Role_ID," + "Name,Description,UserLevel,ClientList,OrgList)" --- 279,283 ---- // name = m_clientName + " User"; ! int AD_Role_ID_U = DB.getKeyNextNo(AD_Client_ID, "AD_Role"); sql = "INSERT INTO AD_Role(" + m_stdColumns + ",AD_Role_ID," + "Name,Description,UserLevel,ClientList,OrgList)" *************** *** 311,315 **** if (name == null || name.length() == 0) name = m_clientName + "Client"; ! AD_User_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_User"); AD_User_Name = name; sql = "INSERT INTO AD_User(" + m_stdColumns + ",AD_User_ID," --- 309,313 ---- if (name == null || name.length() == 0) name = m_clientName + "Client"; ! AD_User_ID = DB.getKeyNextNo(AD_Client_ID, "AD_User"); AD_User_Name = name; sql = "INSERT INTO AD_User(" + m_stdColumns + ",AD_User_ID," *************** *** 331,335 **** if (name == null || name.length() == 0) name = m_clientName + "Org"; ! AD_User_U_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_User"); AD_User_U_Name = name; sql = "INSERT INTO AD_User(" + m_stdColumns + ",AD_User_ID," --- 329,333 ---- if (name == null || name.length() == 0) name = m_clientName + "Org"; ! AD_User_U_ID = DB.getKeyNextNo(AD_Client_ID, "AD_User"); AD_User_U_Name = name; sql = "INSERT INTO AD_User(" + m_stdColumns + ",AD_User_ID," *************** *** 426,430 **** * Create Calendar */ ! C_Calendar_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_Calendar"); name = m_clientName + " " + Msg.translate(m_lang, "C_Calendar_ID"); sqlCmd = new StringBuffer("INSERT INTO C_Calendar("); --- 424,428 ---- * Create Calendar */ ! C_Calendar_ID = DB.getKeyNextNo(AD_Client_ID, "C_Calendar"); name = m_clientName + " " + Msg.translate(m_lang, "C_Calendar_ID"); sqlCmd = new StringBuffer("INSERT INTO C_Calendar("); *************** *** 443,447 **** // Year ! int C_Year_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_Year"); sqlCmd = new StringBuffer ("INSERT INTO C_Year "); sqlCmd.append("(C_Year_ID,").append(m_stdColumns).append(","); --- 441,445 ---- // Year ! int C_Year_ID = DB.getKeyNextNo(AD_Client_ID, "C_Year"); sqlCmd = new StringBuffer ("INSERT INTO C_Year "); sqlCmd.append("(C_Year_ID,").append(m_stdColumns).append(","); *************** *** 456,460 **** // Create Account Elements ! int C_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_Element"); name = m_clientName + " " + Msg.translate(m_lang, "Account_ID"); sqlCmd = new StringBuffer ("INSERT INTO C_ELEMENT("); --- 454,458 ---- // Create Account Elements ! int C_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_Element"); name = m_clientName + " " + Msg.translate(m_lang, "Account_ID"); sqlCmd = new StringBuffer ("INSERT INTO C_ELEMENT("); *************** *** 498,502 **** * Create AccountingSchema */ ! C_AcctSchema_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema"); // String GAAP = "US"; // AD_Reference_ID=123 --- 496,500 ---- * Create AccountingSchema */ ! C_AcctSchema_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema"); // String GAAP = "US"; // AD_Reference_ID=123 *************** *** 551,555 **** if (ElementType.equals("OO")) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_OO = C_AcctSchema_Element_ID; IsMandatory = "Y"; --- 549,553 ---- if (ElementType.equals("OO")) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_OO = C_AcctSchema_Element_ID; IsMandatory = "Y"; *************** *** 559,563 **** else if (ElementType.equals("AC")) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_AC = C_AcctSchema_Element_ID; IsMandatory = "Y"; --- 557,561 ---- else if (ElementType.equals("AC")) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_AC = C_AcctSchema_Element_ID; IsMandatory = "Y"; *************** *** 566,570 **** else if (ElementType.equals("PR") && hasProduct) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_PR = C_AcctSchema_Element_ID; IsMandatory = "N"; --- 564,568 ---- else if (ElementType.equals("PR") && hasProduct) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_PR = C_AcctSchema_Element_ID; IsMandatory = "N"; *************** *** 573,577 **** else if (ElementType.equals("BP") && hasBPartner) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_BP = C_AcctSchema_Element_ID; IsMandatory = "N"; --- 571,575 ---- else if (ElementType.equals("BP") && hasBPartner) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_BP = C_AcctSchema_Element_ID; IsMandatory = "N"; *************** *** 580,584 **** else if (ElementType.equals("PJ") && hasProject) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_PJ = C_AcctSchema_Element_ID; IsMandatory = "N"; --- 578,582 ---- else if (ElementType.equals("PJ") && hasProject) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_PJ = C_AcctSchema_Element_ID; IsMandatory = "N"; *************** *** 587,591 **** else if (ElementType.equals("MC") && hasMCampaign) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_MC = C_AcctSchema_Element_ID; IsMandatory = "N"; --- 585,589 ---- else if (ElementType.equals("MC") && hasMCampaign) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_MC = C_AcctSchema_Element_ID; IsMandatory = "N"; *************** *** 594,598 **** else if (ElementType.equals("SR") && hasSRegion) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_AcctSchema_Element"); Element_SR = C_AcctSchema_Element_ID; IsMandatory = "N"; --- 592,596 ---- else if (ElementType.equals("SR") && hasSRegion) { ! C_AcctSchema_Element_ID = DB.getKeyNextNo(AD_Client_ID, "C_AcctSchema_Element"); Element_SR = C_AcctSchema_Element_ID; IsMandatory = "N"; *************** *** 859,863 **** private int createGLCategory (String Name, String CategoryType, boolean isDefault) { ! int GL_Category_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "GL_Category"); StringBuffer sqlCmd = new StringBuffer ("INSERT INTO GL_Category "); sqlCmd.append("(GL_Category_ID,").append(m_stdColumns).append(",") --- 857,861 ---- private int createGLCategory (String Name, String CategoryType, boolean isDefault) { ! int GL_Category_ID = DB.getKeyNextNo(AD_Client_ID, "GL_Category"); StringBuffer sqlCmd = new StringBuffer ("INSERT INTO GL_Category "); sqlCmd.append("(GL_Category_ID,").append(m_stdColumns).append(",") *************** *** 895,899 **** if (StartNo != 0) // manual sequenec, if startNo == 0 { ! AD_Sequence_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "AD_Sequence"); sqlCmd = new StringBuffer ("INSERT INTO AD_Sequence "); sqlCmd.append("(AD_Sequence_ID,").append(m_stdColumns).append(","); --- 893,897 ---- if (StartNo != 0) // manual sequenec, if startNo == 0 { ! AD_Sequence_ID = DB.getKeyNextNo(AD_Client_ID, "AD_Sequence"); sqlCmd = new StringBuffer ("INSERT INTO AD_Sequence "); sqlCmd.append("(AD_Sequence_ID,").append(m_stdColumns).append(","); *************** *** 909,913 **** // Get Document Type ! int C_DocType_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_DocType"); sqlCmd = new StringBuffer ("INSERT INTO C_DocType "); sqlCmd.append("(C_DocType_ID,").append(m_stdColumns).append(","); --- 907,911 ---- // Get Document Type ! int C_DocType_ID = DB.getKeyNextNo(AD_Client_ID, "C_DocType"); sqlCmd = new StringBuffer ("INSERT INTO C_DocType "); sqlCmd.append("(C_DocType_ID,").append(m_stdColumns).append(","); *************** *** 982,986 **** // Create Marketing Channel/Campaign ! int C_Channel_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_Channel"); sqlCmd = new StringBuffer("INSERT INTO C_Channel "); sqlCmd.append("(C_Channel_ID,Name,"); --- 980,984 ---- // Create Marketing Channel/Campaign ! int C_Channel_ID = DB.getKeyNextNo(AD_Client_ID, "C_Channel"); sqlCmd = new StringBuffer("INSERT INTO C_Channel "); sqlCmd.append("(C_Channel_ID,Name,"); *************** *** 991,995 **** if (no != 1) Log.error("MSetup.createEntities - Channel NOT inserted"); ! int C_Campaign_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_Campaign"); sqlCmd = new StringBuffer("INSERT INTO C_Campaign "); sqlCmd.append("(C_Campaign_ID,C_Channel_ID,").append(m_stdColumns).append(","); --- 989,993 ---- if (no != 1) Log.error("MSetup.createEntities - Channel NOT inserted"); ! int C_Campaign_ID = DB.getKeyNextNo(AD_Client_ID, "C_Campaign"); sqlCmd = new StringBuffer("INSERT INTO C_Campaign "); sqlCmd.append("(C_Campaign_ID,C_Channel_ID,").append(m_stdColumns).append(","); *************** *** 1015,1019 **** // Create Sales Region ! int C_SalesRegion_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_SalesRegion"); sqlCmd = new StringBuffer ("INSERT INTO C_SalesRegion "); sqlCmd.append("(C_SalesRegion_ID,").append(m_stdColumns).append(","); --- 1013,1017 ---- // Create Sales Region ! int C_SalesRegion_ID = DB.getKeyNextNo(AD_Client_ID, "C_SalesRegion"); sqlCmd = new StringBuffer ("INSERT INTO C_SalesRegion "); sqlCmd.append("(C_SalesRegion_ID,").append(m_stdColumns).append(","); *************** *** 1042,1046 **** */ // Create BP Group ! int C_BP_Group_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_BP_Group"); sqlCmd = new StringBuffer ("INSERT INTO C_BP_Group "); sqlCmd.append("(C_BP_Group_ID,").append(m_stdColumns).append(","); --- 1040,1044 ---- */ // Create BP Group ! int C_BP_Group_ID = DB.getKeyNextNo(AD_Client_ID, "C_BP_Group"); sqlCmd = new StringBuffer ("INSERT INTO C_BP_Group "); sqlCmd.append("(C_BP_Group_ID,").append(m_stdColumns).append(","); *************** *** 1055,1059 **** // Create BPartner ! int C_BPartner_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "C_BPartner"); sqlCmd = new StringBuffer ("INSERT INTO C_BPartner "); sqlCmd.append("(C_BPartner_ID,").append(m_stdColumns).append(","); --- 1053,1057 ---- // Create BPartner ! int C_BPartner_ID = DB.getKeyNextNo(AD_Client_ID, "C_BPartner"); sqlCmd = new StringBuffer ("INSERT INTO C_BPartner "); sqlCmd.append("(C_BPartner_ID,").append(m_stdColumns).append(","); *************** *** 1080,1084 **** */ // Create Product Category ! int M_Product_Category_ID = DB.getKeyNextNo(AD_Client_ID, CompiereSys, "M_Product_Category"); sqlCmd = new StringBuffer ("INSERT INTO M_Product_Category "); sqlCmd.append("(M_Product_Category_ID,").append(m_stdColumns).append(","); --- 1078,1082 ---- */ // Create Product Category ! int M_Product_Category_ID = DB.getKeyNextNo(AD_Client... [truncated message content] |