From 2998c976acb95035bea2687f69e874d0ab31577b Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 25 Jun 2015 14:50:22 -0500 Subject: [PATCH 01/20] IDEMPIERE-2698 Performance: Report checking for zoom condition on database - must be cached --- .../org/compiere/model/MZoomCondition.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) 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) From 35f0b830a05ea221a070e25347415e38548db6c4 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 25 Jun 2015 21:11:15 -0500 Subject: [PATCH 02/20] IDEMPIERE-2699 Performance: Constant visits to database for MTable not cached --- org.adempiere.base/src/org/compiere/model/MColumn.java | 8 +++++++- org.adempiere.base/src/org/compiere/model/MRefTable.java | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) 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/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 From 2183eb44efedde5bf38671b45c747223d960ce8a Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 26 Jun 2015 09:24:27 -0500 Subject: [PATCH 03/20] IDEMPIERE-2700 Zoom to detail is not honoring the configuration of tab grid/form --- .../adempiere/webui/adwindow/AbstractADWindowContent.java | 2 -- .../org/adempiere/webui/adwindow/CompositeADTabbox.java | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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 25198d1235..52e2c75d2e 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() { From 7f753cdedbc601c61fe0d29c20644443bc01584d Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 29 Jun 2015 11:52:56 -0500 Subject: [PATCH 04/20] IDEMPIERE-2664 DB Extensibility issues / remove unnecessary dependency to initcap and user functions --- .../src/org/idempiere/fitnesse/fixture/Service.java | 2 +- .../src/org/idempiere/adinterface/CompiereService.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 From c1149d3fe1b0b9692861038dae20133a8242f096 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 30 Jun 2015 11:15:54 -0500 Subject: [PATCH 05/20] fix wrong cp command on windows bat file --- org.idempiere.eclipse.platform-feature/update.bat | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/org.idempiere.eclipse.platform-feature/update.bat b/org.idempiere.eclipse.platform-feature/update.bat index 501fd8e2d5..ba9c73fb16 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 server.xml.sav del /q server.xml.sav if exist plugins/org.adempiere.tomcat.config_1.0.0/META-INF/tomcat/server.xml ( copy plugins/org.adempiere.tomcat.config_1.0.0/META-INF/tomcat/server.xml server.xml.sav @@ -21,7 +21,7 @@ java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.ins java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %~dp0 -repository %1 -i org.adempiere.server.product -cp idempiere.ini.sav idempiere.ini +copy idempiere.ini.sav idempiere.ini if exist server.xml.sav ( copy server.xml.sav plugins/org.adempiere.tomcat.config_2.1.0/META-INF/tomcat/server.xml del /q server.xml.sav From ef854ac82cba9b01d33176d843ecb2e022c89a88 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 09:36:31 -0500 Subject: [PATCH 06/20] IDEMPIERE-2672 fix wrong access records on seed --- ...3_IDEMPIERE-2672_fixWrongAccessRecords.sql | 31 +++++++++++++++++++ ...3_IDEMPIERE-2672_fixWrongAccessRecords.sql | 31 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 migration/i2.1/oracle/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql create mode 100644 migration/i2.1/postgresql/201507010933_IDEMPIERE-2672_fixWrongAccessRecords.sql 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/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 +; + From 392c96708b6bbfce0baf66232384c762af0cd022 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 10:02:03 -0500 Subject: [PATCH 07/20] IDEMPIERE-2657 Null Pointer Exception in Payment Selection (Manual) / integrate patch from Pritesh Shah --- .../src/org/adempiere/webui/apps/form/WPaySelect.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 6039c5609e..f55105e170 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); From 0c53a1b330bfe9a3e5e8414eae0cbe828f0f6dfb Mon Sep 17 00:00:00 2001 From: dantam Date: Wed, 1 Jul 2015 14:19:57 -0500 Subject: [PATCH 08/20] IDEMPIERE-1339 Add transaction when checking Product UOM in MUOMConversion --- org.adempiere.base/src/org/compiere/model/MUOMConversion.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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()); From 8b21270c23542d2702c1495e8b446a9468205809 Mon Sep 17 00:00:00 2001 From: Alan Lescano Date: Wed, 1 Jul 2015 16:40:29 -0500 Subject: [PATCH 09/20] IDEMPIERE-2688 Add scrollbar to WGraph data table --- .../WEB-INF/src/org/adempiere/webui/apps/graph/WGraph.java | 1 + 1 file changed, 1 insertion(+) 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 { From 682332d8325f80131565fca913a6f1ddd70e5d3e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 18:59:04 -0500 Subject: [PATCH 10/20] IDEMPIERE-2674 Error while executing Database Export task (session freeze) / thanks to Arthur Oliveira de Melo --- org.adempiere.server-feature/utils.unix/myDBcopyTemplate.sh | 2 -- .../utils.windows/myDBcopyTemplate.bat | 3 --- 2 files changed, 5 deletions(-) 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 From 1ca7631d7846227fe5918e91b8869a5319c86c4e Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Mon, 8 Jun 2015 09:27:47 +0200 Subject: [PATCH 11/20] IDEMPIERE-2665 Accounting Fact Reconcilation (Manual) schema validation missing --- .../webui/apps/form/WFactReconcile.java | 37 +++++++++++++------ .../org/compiere/apps/form/FactReconcile.java | 5 ++- 2 files changed, 28 insertions(+), 14 deletions(-) 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..53ac423184 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 @@ -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 Listbox fieldAccount = new Listbox(); private Label labelBPartner = new Label(); private WSearchEditor fieldBPartner = null; @@ -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,17 +274,25 @@ implements IFormController, EventListener, WTableModelListener, ValueChan fieldProduct = new WSearchEditor("M_Product_ID", false, false, true, lookupProduct); // Account + loadAccounts(); + } + + private void loadAccounts(){ + fieldAccount.removeAllItems(); 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 +379,17 @@ 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(); + loadAccounts(); + } } @Override 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; From ffc0e623f9e458061a157ff90a9105b76c8b10a5 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Mon, 8 Jun 2015 09:49:52 +0200 Subject: [PATCH 12/20] IDEMPIERE-2665 ListBox component changed to Table Dir --- .../webui/apps/form/WFactReconcile.java | 40 ++++++++----------- .../org/compiere/apps/form/FactReconcile.java | 37 ----------------- 2 files changed, 16 insertions(+), 61 deletions(-) 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 53ac423184..cf93adf9f4 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 = new Listbox(); + 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(); @@ -274,16 +274,14 @@ implements IFormController, EventListener, WTableModelListener, ValueChan fieldProduct = new WSearchEditor("M_Product_ID", false, false, true, lookupProduct); // Account - loadAccounts(); - } - - private void loadAccounts(){ - fieldAccount.removeAllItems(); - Vector vector = getAccount(); - for(int i=0;i, WTableModelListener, ValueChan else m_C_AcctSchema_ID = 0; - ListItem listAccount = fieldAccount.getSelectedItem(); - int Account_ID = 0; - if(listAccount!=null){ - Account_ID = (Integer)listAccount.getValue(); - } - - if (Account_ID != 0) - m_Account_ID = Account_ID; + if(fieldAccount.getValue()!=null) + m_Account_ID = (Integer)fieldAccount.getValue(); else m_Account_ID = 0; @@ -388,7 +380,7 @@ implements IFormController, EventListener, WTableModelListener, ValueChan if (name.equals("C_AcctSchema_ID")) { m_C_AcctSchema_ID = ((Integer)value).intValue(); - loadAccounts(); + fieldAccount.actionRefresh(); } } 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 05b68014b2..d99e8cf47f 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java @@ -253,41 +253,4 @@ public class FactReconcile { rec.setMatchCode(null); return rec.save(); } - - protected Vector getAccount(){ - Vector vector = new Vector(); - String sql = MRole.getDefault().addAccessSQL( - "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 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; - ResultSet rs = null; - try - { - pstmt = DB.prepareStatement(sql, null); - rs = pstmt.executeQuery(); - while (rs.next()) - { - vector.add(new KeyNamePair(rs.getInt(1), rs.getString(2))); - } - } - catch (SQLException e) - { - log.log(Level.SEVERE, sql, e); - } - finally - { - DB.close(rs, pstmt); - rs = null; - pstmt = null; - } - - return vector; - } - } From 7b10395b3b9dcf1e2e6345cb92eee4aee1963ca7 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Mon, 8 Jun 2015 15:10:37 +0200 Subject: [PATCH 13/20] IDEMPIERE-2665 Accounting Fact Reconcilation (Manual) schema validation missing --- .../org/compiere/apps/form/FactReconcile.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) 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 d99e8cf47f..05b68014b2 100644 --- a/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java +++ b/org.adempiere.ui/src/org/compiere/apps/form/FactReconcile.java @@ -253,4 +253,41 @@ public class FactReconcile { rec.setMatchCode(null); return rec.save(); } + + protected Vector getAccount(){ + Vector vector = new Vector(); + String sql = MRole.getDefault().addAccessSQL( + "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 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; + ResultSet rs = null; + try + { + pstmt = DB.prepareStatement(sql, null); + rs = pstmt.executeQuery(); + while (rs.next()) + { + vector.add(new KeyNamePair(rs.getInt(1), rs.getString(2))); + } + } + catch (SQLException e) + { + log.log(Level.SEVERE, sql, e); + } + finally + { + DB.close(rs, pstmt); + rs = null; + pstmt = null; + } + + return vector; + } + } From 6c840d11ad48b8366261bd2d91a6a653700b4d32 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 19:45:04 -0500 Subject: [PATCH 14/20] IDEMPIERE-2665 / peer review --- .../src/org/adempiere/webui/apps/form/WFactReconcile.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 cf93adf9f4..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 @@ -280,7 +280,7 @@ implements IFormController, EventListener, WTableModelListener, ValueChan " C_ElementValue.IsActive='Y' AND C_ElementValue.IsSummary='N' " + "AND EXISTS (SELECT 1 FROM C_AcctSchema_Element ase " + "WHERE ase.C_Element_ID=C_ElementValue.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 + ") "); + + "AND ase.C_AcctSchema_ID=@C_AcctSchema_ID@ AND ase.AD_Client_ID=@AD_Client_ID@) "); fieldAccount = new WTableDirEditor("C_ElementValue_ID", false, false, true, lookupAccount); } @@ -380,6 +380,8 @@ implements IFormController, EventListener, WTableModelListener, ValueChan 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(); } } From 821c8c3f5e89aff7347c3ba8ce848c0f13f9376c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 19:55:43 -0500 Subject: [PATCH 15/20] IDEMPIERE-2635 Increase length of Constant Value on Web service Security->Web Service parameter --- .../i2.1/oracle/201507011955_IDEMPIERE-2635.sql | 15 +++++++++++++++ .../postgresql/201507011955_IDEMPIERE-2635.sql | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migration/i2.1/oracle/201507011955_IDEMPIERE-2635.sql create mode 100644 migration/i2.1/postgresql/201507011955_IDEMPIERE-2635.sql 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/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 +; + From 27588c780117a0424b2c066bf2c7b3307552a8e4 Mon Sep 17 00:00:00 2001 From: tsvikruha Date: Wed, 1 Jul 2015 19:59:37 -0500 Subject: [PATCH 16/20] IDEMPIERE-2649 Not properly closed ResultSet in M_PriceList_Create --- .../compiere/process/M_PriceList_Create.java | 100 ++++++++++-------- 1 file changed, 55 insertions(+), 45 deletions(-) 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; } } From 5b994458aeb21c7708ec80953d96ee0e441dabbf Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 20:13:33 -0500 Subject: [PATCH 17/20] IDEMPIERE-2627 After selecting the Business Partner on an Invoice, the order ref. is blanked out / thanks to Neil Gordon --- .../src/org/compiere/model/CalloutInvoice.java | 2 -- .../src/org/compiere/model/CalloutOrder.java | 7 ------- 2 files changed, 9 deletions(-) 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/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) From cf30ef358104ce7927af803c076a8135b6cbb092 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 20:22:31 -0500 Subject: [PATCH 18/20] IDEMPIERE-2541 Landed Cost Allocation does not honour delete/void / thanks to Armen Rizal --- org.adempiere.base/src/org/compiere/model/MInvoiceLine.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 *** From 921064745dfdcc466e59329106dd6b21e713bc8e Mon Sep 17 00:00:00 2001 From: hieplq Date: Fri, 9 Jan 2015 11:15:25 +0700 Subject: [PATCH 19/20] IDEMPIERE-2391:none tax make callout CalloutInvoiceBatch rise NPE when calculator --- .../src/org/compiere/model/CalloutInvoiceBatch.java | 2 ++ 1 file changed, 2 insertions(+) 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) { From 19f03bf7469e1f7b26674f212c8c78cf8b53f78e Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 1 Jul 2015 21:00:34 -0500 Subject: [PATCH 20/20] IDEMPIERE-2662 Windows idempiere-server.bat broken --- org.idempiere.eclipse.platform-feature/director.bat | 3 ++- org.idempiere.eclipse.platform-feature/update.bat | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/org.idempiere.eclipse.platform-feature/director.bat b/org.idempiere.eclipse.platform-feature/director.bat index 48609805fa..2614a1edec 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 -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true %1 +FOR %%c in (plugins\org.eclipse.osgi_3.7.*.jar) DO set JARFILE=%%c +java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar %JARFILE% -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 ba9c73fb16..c6ac023db0 100644 --- a/org.idempiere.eclipse.platform-feature/update.bat +++ b/org.idempiere.eclipse.platform-feature/update.bat @@ -17,9 +17,10 @@ if exist plugins/org.adempiere.tomcat.config_2.1.0/META-INF/tomcat/server.xml ( copy plugins/org.adempiere.tomcat.config_2.1.0/META-INF/tomcat/server.xml server.xml.sav ) -java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %~dp0 -repository %1 -u org.adempiere.server.product +FOR %%c in (plugins\org.eclipse.osgi_3.7.*.jar) DO set JARFILE=%%c +java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar %JARFILE% -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %~dp0 -repository %1 -u org.adempiere.server.product -java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar plugins/org.eclipse.osgi_3.7.*.jar -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %~dp0 -repository %1 -i org.adempiere.server.product +java -Dosgi.noShutdown=false -Dosgi.compatibility.bootdelegation=true -Dosgi.install.area=director -jar %JARFILE% -application org.eclipse.equinox.p2.director -consoleLog -profileProperties org.eclipse.update.install.features=true -destination %~dp0 -repository %1 -i org.adempiere.server.product copy idempiere.ini.sav idempiere.ini if exist server.xml.sav (