diff --git a/migration/i2.1/oracle/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql b/migration/i2.1/oracle/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql new file mode 100644 index 0000000000..749e5d711f --- /dev/null +++ b/migration/i2.1/oracle/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql @@ -0,0 +1,31 @@ +update ad_document_action_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_document_action_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_document_action_access.ad_role_id) +; + +update ad_form_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_form_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_form_access.ad_role_id) +; + +update ad_infowindow_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_infowindow_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_infowindow_access.ad_role_id) +; + +update ad_process_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_process_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_process_access.ad_role_id) +; + +update ad_task_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_task_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_task_access.ad_role_id) +; + +update ad_window_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_window_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_window_access.ad_role_id) +; + +update ad_workflow_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_workflow_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_workflow_access.ad_role_id) +; + +SELECT register_migration_script('201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql') FROM dual +; + diff --git a/migration/i2.1/oracle/201507011955_IDEMPIERE-2635.sql b/migration/i2.1/oracle/201507011955_IDEMPIERE-2635.sql new file mode 100644 index 0000000000..ce240b68b2 --- /dev/null +++ b/migration/i2.1/oracle/201507011955_IDEMPIERE-2635.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- IDEMPIERE-2635 +-- Jul 1, 2015 7:54:49 PM COT +UPDATE AD_Column SET FieldLength=255, IsToolbarButton='N',Updated=TO_DATE('2015-07-01 19:54:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56745 +; + +-- Jul 1, 2015 7:54:52 PM COT +ALTER TABLE WS_WebService_Para MODIFY ConstantValue VARCHAR2(255) DEFAULT NULL +; + +SELECT register_migration_script('201507011955_IDEMPIERE-2635.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql b/migration/i2.1/postgresql/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql new file mode 100644 index 0000000000..749e5d711f --- /dev/null +++ b/migration/i2.1/postgresql/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql @@ -0,0 +1,31 @@ +update ad_document_action_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_document_action_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_document_action_access.ad_role_id) +; + +update ad_form_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_form_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_form_access.ad_role_id) +; + +update ad_infowindow_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_infowindow_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_infowindow_access.ad_role_id) +; + +update ad_process_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_process_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_process_access.ad_role_id) +; + +update ad_task_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_task_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_task_access.ad_role_id) +; + +update ad_window_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_window_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_window_access.ad_role_id) +; + +update ad_workflow_access set ad_client_id=(select ad_client_id from ad_role where ad_role.ad_role_id=ad_workflow_access.ad_role_id) +where ad_client_id<>(select ad_client_id from ad_role where ad_role.ad_role_id=ad_workflow_access.ad_role_id) +; + +SELECT register_migration_script('201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql') FROM dual +; + diff --git a/migration/i2.1/postgresql/201507011955_IDEMPIERE-2635.sql b/migration/i2.1/postgresql/201507011955_IDEMPIERE-2635.sql new file mode 100644 index 0000000000..c93e9005a0 --- /dev/null +++ b/migration/i2.1/postgresql/201507011955_IDEMPIERE-2635.sql @@ -0,0 +1,12 @@ +-- IDEMPIERE-2635 +-- Jul 1, 2015 7:54:49 PM COT +UPDATE AD_Column SET FieldLength=255, IsToolbarButton='N',Updated=TO_TIMESTAMP('2015-07-01 19:54:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=56745 +; + +-- Jul 1, 2015 7:54:52 PM COT +INSERT INTO t_alter_column values('ws_webservice_para','ConstantValue','VARCHAR(255)',null,'NULL') +; + +SELECT register_migration_script('201507011955_IDEMPIERE-2635.sql') FROM dual +; + diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java index 1a93a8c3d0..6a98f5c025 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoice.java @@ -234,8 +234,6 @@ public class CalloutInvoice extends CalloutEngine s = rs.getString("POReference"); if (s != null && s.length() != 0) mTab.setValue("POReference", s); - else - mTab.setValue("POReference", null); // SO Description s = rs.getString("SO_Description"); if (s != null && s.trim().length() != 0) diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java index 3def446db6..08414017be 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutInvoiceBatch.java @@ -387,6 +387,8 @@ public class CalloutInvoiceBatch extends CalloutEngine } } + if (TaxAmt == null) + TaxAmt = BigDecimal.ZERO; // if (IsTaxIncluded) { diff --git a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java index 7405e8f07f..76ac20f7e6 100644 --- a/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java +++ b/org.adempiere.base.callout/src/org/compiere/model/CalloutOrder.java @@ -373,11 +373,6 @@ public class CalloutOrder extends CalloutEngine String s = rs.getString("POReference"); if (s != null && s.length() != 0) mTab.setValue("POReference", s); - // should not be reset to null if we entered already value! VHARCQ, accepted YS makes sense that way - // TODO: should get checked and removed if no longer needed! - /*else - mTab.setValue("POReference", null);*/ - // SO Description s = rs.getString("SO_Description"); if (s != null && s.trim().length() != 0) @@ -570,8 +565,6 @@ public class CalloutOrder extends CalloutEngine String s = rs.getString("POReference"); if (s != null && s.length() != 0) mTab.setValue("POReference", s); - else - mTab.setValue("POReference", null); // SO Description s = rs.getString("SO_Description"); if (s != null && s.trim().length() != 0) diff --git a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java index f4b63d123c..28914418b4 100644 --- a/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java +++ b/org.adempiere.base.process/src/org/compiere/process/M_PriceList_Create.java @@ -685,54 +685,64 @@ public class M_PriceList_Create extends SvrProcess { sqlpc.append(" WHERE s.T_Selection_ID=p.M_Product_ID"); sqlpc.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID + ")"); - PreparedStatement ps = DB.prepareStatement(sqlpc.toString(), get_TrxName()); - ResultSet rs = ps.executeQuery(); - while(rs.next()) - { - int M_Product_ID = rs.getInt(MProductPrice.COLUMNNAME_M_Product_ID); - ProductCost m_productCost = new ProductCost (getCtx(), M_Product_ID, 0, get_TrxName()); - m_productCost.setQty(BigDecimal.ONE); - BigDecimal costs = m_productCost.getProductCosts(as, rsCurgen.getInt("AD_Org_ID"), null, 0, false); - - if (costs == null || costs.signum() == 0) // zero costs OK + PreparedStatement ps = null; + ResultSet rs = null; + + try{ + ps = DB.prepareStatement(sqlpc.toString(), get_TrxName()); + rs = ps.executeQuery(); + while(rs.next()) { - MProduct product = new MProduct(getCtx(), M_Product_ID, get_TrxName()); - if (product.isStocked()) - log.log(Level.WARNING, "No Costs for " + product.getName()); - } - else - { - sqlupd = new StringBuilder("UPDATE M_ProductPrice p "); - sqlupd.append(" SET PriceList = (DECODE('").append(rsDiscountLine.getString(MDiscountSchemaLine.COLUMNNAME_List_Base)).append("', 'P', ?, PriceList) + ?) * (1 - ?/100), "); - sqlupd.append(" PriceStd = (DECODE('").append(rsDiscountLine.getString(MDiscountSchemaLine.COLUMNNAME_Std_Base)).append("', 'P', ?, PriceStd) + ?) * (1 - ?/100),"); - sqlupd.append(" PriceLimit = (DECODE('").append(rsDiscountLine.getString(MDiscountSchemaLine.COLUMNNAME_Limit_Base)).append("', 'P', ?, PriceLimit) + ?) * (1 - ?/100)"); - sqlupd.append(" WHERE M_PriceList_Version_ID=").append(p_PriceList_Version_ID); - sqlupd.append(" AND M_Product_ID = ?"); - sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s"); - sqlupd.append(" WHERE s.T_Selection_ID=p.M_Product_ID"); - sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID + ")"); + int M_Product_ID = rs.getInt(MProductPrice.COLUMNNAME_M_Product_ID); + ProductCost m_productCost = new ProductCost (getCtx(), M_Product_ID, 0, get_TrxName()); + m_productCost.setQty(BigDecimal.ONE); + BigDecimal costs = m_productCost.getProductCosts(as, rsCurgen.getInt("AD_Org_ID"), null, 0, false); - pstmu = DB.prepareStatement(sqlupd.toString(), - ResultSet.TYPE_SCROLL_INSENSITIVE, - ResultSet.CONCUR_UPDATABLE, get_TrxName()); - - pstmu.setBigDecimal(1, costs); - pstmu.setDouble(2, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_List_AddAmt)); - pstmu.setDouble(3, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_List_Discount)); - pstmu.setBigDecimal(4, costs); - pstmu.setDouble(5, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Std_AddAmt)); - pstmu.setDouble(6, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Std_Discount)); - pstmu.setBigDecimal(7, costs); - pstmu.setDouble(8, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Limit_AddAmt)); - pstmu.setDouble(9, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Limit_Discount)); - pstmu.setInt(10, M_Product_ID); - - cntu = pstmu.executeUpdate(); - - if (cntu == -1) - raiseError("Update M_ProductPrice ", sqlupd.toString()); - if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); + if (costs == null || costs.signum() == 0) // zero costs OK + { + MProduct product = new MProduct(getCtx(), M_Product_ID, get_TrxName()); + if (product.isStocked()) + log.log(Level.WARNING, "No Costs for " + product.getName()); + } + else + { + sqlupd = new StringBuilder("UPDATE M_ProductPrice p "); + sqlupd.append(" SET PriceList = (DECODE('").append(rsDiscountLine.getString(MDiscountSchemaLine.COLUMNNAME_List_Base)).append("', 'P', ?, PriceList) + ?) * (1 - ?/100), "); + sqlupd.append(" PriceStd = (DECODE('").append(rsDiscountLine.getString(MDiscountSchemaLine.COLUMNNAME_Std_Base)).append("', 'P', ?, PriceStd) + ?) * (1 - ?/100),"); + sqlupd.append(" PriceLimit = (DECODE('").append(rsDiscountLine.getString(MDiscountSchemaLine.COLUMNNAME_Limit_Base)).append("', 'P', ?, PriceLimit) + ?) * (1 - ?/100)"); + sqlupd.append(" WHERE M_PriceList_Version_ID=").append(p_PriceList_Version_ID); + sqlupd.append(" AND M_Product_ID = ?"); + sqlupd.append(" AND EXISTS (SELECT * FROM T_Selection s"); + sqlupd.append(" WHERE s.T_Selection_ID=p.M_Product_ID"); + sqlupd.append(" AND s.AD_PInstance_ID=").append(m_AD_PInstance_ID + ")"); + + pstmu = DB.prepareStatement(sqlupd.toString(), + ResultSet.TYPE_SCROLL_INSENSITIVE, + ResultSet.CONCUR_UPDATABLE, get_TrxName()); + + pstmu.setBigDecimal(1, costs); + pstmu.setDouble(2, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_List_AddAmt)); + pstmu.setDouble(3, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_List_Discount)); + pstmu.setBigDecimal(4, costs); + pstmu.setDouble(5, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Std_AddAmt)); + pstmu.setDouble(6, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Std_Discount)); + pstmu.setBigDecimal(7, costs); + pstmu.setDouble(8, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Limit_AddAmt)); + pstmu.setDouble(9, rsDiscountLine.getDouble(MDiscountSchemaLine.COLUMNNAME_Limit_Discount)); + pstmu.setInt(10, M_Product_ID); + + cntu = pstmu.executeUpdate(); + + if (cntu == -1) + raiseError("Update M_ProductPrice ", sqlupd.toString()); + if (log.isLoggable(Level.FINE)) log.fine("Updated " + cntu); + } } + } catch (SQLException e) { + throw e; + } finally { + DB.close(rs, ps); + rs = null; ps = null; } } diff --git a/org.adempiere.base/src/org/compiere/model/MColumn.java b/org.adempiere.base/src/org/compiere/model/MColumn.java index ba2a38bc85..8e9338a3b5 100644 --- a/org.adempiere.base/src/org/compiere/model/MColumn.java +++ b/org.adempiere.base/src/org/compiere/model/MColumn.java @@ -48,7 +48,7 @@ public class MColumn extends X_AD_Column /** * */ - private static final long serialVersionUID = -4372212315789445915L; + private static final long serialVersionUID = -7470893214933465732L; /** * Get MColumn from Cache @@ -830,4 +830,10 @@ public class MColumn extends X_AD_Column } } + @Override + public I_AD_Table getAD_Table() throws RuntimeException { + MTable table = MTable.get(getCtx(), getAD_Table_ID()); + return table; + } + } // MColumn diff --git a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java index efea41e29e..b94fd6d418 100644 --- a/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java +++ b/org.adempiere.base/src/org/compiere/model/MInvoiceLine.java @@ -1016,13 +1016,13 @@ public class MInvoiceLine extends X_C_InvoiceLine { if (isProcessed()) return "Processed"; - MLandedCost[] lcs = MLandedCost.getLandedCosts(this); - if (lcs.length == 0) - return ""; StringBuilder sql = new StringBuilder("DELETE C_LandedCostAllocation WHERE C_InvoiceLine_ID=").append(getC_InvoiceLine_ID()); int no = DB.executeUpdate(sql.toString(), get_TrxName()); if (no != 0) if (log.isLoggable(Level.INFO)) log.info("Deleted #" + no); + MLandedCost[] lcs = MLandedCost.getLandedCosts(this); + if (lcs.length == 0) + return ""; int inserted = 0; // *** Single Criteria *** diff --git a/org.adempiere.base/src/org/compiere/model/MRefTable.java b/org.adempiere.base/src/org/compiere/model/MRefTable.java index 589f03ed04..17402dd25e 100644 --- a/org.adempiere.base/src/org/compiere/model/MRefTable.java +++ b/org.adempiere.base/src/org/compiere/model/MRefTable.java @@ -25,7 +25,7 @@ public class MRefTable extends X_AD_Ref_Table /** * */ - private static final long serialVersionUID = 9123965213307214868L; + private static final long serialVersionUID = 380648726485603193L; /** * Standard Constructor @@ -57,4 +57,10 @@ public class MRefTable extends X_AD_Ref_Table super (ctx, rs, trxName); } // MRefTable + @Override + public I_AD_Table getAD_Table() throws RuntimeException { + MTable table = MTable.get(getCtx(), getAD_Table_ID()); + return table; + } + } // MRefTable diff --git a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java index 7dfc99b2c4..7c202c5042 100644 --- a/org.adempiere.base/src/org/compiere/model/MUOMConversion.java +++ b/org.adempiere.base/src/org/compiere/model/MUOMConversion.java @@ -707,7 +707,8 @@ public class MUOMConversion extends X_C_UOM_Conversion if (getM_Product_ID() != 0 && (newRecord || is_ValueChanged("M_Product_ID"))) { - MProduct product = MProduct.get(getCtx(), getM_Product_ID()); + // Check of product must be in the same transaction as the conversion being saved + MProduct product = new MProduct(getCtx(), getM_Product_ID(), get_TrxName()); if (product.getC_UOM_ID() != getC_UOM_ID()) { MUOM uom = MUOM.get(getCtx(), product.getC_UOM_ID()); diff --git a/org.adempiere.base/src/org/compiere/model/MZoomCondition.java b/org.adempiere.base/src/org/compiere/model/MZoomCondition.java index 42e96a9dba..1867c04ebe 100644 --- a/org.adempiere.base/src/org/compiere/model/MZoomCondition.java +++ b/org.adempiere.base/src/org/compiere/model/MZoomCondition.java @@ -19,6 +19,7 @@ import java.sql.ResultSet; import java.util.List; import java.util.Properties; +import org.compiere.util.CCache; import org.compiere.util.DB; import org.compiere.util.Env; import org.compiere.util.Evaluatee; @@ -60,6 +61,9 @@ public class MZoomCondition extends X_AD_ZoomCondition super (ctx, rs, trxName); } // MZoomCondition + /** Cache of Table Conditions Array **/ + private static CCache s_conditions = new CCache(Table_Name, 0); + /** * Retrieve zoom condition record by AD_Table_ID * @param AD_Table_ID @@ -67,13 +71,18 @@ public class MZoomCondition extends X_AD_ZoomCondition */ public static MZoomCondition[] getConditions(int AD_Table_ID) { - final String whereClauseFinal = "AD_Table_ID=?"; - List list = new Query(Env.getCtx(), MZoomCondition.Table_Name, whereClauseFinal, null) - .setParameters(AD_Table_ID) - .setOnlyActiveRecords(true) - .setOrderBy(MZoomCondition.COLUMNNAME_SeqNo) - .list(); - return list.toArray(new MZoomCondition[list.size()]); + MZoomCondition[] conditions = s_conditions.get(AD_Table_ID); + if (conditions == null) { + final String whereClauseFinal = "AD_Table_ID=?"; + List list = new Query(Env.getCtx(), MZoomCondition.Table_Name, whereClauseFinal, null) + .setParameters(AD_Table_ID) + .setOnlyActiveRecords(true) + .setOrderBy(MZoomCondition.COLUMNNAME_SeqNo) + .list(); + conditions = list.toArray(new MZoomCondition[list.size()]); + s_conditions.put(AD_Table_ID, conditions); + } + return conditions; } // getConditions private static int findZoomWindowByTableId(int AD_Table_ID, MQuery query) diff --git a/org.adempiere.server-feature/utils.unix/myDBcopyTemplate.sh b/org.adempiere.server-feature/utils.unix/myDBcopyTemplate.sh index 359b2251c8..a048eb40c9 100644 --- a/org.adempiere.server-feature/utils.unix/myDBcopyTemplate.sh +++ b/org.adempiere.server-feature/utils.unix/myDBcopyTemplate.sh @@ -6,5 +6,3 @@ DATE=`date +%Y%m%d_%H%M%S` mv $IDEMPIERE_HOME/data/ExpDat.jar $IDEMPIERE_HOME/data/ExpDat$DATE.jar echo copy $IDEMPIERE_HOME/data/ExpDat$DATE.jar to backup media - -sleep 30 diff --git a/org.adempiere.server-feature/utils.windows/myDBcopyTemplate.bat b/org.adempiere.server-feature/utils.windows/myDBcopyTemplate.bat index 552d0ce3b4..2fc580ac17 100644 --- a/org.adempiere.server-feature/utils.windows/myDBcopyTemplate.bat +++ b/org.adempiere.server-feature/utils.windows/myDBcopyTemplate.bat @@ -18,6 +18,3 @@ ren ExpDat.jar "ExpDat%DATETIME%.jar" @dir ExpDat%DATETIME%.jar @Echo copy %IDEMPIERE_HOME%\data\ExpDat%DATETIME%.jar to backup media - -@Rem Sleep 30 -@CHOICE /C YN /T 30 /D N > NUL \ No newline at end of file diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 0e530a5075..44f622bd5a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -527,8 +527,6 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { setActiveTab(gridWindow.getTabIndex(gTab), null); gTab.navigate(i); - if (gc.isGridView()) - gc.switchRowPresentation(); return true; } } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java index cd733dfd6d..5c7e4c05ca 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/CompositeADTabbox.java @@ -890,8 +890,10 @@ public class CompositeADTabbox extends AbstractADTabbox if (!tabPanel.isVisible()) { tabPanel.setVisible(true); } + boolean wasForm = false; if (!tabPanel.isGridView()) { - tabPanel.switchRowPresentation(); + tabPanel.switchRowPresentation(); // required to avoid NPE on GridTabRowRenderer.getCurrentRow below + wasForm = true; } tabPanel.setDetailPaneMode(true); headerTab.getDetailPane().setVflex("true"); @@ -904,7 +906,9 @@ public class CompositeADTabbox extends AbstractADTabbox Row row = gtr.getCurrentRow(); if (row != null) gtr.setCurrentRow(row); - } + } + if (wasForm && tabPanel.getTabLevel() == 0 && headerTab.getTabLevel() != 0) // maintain form on header when zooming to a detail tab + tabPanel.switchRowPresentation(); } private void showLastError() { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFactReconcile.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFactReconcile.java index be06bff1ef..5f179cfd25 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFactReconcile.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WFactReconcile.java @@ -15,9 +15,7 @@ import org.adempiere.webui.component.ConfirmPanel; import org.adempiere.webui.component.Grid; import org.adempiere.webui.component.GridFactory; import org.adempiere.webui.component.Label; -import org.adempiere.webui.component.ListItem; import org.adempiere.webui.component.ListModelTable; -import org.adempiere.webui.component.Listbox; import org.adempiere.webui.component.ListboxFactory; import org.adempiere.webui.component.Panel; import org.adempiere.webui.component.Row; @@ -37,8 +35,10 @@ import org.adempiere.webui.panel.IFormController; import org.adempiere.webui.session.SessionManager; import org.compiere.apps.form.FactReconcile; import org.compiere.model.MClient; +import org.compiere.model.MColumn; import org.compiere.model.MLookup; import org.compiere.model.MLookupFactory; +import org.compiere.model.X_C_ElementValue; import org.compiere.util.CLogger; import org.compiere.util.DisplayType; import org.compiere.util.Env; @@ -94,7 +94,7 @@ implements IFormController, EventListener, WTableModelListener, ValueChan private Label labelReconciled = new Label(); private Checkbox isReconciled = new Checkbox(); private Label labelAccount = new Label(); - private Listbox fieldAccount = null; + private WTableDirEditor fieldAccount = null; private Label labelBPartner = new Label(); private WSearchEditor fieldBPartner = null; @@ -184,8 +184,8 @@ implements IFormController, EventListener, WTableModelListener, ValueChan row.appendCellChild(fieldOrg.getComponent(), 2); row = rows.newRow(); row.appendCellChild(labelAccount.rightAlign()); - fieldAccount.setHflex("true"); - row.appendCellChild(fieldAccount, 2); + fieldAccount.getComponent().setHflex("true"); + row.appendCellChild(fieldAccount.getComponent(), 2); row.appendCellChild(labelReconciled); row.appendCellChild(isReconciled, 2); row = rows.newRow(); @@ -252,6 +252,7 @@ implements IFormController, EventListener, WTableModelListener, ValueChan fieldAcctSchema = new WTableDirEditor("C_AcctSchema_ID", true, false, true, lookupAS); fieldAcctSchema.setValue(MClient.get(Env.getCtx()).getAcctSchema().getC_AcctSchema_ID()); fieldAcctSchema.addValueChangeListener(this); + m_C_AcctSchema_ID = (Integer)fieldAcctSchema.getValue(); // Organization AD_Column_ID = FactReconcile.col_AD_Org_ID; //C_Period.AD_Org_ID (needed to allow org 0) @@ -273,25 +274,25 @@ implements IFormController, EventListener, WTableModelListener, ValueChan fieldProduct = new WSearchEditor("M_Product_ID", false, false, true, lookupProduct); // Account - Vector vector = getAccount(); - KeyNamePair[] listAccount = new KeyNamePair[vector.size()]; - for(int i=0;i, WTableModelListener, ValueChan m_AD_Org_ID = (Integer)fieldOrg.getValue(); else m_AD_Org_ID = 0; - - if(fieldAcctSchema.getValue()!=null) - m_C_AcctSchema_ID = (Integer)fieldAcctSchema.getValue(); - else - m_C_AcctSchema_ID = 0; m_isReconciled = isReconciled.isChecked(); @@ -375,8 +371,19 @@ implements IFormController, EventListener, WTableModelListener, ValueChan @Override public void valueChange(ValueChangeEvent evt) { - // TODO Auto-generated method stub + String name = evt.getPropertyName(); + Object value = evt.getNewValue(); + if (log.isLoggable(Level.CONFIG)) log.config(name + "=" + value); + if (value == null) + return; + + if (name.equals("C_AcctSchema_ID")) { + m_C_AcctSchema_ID = ((Integer)value).intValue(); + Env.setContext(Env.getCtx(), form.getWindowNo(), "C_AcctSchema_ID", m_C_AcctSchema_ID); + Env.setContext(Env.getCtx(), form.getWindowNo(), "AD_Client_ID", Env.getAD_Client_ID(Env.getCtx())); + fieldAccount.actionRefresh(); + } } @Override diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaySelect.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaySelect.java index 7415a40989..40ffb26d4a 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaySelect.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPaySelect.java @@ -64,6 +64,7 @@ import org.compiere.util.Msg; import org.compiere.util.ValueNamePair; import org.zkoss.zk.ui.Executions; import org.zkoss.zk.ui.SuspendNotAllowedException; +import org.zkoss.zk.ui.WrongValueException; import org.zkoss.zk.ui.event.Event; import org.zkoss.zk.ui.event.EventListener; import org.zkoss.zk.ui.util.Clients; @@ -174,7 +175,9 @@ public class WPaySelect extends PaySelect dataStatus.setPre(true); onlyDue.addActionListener(this); fieldPayDate.addValueChangeListener(this); - // + + //IDEMPIERE-2657, pritesh shah + bGenerate.setEnabled(false); bGenerate.addActionListener(this); bCancel.addActionListener(this); // @@ -289,6 +292,11 @@ public class WPaySelect extends PaySelect private void loadTableInfo() { Timestamp payDate = (Timestamp)fieldPayDate.getValue(); + + //IDEMPIERE-2657, pritesh shah + if(payDate == null){ + throw new WrongValueException(fieldPayDate.getComponent(), Msg.getMsg(Env.getCtx(), "FillMandatory") + labelPayDate.getValue()); + } miniTable.setColorCompare(payDate); if (log.isLoggable(Level.CONFIG)) log.config("PayDate=" + payDate); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WGraph.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WGraph.java index ebd6be8b76..3cf72dc072 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WGraph.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/graph/WGraph.java @@ -195,6 +195,7 @@ public class WGraph extends Div implements IdSpace { if (m_renderTable) { if (m_renderChart) { East east = new East(); + east.setAutoscroll(true); layout.appendChild(east); renderTable(east); } else { diff --git a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java index a07b3f11ee..05b68014b2 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java @@ -260,8 +260,9 @@ public class FactReconcile { "SELECT ev.C_ElementValue_ID, ev.Value || ' ' || ev.Name FROM C_ElementValue ev", "ev", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO) + "AND ev.IsActive='Y' AND ev.IsSummary='N' " - + "AND ev.C_Element_ID IN (SELECT C_Element_ID FROM C_AcctSchema_Element ase " - + "WHERE ase.ElementType='AC' AND ase.AD_Client_ID=" + m_AD_Client_ID + ") " + + "AND EXISTS (SELECT 1 FROM C_AcctSchema_Element ase " + + "WHERE ase.C_Element_ID=ev.C_Element_ID AND ase.ElementType='AC' " + + "AND ase.C_AcctSchema_ID=" + m_C_AcctSchema_ID + " AND ase.AD_Client_ID=" + m_AD_Client_ID + ") " + "ORDER BY 2"; PreparedStatement pstmt = null; diff --git a/org.idempiere.eclipse.platform-feature/director.bat b/org.idempiere.eclipse.platform-feature/director.bat index bd9b3b5228..429018428b 100644 --- a/org.idempiere.eclipse.platform-feature/director.bat +++ b/org.idempiere.eclipse.platform-feature/director.bat @@ -1,4 +1,5 @@ @Title ... p2 director @Echo off -java -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true %1 +FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c +java -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true %1 diff --git a/org.idempiere.eclipse.platform-feature/update.bat b/org.idempiere.eclipse.platform-feature/update.bat index d4c933b160..02f526b354 100644 --- a/org.idempiere.eclipse.platform-feature/update.bat +++ b/org.idempiere.eclipse.platform-feature/update.bat @@ -3,7 +3,7 @@ cd %~dp0 -cp idempiere.ini idempiere.ini.sav +copy idempiere.ini idempiere.ini.sav if exist jetty.xml.sav del /q jetty.xml.sav if exist jettyhome/etc/jetty.xml ( @@ -20,9 +20,10 @@ if exist jettyhome/etc/jetty-selector.xml ( copy jettyhome/etc/jetty-selector.xml jetty-selector.xml.sav ) -java -jar plugins/org.eclipse.equinox.launcher_1.*.jar -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u org.adempiere.server.product -i org.adempiere.server.product +FOR %%c in (plugins\org.eclipse.equinox.launcher_1.*.jar) DO set JARFILE=%%c +java -jar %JARFILE% -install director -configuration director/configuration -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination $DESTINATION -repository $1 -u org.adempiere.server.product -i org.adempiere.server.product -cp idempiere.ini.sav idempiere.ini +copy idempiere.ini.sav idempiere.ini if exist jetty.xml.sav ( copy jetty.xml.sav jettyhome/etc/jetty.xml diff --git a/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/Service.java b/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/Service.java index 7aaeb5ef5e..64926f3b41 100644 --- a/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/Service.java +++ b/org.idempiere.fitnesse.fixture/src/org/idempiere/fitnesse/fixture/Service.java @@ -232,7 +232,7 @@ public class Service { // Get Login Info String loginInfo = null; // Verify existance of User/Client/Org/Role and User's acces to Client & Org - String sql = "SELECT u.Name || '@' || c.Name || '.' || o.Name || ' [' || INITCAP(USER) || ']' AS Text " + String sql = "SELECT u.Name || '@' || c.Name || '.' || o.Name AS Text " + "FROM AD_User u, AD_Client c, AD_Org o, AD_User_Roles ur " + "WHERE u.AD_User_ID=?" // #1 + " AND c.AD_Client_ID=?" // #2 diff --git a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereService.java b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereService.java index 30ad3ddd95..bd2852b1c6 100644 --- a/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereService.java +++ b/org.idempiere.webservices/WEB-INF/src/org/idempiere/adinterface/CompiereService.java @@ -178,8 +178,8 @@ public class CompiereService { { // Get Login Info String loginInfo = null; - // Verify existance of User/Client/Org/Role and User's acces to Client & Org - String sql = "SELECT u.Name || '@' || c.Name || '.' || o.Name || ' [' || INITCAP(USER) || ']' AS Text " + // Verify existence of User/Client/Org/Role and User's acces to Client & Org + String sql = "SELECT u.Name || '@' || c.Name || '.' || o.Name AS Text " + "FROM AD_User u, AD_Client c, AD_Org o, AD_User_Roles ur " + "WHERE u.AD_User_ID=?" // #1 + " AND c.AD_Client_ID=?" // #2