From 6937c2dbdbad7dbf5922b424abc47664c38b083c Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 18 Nov 2013 10:35:51 +0800 Subject: [PATCH 1/4] 1003475 IDEMPIERE-1530 Allow Material Receipt Line with Quantity Receipt more then Purchase Order Line's Quantity Ordered. Fixed NPE when create MR line without order line. --- .../src/org/compiere/model/MInOut.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MInOut.java b/org.adempiere.base/src/org/compiere/model/MInOut.java index d68b400cdc..fa9c414073 100644 --- a/org.adempiere.base/src/org/compiere/model/MInOut.java +++ b/org.adempiere.base/src/org/compiere/model/MInOut.java @@ -1340,13 +1340,16 @@ public class MInOut extends X_M_InOut implements DocAction { if (!isReversal()) { - BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered()); - if (sLine.getMovementQty().compareTo(toDelivered) > 0) - overReceipt = sLine.getMovementQty().subtract(toDelivered); - if (overReceipt.signum() != 0) + if (oLine != null) { - sLine.setQtyOverReceipt(overReceipt); - sLine.saveEx(); + BigDecimal toDelivered = oLine.getQtyOrdered().subtract(oLine.getQtyDelivered()); + if (sLine.getMovementQty().compareTo(toDelivered) > 0) + overReceipt = sLine.getMovementQty().subtract(toDelivered); + if (overReceipt.signum() != 0) + { + sLine.setQtyOverReceipt(overReceipt); + sLine.saveEx(); + } } } else From 4623148e1e6fdb10e0ff58cfb85cd380775c74b9 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Mon, 18 Nov 2013 10:44:08 +0800 Subject: [PATCH 2/4] 1003491 System logs filled with zkoss error for several hours. Fixed NPE when native session have been destroyed. --- .../webui/session/SessionContextListener.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java index 68c0a7275e..a733c4d078 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/session/SessionContextListener.java @@ -65,6 +65,19 @@ public class SessionContextListener implements ExecutionInit, Session session = exec.getDesktop().getSession(); Properties ctx = (Properties)session.getAttribute(SESSION_CTX); HttpSession httpSession = (HttpSession)session.getNativeSession(); + //create empty context if there's no valid native session + if (httpSession == null) + { + ctx = new Properties(); + ctx.put(ServerContextURLHandler.SERVER_CONTEXT_URL_HANDLER, new ServerContextURLHandler() { + public void showURL(String url) { + SessionManager.getAppDesktop().showURL(url, true); + } + }); + ServerContext.setCurrentInstance(ctx); + return; + } + if (ctx != null) { //verify ctx @@ -283,7 +296,7 @@ public class SessionContextListener implements ExecutionInit, HttpSession httpSession = (HttpSession)session.getNativeSession(); //verify ctx String cacheId = ctx.getProperty(SERVLET_SESSION_ID); - if (cacheId == null || !cacheId.equals(httpSession.getId()) ) + if (cacheId == null || httpSession == null || !cacheId.equals(httpSession.getId()) ) { return false; } From e1f90dc2c955b617169a395400f96572e115b350 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 16 Nov 2013 09:57:54 -0500 Subject: [PATCH 3/4] IDEMPIERE-1514 field sales transaction in cash plan window is horizontal-deflecting / register_migration_script --- migration/i2.0/oracle/201311071604_IDEMPIERE-1514.sql | 3 +++ migration/i2.0/postgresql/201311071604_IDEMPIERE-1514.sql | 3 +++ 2 files changed, 6 insertions(+) diff --git a/migration/i2.0/oracle/201311071604_IDEMPIERE-1514.sql b/migration/i2.0/oracle/201311071604_IDEMPIERE-1514.sql index 84bc6bdc84..a360fa76e0 100644 --- a/migration/i2.0/oracle/201311071604_IDEMPIERE-1514.sql +++ b/migration/i2.0/oracle/201311071604_IDEMPIERE-1514.sql @@ -5,3 +5,6 @@ SET DEFINE OFF UPDATE AD_Field SET SeqNo=70, IsDisplayed='Y', XPosition=1,Updated=TO_DATE('2013-11-07 21:30:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=60934 ; +SELECT register_migration_script('201311071604_IDEMPIERE-1514.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201311071604_IDEMPIERE-1514.sql b/migration/i2.0/postgresql/201311071604_IDEMPIERE-1514.sql index f13a6d2e85..6e2a0ad1ad 100644 --- a/migration/i2.0/postgresql/201311071604_IDEMPIERE-1514.sql +++ b/migration/i2.0/postgresql/201311071604_IDEMPIERE-1514.sql @@ -2,3 +2,6 @@ UPDATE AD_Field SET SeqNo=70, IsDisplayed='Y', XPosition=1,Updated=TO_TIMESTAMP('2013-11-07 21:30:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=60934 ; +SELECT register_migration_script('201311071604_IDEMPIERE-1514.sql') FROM dual +; + From bec5e24fb4a84602d57ea0c8ee94c95ce7570c83 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 18 Nov 2013 08:52:52 -0500 Subject: [PATCH 4/4] IDEMPIERE-1498 The values true and false are not translated in reports / based on patch from Flemming Birch --- .../src/org/compiere/print/PrintDataElement.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java index f58d77b4b8..bbbc78d75c 100644 --- a/org.adempiere.base/src/org/compiere/print/PrintDataElement.java +++ b/org.adempiere.base/src/org/compiere/print/PrintDataElement.java @@ -25,6 +25,7 @@ import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.KeyNamePair; import org.compiere.util.Language; +import org.compiere.util.Msg; import org.compiere.util.NamePair; /** @@ -191,9 +192,15 @@ public class PrintDataElement implements Serializable { if (DisplayType.isNumeric(m_displayType)) { retValue = DisplayType.getNumberFormat(m_displayType, language, m_formatPattern).format(m_value); - } - else if (DisplayType.isDate(m_displayType)) + } else if (DisplayType.isDate(m_displayType)) { retValue = DisplayType.getDateFormat(m_displayType, language, m_formatPattern).format(m_value); + } else if (m_value instanceof Boolean) { + if (m_value.toString().equals("true")) { + retValue = Msg.getMsg(Env.getCtx(), "Yes"); + } else if (m_value.toString().equals("false")) { + retValue = Msg.getMsg(Env.getCtx(), "No"); + } + } } return retValue; } // getValueDisplay