From 04a954d5463ee538eaf7d36336f6c67f1c40c881 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 30 Mar 2014 18:52:03 -0500 Subject: [PATCH 01/13] IDEMPIERE-1864 Allow negative tax rate --- migration/i2.0/oracle/201403301851_IDEMPIERE-1864.sql | 11 +++++++++++ .../i2.0/postgresql/201403301851_IDEMPIERE-1864.sql | 8 ++++++++ 2 files changed, 19 insertions(+) create mode 100644 migration/i2.0/oracle/201403301851_IDEMPIERE-1864.sql create mode 100644 migration/i2.0/postgresql/201403301851_IDEMPIERE-1864.sql diff --git a/migration/i2.0/oracle/201403301851_IDEMPIERE-1864.sql b/migration/i2.0/oracle/201403301851_IDEMPIERE-1864.sql new file mode 100644 index 0000000000..e0098e10ca --- /dev/null +++ b/migration/i2.0/oracle/201403301851_IDEMPIERE-1864.sql @@ -0,0 +1,11 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Mar 30, 2014 6:50:49 PM COT +-- IDEMPIERE-1864 Allow negative tax rate +UPDATE AD_Column SET ValueMin=NULL,Updated=TO_DATE('2014-03-30 18:50:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3693 +; + +SELECT register_migration_script('201403301851_IDEMPIERE-1864.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201403301851_IDEMPIERE-1864.sql b/migration/i2.0/postgresql/201403301851_IDEMPIERE-1864.sql new file mode 100644 index 0000000000..549b00b1ae --- /dev/null +++ b/migration/i2.0/postgresql/201403301851_IDEMPIERE-1864.sql @@ -0,0 +1,8 @@ +-- Mar 30, 2014 6:50:49 PM COT +-- IDEMPIERE-1864 Allow negative tax rate +UPDATE AD_Column SET ValueMin=NULL,Updated=TO_TIMESTAMP('2014-03-30 18:50:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=3693 +; + +SELECT register_migration_script('201403301851_IDEMPIERE-1864.sql') FROM dual +; + From 04cde27d354e4f4010d63e4995beb06d48cc51e6 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sun, 30 Mar 2014 20:01:06 -0500 Subject: [PATCH 02/13] minor to allow overriding methods from core callouts --- org.adempiere.base.callout/META-INF/MANIFEST.MF | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.base.callout/META-INF/MANIFEST.MF b/org.adempiere.base.callout/META-INF/MANIFEST.MF index 3de551ad7b..9f2744691c 100644 --- a/org.adempiere.base.callout/META-INF/MANIFEST.MF +++ b/org.adempiere.base.callout/META-INF/MANIFEST.MF @@ -8,4 +8,5 @@ Require-Bundle: org.adempiere.base;bundle-version="2.0.0" Eclipse-RegisterBuddy: org.adempiere.base Service-Component: OSGI-INF/costadjustmentcalloutfactory.xml Bundle-ActivationPolicy: lazy +Export-Package: org.compiere.model From 90453b1ab4ad2a0f5ab2d426dda09ac4e52b381c Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 08:24:51 -0500 Subject: [PATCH 03/13] IDEMPIERE-1834 --- .../i2.0/oracle/201404020823_IDEMPIERE-1834.sql | 14 ++++++++++++++ .../postgresql/201404020823_IDEMPIERE-1834.sql | 11 +++++++++++ 2 files changed, 25 insertions(+) create mode 100644 migration/i2.0/oracle/201404020823_IDEMPIERE-1834.sql create mode 100644 migration/i2.0/postgresql/201404020823_IDEMPIERE-1834.sql diff --git a/migration/i2.0/oracle/201404020823_IDEMPIERE-1834.sql b/migration/i2.0/oracle/201404020823_IDEMPIERE-1834.sql new file mode 100644 index 0000000000..bbaa405810 --- /dev/null +++ b/migration/i2.0/oracle/201404020823_IDEMPIERE-1834.sql @@ -0,0 +1,14 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Apr 2, 2014 8:22:49 AM COT +-- IDEMPIERE-1834 +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10900 +; + +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53438 +; + +SELECT register_migration_script('201404020823_IDEMPIERE-1834.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201404020823_IDEMPIERE-1834.sql b/migration/i2.0/postgresql/201404020823_IDEMPIERE-1834.sql new file mode 100644 index 0000000000..613d56ce56 --- /dev/null +++ b/migration/i2.0/postgresql/201404020823_IDEMPIERE-1834.sql @@ -0,0 +1,11 @@ +-- Apr 2, 2014 8:22:49 AM COT +-- IDEMPIERE-1834 +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=10900 +; + +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-04-02 08:22:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=53438 +; + +SELECT register_migration_script('201404020823_IDEMPIERE-1834.sql') FROM dual +; + From 4f44c80e254b802ace533ea540ba84c759a52104 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 09:27:18 -0500 Subject: [PATCH 04/13] IDEMPIERE-1410 Non-advanced users can assign themselves advanced roles --- .../src/org/compiere/model/MUserRoles.java | 38 ++++++++++++++++++- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MUserRoles.java b/org.adempiere.base/src/org/compiere/model/MUserRoles.java index 3120cd2978..be673ee89e 100644 --- a/org.adempiere.base/src/org/compiere/model/MUserRoles.java +++ b/org.adempiere.base/src/org/compiere/model/MUserRoles.java @@ -21,6 +21,7 @@ import java.util.List; import java.util.Properties; import org.compiere.util.CLogger; +import org.compiere.util.Msg; /** * User Roles Model @@ -33,8 +34,7 @@ public class MUserRoles extends X_AD_User_Roles /** * */ - private static final long serialVersionUID = -2659323298844769713L; - + private static final long serialVersionUID = 5850010835736994376L; /** * Get User Roles Of Role @@ -133,4 +133,38 @@ public class MUserRoles extends X_AD_User_Roles set_ValueNoCheck ("AD_Role_ID", new Integer(AD_Role_ID)); } // setAD_Role_ID + @Override + protected boolean beforeSave(boolean newRecord) { + // IDEMPIERE-1410 + if (! MRole.getDefault().isAccessAdvanced()) { + MRole role = new MRole(getCtx(), getAD_Role_ID(), get_TrxName()); + if (role.isAccessAdvanced()) { + log.saveError("Error", Msg.getMsg(getCtx(), "ActionNotAllowedHere")); + return false; + } + if (! newRecord && is_ValueChanged(COLUMNNAME_AD_Role_ID)) { + MRole oldrole = new MRole(getCtx(), get_ValueOldAsInt(COLUMNNAME_AD_Role_ID), get_TrxName()); + if (oldrole.isAccessAdvanced()) { + log.saveError("Error", Msg.getMsg(getCtx(), "ActionNotAllowedHere")); + return false; + } + } + } + + return true; + } + + @Override + protected boolean beforeDelete() { + // IDEMPIERE-1410 + if (! MRole.getDefault().isAccessAdvanced()) { + MRole role = new MRole(getCtx(), getAD_Role_ID(), get_TrxName()); + if (role.isAccessAdvanced()) { + log.saveError("Error", Msg.getMsg(getCtx(), "ActionNotAllowedHere")); + return false; + } + } + return true; + } + } // MUserRoles From ee3e5644caa0589645a7d229ff3beed2fe9ff7c3 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 10:53:37 -0500 Subject: [PATCH 05/13] IDEMPIERE-1717 Maintenance mode --- .../i2.0/oracle/201404021038_IDEMPIERE-1717.sql | 15 +++++++++++++++ .../postgresql/201404021038_IDEMPIERE-1717.sql | 12 ++++++++++++ .../src/org/compiere/util/Login.java | 9 ++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 migration/i2.0/oracle/201404021038_IDEMPIERE-1717.sql create mode 100644 migration/i2.0/postgresql/201404021038_IDEMPIERE-1717.sql diff --git a/migration/i2.0/oracle/201404021038_IDEMPIERE-1717.sql b/migration/i2.0/oracle/201404021038_IDEMPIERE-1717.sql new file mode 100644 index 0000000000..49aa430d4f --- /dev/null +++ b/migration/i2.0/oracle/201404021038_IDEMPIERE-1717.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Apr 2, 2014 10:27:03 AM COT +-- IDEMPIERE-1717 Maintenance mode +INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Updated,Created,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200052,'C','N','Define if the system is in manteinance mode. Y = just advanced roles can log in / N = normal operation mode','636b9278-5633-4f92-9180-a2eb4f0674b1',TO_DATE('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),TO_DATE('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'SYSTEM_IN_MAINTENANCE_MODE',0,'D') +; + +-- Apr 2, 2014 10:39:33 AM COT +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('E','System is in maintenance mode, please wait until the access is restored.',200268,'D','bc45a082-4784-46a8-b5a5-14874ed5ee69','SystemInMaintenance','Y',TO_DATE('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),100,100,TO_DATE('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),0,0) +; + +SELECT register_migration_script('201404021038_IDEMPIERE-1717.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201404021038_IDEMPIERE-1717.sql b/migration/i2.0/postgresql/201404021038_IDEMPIERE-1717.sql new file mode 100644 index 0000000000..6f6f3ad80d --- /dev/null +++ b/migration/i2.0/postgresql/201404021038_IDEMPIERE-1717.sql @@ -0,0 +1,12 @@ +-- Apr 2, 2014 10:27:03 AM COT +-- IDEMPIERE-1717 Maintenance mode +INSERT INTO AD_SysConfig (AD_SysConfig_ID,ConfigurationLevel,Value,Description,AD_SysConfig_UU,Updated,Created,AD_Org_ID,CreatedBy,IsActive,UpdatedBy,Name,AD_Client_ID,EntityType) VALUES (200052,'C','N','Define if the system is in manteinance mode. Y = just advanced roles can log in / N = normal operation mode','636b9278-5633-4f92-9180-a2eb4f0674b1',TO_TIMESTAMP('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),TO_TIMESTAMP('2014-04-02 10:27:02','YYYY-MM-DD HH24:MI:SS'),0,100,'Y',100,'SYSTEM_IN_MAINTENANCE_MODE',0,'D') +; + +-- Apr 2, 2014 10:39:33 AM COT +INSERT INTO AD_Message (MsgType,MsgText,AD_Message_ID,EntityType,AD_Message_UU,Value,IsActive,Updated,CreatedBy,UpdatedBy,Created,AD_Client_ID,AD_Org_ID) VALUES ('E','System is in maintenance mode, please wait until the access is restored.',200268,'D','bc45a082-4784-46a8-b5a5-14874ed5ee69','SystemInMaintenance','Y',TO_TIMESTAMP('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),100,100,TO_TIMESTAMP('2014-04-02 10:39:32','YYYY-MM-DD HH24:MI:SS'),0,0) +; + +SELECT register_migration_script('201404021038_IDEMPIERE-1717.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/util/Login.java b/org.adempiere.base/src/org/compiere/util/Login.java index 50c3e3df76..cd3d5df0f8 100644 --- a/org.adempiere.base/src/org/compiere/util/Login.java +++ b/org.adempiere.base/src/org/compiere/util/Login.java @@ -768,7 +768,14 @@ public class Login { log.severe("Refused: " + error); return error; - } + } + + // IDEMPIERE-1717 Maintenance mode + if (! MRole.get(m_ctx, AD_Role_ID).isAccessAdvanced()) { + if (MSysConfig.getBooleanValue("SYSTEM_IN_MAINTENANCE_MODE", false, AD_Client_ID)) + return Msg.getMsg(m_ctx, "SystemInMaintenance"); + } + return null; } // validateLogin From 8d6a31defd5cd180857d591f8c252008f566de41 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Thu, 27 Mar 2014 22:50:00 +0800 Subject: [PATCH 06/13] IDEMPIERE-1871 1003779 Inactive records should be distinguishable from Active records in grid view. --- .../webui/adwindow/GridTabRowRenderer.java | 27 ++++++++++++++++++- .../theme/default/css/theme.css.dsp | 5 ++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index ba260bff98..f64609644b 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -20,6 +20,7 @@ import java.util.Map.Entry; import java.util.Properties; import org.adempiere.util.GridRowCtx; +import org.adempiere.webui.LayoutUtils; import org.adempiere.webui.component.Button; import org.adempiere.webui.component.Checkbox; import org.adempiere.webui.component.EditorBox; @@ -361,7 +362,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt Grid grid = (Grid) row.getParent().getParent(); org.zkoss.zul.Columns columns = grid.getColumns(); - int rowIndex = row.getParent().getChildren().indexOf(row); + int rowIndex = index; if (paging != null && paging.getPageSize() > 0) { rowIndex = (paging.getActivePage() * paging.getPageSize()) + rowIndex; } @@ -391,6 +392,7 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt row.appendChild(cell); + Boolean isActive = null; int colIndex = -1; for (int i = 0; i < columnCount; i++) { if (editors.get(gridPanelFields[i]) == null) { @@ -416,6 +418,15 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt defaultFocusField = editor; } + if ("IsActive".equals(gridPanelFields[i].getColumnName())) { + isActive = Boolean.FALSE; + if (currentValues[i] != null) { + if ("true".equalsIgnoreCase(currentValues[i].toString())) { + isActive = Boolean.TRUE; + } + } + } + if (!gridPanelFields[i].isDisplayedGrid() || gridPanelFields[i].isToolbarButton()) { continue; } @@ -453,6 +464,20 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt row.setStyle("cursor:pointer"); row.addEventListener(Events.ON_CLICK, rowListener); row.addEventListener(Events.ON_OK, rowListener); + + if (isActive == null) { + Object isActiveValue = gridTab.getValue(rowIndex, "IsActive"); + if (isActiveValue != null) { + if ("true".equalsIgnoreCase(isActiveValue.toString())) { + isActive = Boolean.TRUE; + } else { + isActive = Boolean.FALSE; + } + } + } + if (isActive != null && !isActive.booleanValue()) { + LayoutUtils.addSclass("grid-inactive-row", row); + } } /** diff --git a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp index 2d9f7384f0..6691a21999 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -922,6 +922,11 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { left: 4px; z-index: -1; } + +.z-grid tbody tr.grid-inactive-row td.z-cell { + background-image: none !important; + background-color: #DCDAD4 !important; +} .z-grid tbody tr.highlight td.z-cell { background-color: #FFFFCC !important; From 63b3aac408c4a779edaf186c5b6bf4937cc6948f Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 11:24:43 -0500 Subject: [PATCH 07/13] IDEMPIERE-1871 Inactive records should be distinguishable from Active records in grid view / implement the same if current row is inactive --- .../webui/adwindow/GridTabRowRenderer.java | 14 ++++++++++++++ .../theme/default/css/theme.css.dsp | 9 +++++++++ 2 files changed, 23 insertions(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java index f64609644b..fabd3671d6 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/GridTabRowRenderer.java @@ -511,6 +511,20 @@ public class GridTabRowRenderer implements RowRenderer, RowRendererExt } String script = "jq('#"+row.getUuid()+"').addClass('highlight').siblings().removeClass('highlight')"; + + Boolean isActive = null; + Object isActiveValue = gridTab.getValue(currentRowIndex, "IsActive"); + if (isActiveValue != null) { + if ("true".equalsIgnoreCase(isActiveValue.toString())) { + isActive = Boolean.TRUE; + } else { + isActive = Boolean.FALSE; + } + } + if (isActive != null && !isActive.booleanValue()) { + script = "jq('#"+row.getUuid()+"').addClass('grid-inactive-row').siblings().removeClass('highlight')"; + } + Clients.response(new AuScript(script)); } diff --git a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp index 6691a21999..706199e8fd 100644 --- a/org.adempiere.ui.zk/theme/default/css/theme.css.dsp +++ b/org.adempiere.ui.zk/theme/default/css/theme.css.dsp @@ -927,6 +927,15 @@ div.wc-modal, div.wc-modal-none, div.wc-highlighted, div.wc-highlighted-none { background-image: none !important; background-color: #DCDAD4 !important; } + +.z-grid tbody tr.grid-inactive-row td.row-indicator-seld { + background-color: transparent !important; + background-image: url(${c:encodeURL('/theme/default/images/EditRecord16.png')}) !important; + background-position: center; + background-repeat: no-repeat; + background-size: 16px 16px; + cursor: pointer; +} .z-grid tbody tr.highlight td.z-cell { background-color: #FFFFCC !important; From 63c57b944c859eff59abdd7ad173b0720edf7ed6 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 2 Apr 2014 06:47:46 +0800 Subject: [PATCH 08/13] 1003869 Form to captured process parameter for scheduler. IDEMPIERE-1486 / Fixed captured to value for non-range parameter as well. --- .../org/adempiere/webui/apps/form/WProcessParameter.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java index 8863bdde8b..d098ba74c7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java @@ -73,21 +73,21 @@ public class WProcessParameter implements IFormController { if (DisplayType.isNumeric(processPara.getAD_Reference_ID())) { if (para.getP_Number() != null) schedulerPara.setParameterDefault(para.getP_Number().toString()); - if (para.getP_Number_To() != null) + if (processPara.isRange() && para.getP_Number_To() != null) schedulerPara.setParameterToDefault(para.getP_Number_To().toString()); } else if (DisplayType.isID(processPara.getAD_Reference_ID())) { if (para.getP_Number() != null) schedulerPara.setParameterDefault(Integer.toString(para.getP_Number().intValue())); - if (para.getP_Number_To() != null) + if (processPara.isRange() && para.getP_Number_To() != null) schedulerPara.setParameterToDefault(Integer.toString(para.getP_Number_To().intValue())); } else if (DisplayType.isDate(processPara.getAD_Reference_ID())) { if (para.getP_Date() != null) schedulerPara.setParameterDefault(para.getP_Date().toString()); - if (para.getP_Date_To() != null) + if (processPara.isRange() && para.getP_Date_To() != null) schedulerPara.setParameterToDefault(para.getP_Date_To().toString()); } else { schedulerPara.setParameterDefault(para.getP_String()); - if (para.getP_String_To() != null) + if (processPara.isRange() && para.getP_String_To() != null) schedulerPara.setParameterToDefault(para.getP_String_To()); } if (!Util.isEmpty(para.getInfo())) { From db3a14f6da214b8a389c4d9c7f9fa97075961249 Mon Sep 17 00:00:00 2001 From: Elaine Tan Date: Thu, 13 Mar 2014 12:24:15 +0800 Subject: [PATCH 09/13] IDEMPIERE-1814 Payment check no and stock check number do not match when using Payment Selection and Payment Print/Export --- .../compiere/model/MPaySelectionCheck.java | 217 ++++++++++-------- .../adempiere/webui/apps/form/WPayPrint.java | 53 +++-- 2 files changed, 158 insertions(+), 112 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java index b3f5f2a041..28db5763c7 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java @@ -188,27 +188,24 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck ps.saveEx(); return psc; } // createForPayment - /************************************************************************** - * Get Checks of Payment Selection + * Get Checks of Payment Selection without check no assignment * * @param C_PaySelection_ID Payment Selection * @param PaymentRule Payment Rule - * @param startDocumentNo start document no * @param trxName transaction * @return array of checks */ - static public MPaySelectionCheck[] get (int C_PaySelection_ID, - String PaymentRule, int startDocumentNo, String trxName) + public static MPaySelectionCheck[] get (int C_PaySelection_ID, String PaymentRule, String trxName) { if (s_log.isLoggable(Level.FINE)) s_log.fine("C_PaySelection_ID=" + C_PaySelection_ID - + ", PaymentRule=" + PaymentRule + ", startDocumentNo=" + startDocumentNo); + + ", PaymentRule=" + PaymentRule); ArrayList list = new ArrayList(); - int docNo = startDocumentNo; String sql = "SELECT * FROM C_PaySelectionCheck " - + "WHERE C_PaySelection_ID=? AND PaymentRule=?"; + + "WHERE C_PaySelection_ID=? AND PaymentRule=? " + + "ORDER BY C_PaySelectionCheck_ID"; // order by the C_PaySelectionCheck_ID PreparedStatement pstmt = null; ResultSet rs = null; try @@ -220,9 +217,6 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck while (rs.next()) { MPaySelectionCheck check = new MPaySelectionCheck (Env.getCtx(), rs, trxName); - // Set new Check Document No - check.setDocumentNo(String.valueOf(docNo++)); - check.saveEx(); list.add(check); } } @@ -243,6 +237,122 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck } // get + /************************************************************************** + * Get Checks of Payment Selection + * + * @param C_PaySelection_ID Payment Selection + * @param PaymentRule Payment Rule + * @param startDocumentNo start document no + * @param trxName transaction + * @return array of checks + */ + static public MPaySelectionCheck[] get (int C_PaySelection_ID, + String PaymentRule, int startDocumentNo, String trxName) + { + MPaySelectionCheck[] checks = get(C_PaySelection_ID, PaymentRule, trxName); + int docNo = startDocumentNo; + for (MPaySelectionCheck check : checks) + { + // Set new Check Document No + check.setDocumentNo(String.valueOf(docNo++)); + check.saveEx(); + } + return checks; + } // get + + /************************************************************************** + * Confirm Print for a payment selection check + * Create Payment the first time + * @param check check + * @param batch batch + */ + public static void confirmPrint (MPaySelectionCheck check, MPaymentBatch batch) + { + MPayment payment = new MPayment(check.getCtx(), check.getC_Payment_ID(), check.get_TrxName()); + // Existing Payment + if (check.getC_Payment_ID() != 0) + { + // Update check number + if (check.getPaymentRule().equals(PAYMENTRULE_Check)) + { + payment.setCheckNo(check.getDocumentNo()); + if (!payment.save()) + s_log.log(Level.SEVERE, "Payment not saved: " + payment); + } + } + else // New Payment + { + payment = new MPayment(check.getCtx(), 0, check.get_TrxName()); + payment.setAD_Org_ID(check.getAD_Org_ID()); + // + if (check.getPaymentRule().equals(PAYMENTRULE_Check)) + payment.setBankCheck (check.getParent().getC_BankAccount_ID(), false, check.getDocumentNo()); + else if (check.getPaymentRule().equals(PAYMENTRULE_CreditCard)) + payment.setTenderType(X_C_Payment.TENDERTYPE_CreditCard); + else if (check.getPaymentRule().equals(PAYMENTRULE_DirectDeposit) + || check.getPaymentRule().equals(PAYMENTRULE_DirectDebit)) + payment.setBankACH(check); + else + { + s_log.log(Level.SEVERE, "Unsupported Payment Rule=" + check.getPaymentRule()); + return; + } + payment.setTrxType(X_C_Payment.TRXTYPE_CreditPayment); + payment.setAmount(check.getParent().getC_Currency_ID(), check.getPayAmt()); + payment.setDiscountAmt(check.getDiscountAmt()); + payment.setDateTrx(check.getParent().getPayDate()); + payment.setDateAcct(payment.getDateTrx()); // globalqss [ 2030685 ] + payment.setC_BPartner_ID(check.getC_BPartner_ID()); + // Link to Batch + if (batch != null) + { + if (batch.getC_PaymentBatch_ID() == 0) + batch.saveEx(); // new + payment.setC_PaymentBatch_ID(batch.getC_PaymentBatch_ID()); + } + // Link to Invoice + MPaySelectionLine[] psls = check.getPaySelectionLines(false); + if (s_log.isLoggable(Level.FINE)) s_log.fine("confirmPrint - " + check + " (#SelectionLines=" + psls.length + ")"); + if (check.getQty() == 1 && psls != null && psls.length == 1) + { + MPaySelectionLine psl = psls[0]; + if (s_log.isLoggable(Level.FINE)) s_log.fine("Map to Invoice " + psl); + // + payment.setC_Invoice_ID (psl.getC_Invoice_ID()); + payment.setDiscountAmt (psl.getDiscountAmt()); + payment.setWriteOffAmt(psl.getDifferenceAmt()); + BigDecimal overUnder = psl.getOpenAmt().subtract(psl.getPayAmt()) + .subtract(psl.getDiscountAmt()).subtract(psl.getDifferenceAmt()); + payment.setOverUnderAmt(overUnder); + } + else + payment.setDiscountAmt(Env.ZERO); + payment.setWriteOffAmt(Env.ZERO); + if (!payment.save()) + s_log.log(Level.SEVERE, "Payment not saved: " + payment); + // + int C_Payment_ID = payment.get_ID(); + if (C_Payment_ID < 1) + s_log.log(Level.SEVERE, "Payment not created=" + check); + else + { + check.setC_Payment_ID (C_Payment_ID); + check.saveEx(); // Payment process needs it + // added AdempiereException by zuhri + if (!payment.processIt(DocAction.ACTION_Complete)) + throw new AdempiereException("Failed when processing document - " + payment.getProcessMsg()); + // end added + if (!payment.save()) + s_log.log(Level.SEVERE, "Payment not saved: " + payment); + } + } // new Payment + + check.setIsPrinted(true); + check.setProcessed(true); + if (!check.save ()) + s_log.log(Level.SEVERE, "Check not saved: " + check); + } // confirmPrint + /************************************************************************** * Confirm Print. * Create Payments the first time @@ -256,85 +366,8 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck for (int i = 0; i < checks.length; i++) { MPaySelectionCheck check = checks[i]; - MPayment payment = new MPayment(check.getCtx(), check.getC_Payment_ID(), check.get_TrxName()); - // Existing Payment - if (check.getC_Payment_ID() != 0) - { - // Update check number - if (check.getPaymentRule().equals(PAYMENTRULE_Check)) - { - payment.setCheckNo(check.getDocumentNo()); - if (!payment.save()) - s_log.log(Level.SEVERE, "Payment not saved: " + payment); - } - } - else // New Payment - { - payment = new MPayment(check.getCtx(), 0, check.get_TrxName()); - payment.setAD_Org_ID(check.getAD_Org_ID()); - // - if (check.getPaymentRule().equals(PAYMENTRULE_Check)) - payment.setBankCheck (check.getParent().getC_BankAccount_ID(), false, check.getDocumentNo()); - else if (check.getPaymentRule().equals(PAYMENTRULE_CreditCard)) - payment.setTenderType(X_C_Payment.TENDERTYPE_CreditCard); - else if (check.getPaymentRule().equals(PAYMENTRULE_DirectDeposit) - || check.getPaymentRule().equals(PAYMENTRULE_DirectDebit)) - payment.setBankACH(check); - else - { - s_log.log(Level.SEVERE, "Unsupported Payment Rule=" + check.getPaymentRule()); - continue; - } - payment.setTrxType(X_C_Payment.TRXTYPE_CreditPayment); - payment.setAmount(check.getParent().getC_Currency_ID(), check.getPayAmt()); - payment.setDiscountAmt(check.getDiscountAmt()); - payment.setDateTrx(check.getParent().getPayDate()); - payment.setDateAcct(payment.getDateTrx()); // globalqss [ 2030685 ] - payment.setC_BPartner_ID(check.getC_BPartner_ID()); - // Link to Batch - if (batch != null) - { - if (batch.getC_PaymentBatch_ID() == 0) - batch.saveEx(); // new - payment.setC_PaymentBatch_ID(batch.getC_PaymentBatch_ID()); - } - // Link to Invoice - MPaySelectionLine[] psls = check.getPaySelectionLines(false); - if (s_log.isLoggable(Level.FINE)) s_log.fine("confirmPrint - " + check + " (#SelectionLines=" + psls.length + ")"); - if (check.getQty() == 1 && psls != null && psls.length == 1) - { - MPaySelectionLine psl = psls[0]; - if (s_log.isLoggable(Level.FINE)) s_log.fine("Map to Invoice " + psl); - // - payment.setC_Invoice_ID (psl.getC_Invoice_ID()); - payment.setDiscountAmt (psl.getDiscountAmt()); - payment.setWriteOffAmt(psl.getDifferenceAmt()); - BigDecimal overUnder = psl.getOpenAmt().subtract(psl.getPayAmt()) - .subtract(psl.getDiscountAmt()).subtract(psl.getDifferenceAmt()); - payment.setOverUnderAmt(overUnder); - } - else - payment.setDiscountAmt(Env.ZERO); - payment.setWriteOffAmt(Env.ZERO); - if (!payment.save()) - s_log.log(Level.SEVERE, "Payment not saved: " + payment); - // - int C_Payment_ID = payment.get_ID(); - if (C_Payment_ID < 1) - s_log.log(Level.SEVERE, "Payment not created=" + check); - else - { - check.setC_Payment_ID (C_Payment_ID); - check.saveEx(); // Payment process needs it - // added AdempiereException by zuhri - if (!payment.processIt(DocAction.ACTION_Complete)) - throw new AdempiereException("Failed when processing document - " + payment.getProcessMsg()); - // end added - if (!payment.save()) - s_log.log(Level.SEVERE, "Payment not saved: " + payment); - } - } // new Payment - + confirmPrint(check, batch); + // Get Check Document No try { @@ -346,10 +379,6 @@ public class MPaySelectionCheck extends X_C_PaySelectionCheck { s_log.log(Level.SEVERE, "DocumentNo=" + check.getDocumentNo(), ex); } - check.setIsPrinted(true); - check.setProcessed(true); - if (!check.save ()) - s_log.log(Level.SEVERE, "Check not saved: " + check); } // all checks if (s_log.isLoggable(Level.FINE)) s_log.fine("Last Document No = " + lastDocumentNo); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPayPrint.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPayPrint.java index f724551c7b..1d69369b15 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPayPrint.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WPayPrint.java @@ -69,6 +69,8 @@ import org.zkoss.zul.Center; import org.zkoss.zul.Filedownload; import org.zkoss.zul.South; +import com.lowagie.text.pdf.PdfReader; + /** * Payment Print & Export * @@ -379,7 +381,6 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene { if (result) { -// int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch); // document No not updated } @@ -418,34 +419,52 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene log.info(PaymentRule); if (!getChecks(PaymentRule)) return; - - // Update BankAccountDoc - int lastDocumentNo = MPaySelectionCheck.confirmPrint (m_checks, m_batch); + + // get document no + int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue(); + if (log.isLoggable(Level.CONFIG)) log.config("DocumentNo=" + startDocumentNo); // for all checks List pdfList = new ArrayList(); + int lastDocumentNo = startDocumentNo; for (int i = 0; i < m_checks.length; i++) { MPaySelectionCheck check = m_checks[i]; + + // Set new Check Document No + check.setDocumentNo(String.valueOf(lastDocumentNo)); + check.saveEx(); + + // Update BankAccountDoc + MPaySelectionCheck.confirmPrint(m_checks[i], m_batch); + // ReportCtrl will check BankAccountDoc for PrintFormat ReportEngine re = ReportEngine.get(Env.getCtx(), ReportEngine.CHECK, check.get_ID()); try { MPrintFormat format = re.getPrintFormat(); + File pdfFile = null; if (format.getJasperProcess_ID() > 0) { ProcessInfo pi = new ProcessInfo("", format.getJasperProcess_ID()); pi.setRecord_ID(check.get_ID()); pi.setIsBatch(true); - + ServerProcessCtl.process(pi, null); - pdfList.add(pi.getPDFReport()); + pdfFile = pi.getPDFReport(); } else { - File file = File.createTempFile("WPayPrint", null); - re.getPDF(file); - pdfList.add(file); + pdfFile = File.createTempFile("WPayPrint", null); + re.getPDF(pdfFile); + } + + if (pdfFile != null) + { + // increase the check document no by the number of pages of the generated pdf file + PdfReader document = new PdfReader(pdfFile.getAbsolutePath()); + lastDocumentNo += document.getNumberOfPages(); + pdfList.add(pdfFile); } } catch (Exception e) @@ -471,10 +490,11 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene } final SimplePDFViewer chequeViewerRef = chequeViewer; - if (lastDocumentNo != 0) + // Update Check Next Document No + if (startDocumentNo != lastDocumentNo) { StringBuilder sb = new StringBuilder(); - sb.append("UPDATE C_BankAccountDoc SET CurrentNext=").append(++lastDocumentNo) + sb.append("UPDATE C_BankAccountDoc SET CurrentNext=").append(lastDocumentNo) .append(" WHERE C_BankAccount_ID=").append(m_C_BankAccount_ID) .append(" AND PaymentRule='").append(PaymentRule).append("'"); DB.executeUpdate(sb.toString(), null); @@ -561,13 +581,10 @@ public class WPayPrint extends PayPrint implements IFormController, EventListene return false; } - // get data - int startDocumentNo = ((Number)fDocumentNo.getValue()).intValue(); - - if (log.isLoggable(Level.CONFIG)) log.config("C_PaySelection_ID=" + m_C_PaySelection_ID + ", PaymentRule=" + PaymentRule + ", DocumentNo=" + startDocumentNo); - // - // get Slecetions - m_checks = MPaySelectionCheck.get(m_C_PaySelection_ID, PaymentRule, startDocumentNo, null); + if (log.isLoggable(Level.CONFIG)) log.config("C_PaySelection_ID=" + m_C_PaySelection_ID + ", PaymentRule=" + PaymentRule); + + // get payment selection checks without check no assignment + m_checks = MPaySelectionCheck.get(m_C_PaySelection_ID, PaymentRule, null); // if (m_checks == null || m_checks.length == 0) From 991a1994231be0366e8063382613ab033911e5c1 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 16:00:53 -0500 Subject: [PATCH 10/13] Peer reviewing IDEMPIERE-1216 found wrong length on dashboard content translation --- .../i2.0/oracle/201404021448_IDEMPIERE-1216.sql | 15 +++++++++++++++ .../postgresql/201404021448_IDEMPIERE-1216.sql | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 migration/i2.0/oracle/201404021448_IDEMPIERE-1216.sql create mode 100644 migration/i2.0/postgresql/201404021448_IDEMPIERE-1216.sql diff --git a/migration/i2.0/oracle/201404021448_IDEMPIERE-1216.sql b/migration/i2.0/oracle/201404021448_IDEMPIERE-1216.sql new file mode 100644 index 0000000000..8b333f8c34 --- /dev/null +++ b/migration/i2.0/oracle/201404021448_IDEMPIERE-1216.sql @@ -0,0 +1,15 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Apr 2, 2014 2:46:52 PM COT +-- fix wrong length of PA_DashboardContent_Trl.Name +UPDATE AD_Column SET FieldLength=120,Updated=TO_DATE('2014-04-02 14:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=60126 +; + +-- Apr 2, 2014 2:46:54 PM COT +ALTER TABLE PA_DashboardContent_Trl MODIFY Name VARCHAR2(120) +; + +SELECT register_migration_script('201404021448_IDEMPIERE-1216.sql') FROM dual +; + diff --git a/migration/i2.0/postgresql/201404021448_IDEMPIERE-1216.sql b/migration/i2.0/postgresql/201404021448_IDEMPIERE-1216.sql new file mode 100644 index 0000000000..52664b5956 --- /dev/null +++ b/migration/i2.0/postgresql/201404021448_IDEMPIERE-1216.sql @@ -0,0 +1,12 @@ +-- Apr 2, 2014 2:46:52 PM COT +-- fix wrong length of PA_DashboardContent_Trl.Name +UPDATE AD_Column SET FieldLength=120,Updated=TO_TIMESTAMP('2014-04-02 14:46:52','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=60126 +; + +-- Apr 2, 2014 2:46:54 PM COT +INSERT INTO t_alter_column values('pa_dashboardcontent_trl','Name','VARCHAR(120)',null,null) +; + +SELECT register_migration_script('201404021448_IDEMPIERE-1216.sql') FROM dual +; + From 5aa1701d019c7d6c03476651d3333a7392b1b3b0 Mon Sep 17 00:00:00 2001 From: Nicolas Micoud Date: Wed, 2 Apr 2014 19:59:25 -0500 Subject: [PATCH 11/13] IDEMPIERE-1845 Allow Scheduler to use default logic based on SQL --- .../oracle/201303212222_IDEMPIERE-1845.sql | 14 +++++++ .../201303212222_IDEMPIERE-1845.sql | 11 ++++++ .../server/org/compiere/server/Scheduler.java | 38 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 migration/i2.0/oracle/201303212222_IDEMPIERE-1845.sql create mode 100644 migration/i2.0/postgresql/201303212222_IDEMPIERE-1845.sql diff --git a/migration/i2.0/oracle/201303212222_IDEMPIERE-1845.sql b/migration/i2.0/oracle/201303212222_IDEMPIERE-1845.sql new file mode 100644 index 0000000000..a03d518249 --- /dev/null +++ b/migration/i2.0/oracle/201303212222_IDEMPIERE-1845.sql @@ -0,0 +1,14 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Mar 21, 2014 10:20:57 PM CET +-- IDEMPIERE-1845 +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-03-21 22:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9448 +; + +-- Mar 21, 2014 10:20:59 PM CET +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_DATE('2014-03-21 22:20:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202528 +; + +SELECT register_migration_script('201303212222_IDEMPIERE-1845.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i2.0/postgresql/201303212222_IDEMPIERE-1845.sql b/migration/i2.0/postgresql/201303212222_IDEMPIERE-1845.sql new file mode 100644 index 0000000000..69637f3fd8 --- /dev/null +++ b/migration/i2.0/postgresql/201303212222_IDEMPIERE-1845.sql @@ -0,0 +1,11 @@ +-- Mar 21, 2014 10:20:57 PM CET +-- IDEMPIERE-1845 +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-03-21 22:20:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=9448 +; + +-- Mar 21, 2014 10:20:59 PM CET +UPDATE AD_Field SET IsAdvancedField='Y',Updated=TO_TIMESTAMP('2014-03-21 22:20:59','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=202528 +; + +SELECT register_migration_script('201303212222_IDEMPIERE-1845.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java index cc8478b088..6c35cf1039 100644 --- a/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java +++ b/org.adempiere.server/src/main/server/org/compiere/server/Scheduler.java @@ -18,6 +18,9 @@ package org.compiere.server; import java.io.File; import java.math.BigDecimal; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; import java.sql.Timestamp; import java.text.SimpleDateFormat; import java.util.Properties; @@ -40,10 +43,12 @@ import org.compiere.print.ReportEngine; import org.compiere.process.ProcessInfo; import org.compiere.process.ProcessInfoUtil; import org.compiere.process.ServerProcessCtl; +import org.compiere.util.DB; import org.compiere.util.DisplayType; import org.compiere.util.Env; import org.compiere.util.TimeUtil; import org.compiere.util.Trx; +import org.compiere.util.Util; /** @@ -402,6 +407,39 @@ public class Scheduler extends AdempiereServer if (variable == null || (variable != null && variable.length() == 0)) value = null; + else if (variable.startsWith("@SQL=")) { + String defStr = ""; + String sql = variable.substring(5); // w/o tag + //sql = Env.parseContext(m_vo.ctx, m_vo.WindowNo, sql, false, true); // replace variables + //hengsin, capture unparseable error to avoid subsequent sql exception + sql = Env.parseContext(m_schedulerctx, 0, sql, false, false); // replace variables + if (sql.equals("")) + log.log(Level.WARNING, "(" + sPara.getColumnName() + ") - Default SQL variable parse failed: " + variable); + else { + PreparedStatement stmt = null; + ResultSet rs = null; + try { + stmt = DB.prepareStatement(sql, null); + rs = stmt.executeQuery(); + if (rs.next()) + defStr = rs.getString(1); + else { + if (log.isLoggable(Level.INFO)) + log.log(Level.INFO, "(" + sPara.getColumnName() + ") - no Result: " + sql); + } + } + catch (SQLException e) { + log.log(Level.WARNING, "(" + sPara.getColumnName() + ") " + sql, e); + } + finally{ + DB.close(rs, stmt); + rs = null; + stmt = null; + } + } + if (!Util.isEmpty(defStr)) + value = defStr; + } // SQL Statement else if ( variable.indexOf('@') != -1 && variable.indexOf('@') != variable.lastIndexOf('@')) // we have a variable / BF [1926032] { From aba6e6ca4815008d12648c7a6a9ba2a7c9ca1407 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 20:02:36 -0500 Subject: [PATCH 12/13] 1003869 Form to captured process parameter for scheduler. IDEMPIERE-1486 / Fixed captured value for null fields - fix default @#Date# being saved with time --- .../src/org/compiere/model/GridField.java | 11 ++++++++++- .../adempiere/webui/apps/form/WProcessParameter.java | 8 ++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index 3b86d17d3f..064e712e26 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -769,8 +769,17 @@ public class GridField { // try timestamp format - then date format -- [ 1950305 ] java.util.Date date = null; + SimpleDateFormat dateTimeFormat = DisplayType.getTimestampFormat_Default(); + SimpleDateFormat dateFormat = DisplayType.getDateFormat_JDBC(); + SimpleDateFormat timeFormat = DisplayType.getTimeFormat_Default(); try { - date = DisplayType.getTimestampFormat_Default().parse (value); + if (m_vo.displayType == DisplayType.Date) { + date = dateFormat.parse (value); + } else if (m_vo.displayType == DisplayType.Time) { + date = timeFormat.parse (value); + } else { + date = dateTimeFormat.parse (value); + } } catch (java.text.ParseException e) { date = DisplayType.getDateFormat_JDBC().parse (value); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java index d098ba74c7..f7370feb50 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WProcessParameter.java @@ -71,14 +71,14 @@ public class WProcessParameter implements IFormController { if (processPara.getColumnName().equals(para.getParameterName())) { schedulerPara.setAD_Process_Para_ID(processPara.getAD_Process_Para_ID()); if (DisplayType.isNumeric(processPara.getAD_Reference_ID())) { - if (para.getP_Number() != null) + if (para.get_Value(MPInstancePara.COLUMNNAME_P_Number) != null) schedulerPara.setParameterDefault(para.getP_Number().toString()); - if (processPara.isRange() && para.getP_Number_To() != null) + if (processPara.isRange() && para.get_Value(MPInstancePara.COLUMNNAME_P_Number_To) != null) schedulerPara.setParameterToDefault(para.getP_Number_To().toString()); } else if (DisplayType.isID(processPara.getAD_Reference_ID())) { - if (para.getP_Number() != null) + if (para.get_Value(MPInstancePara.COLUMNNAME_P_Number) != null) schedulerPara.setParameterDefault(Integer.toString(para.getP_Number().intValue())); - if (processPara.isRange() && para.getP_Number_To() != null) + if (processPara.isRange() && para.get_Value(MPInstancePara.COLUMNNAME_P_Number_To) != null) schedulerPara.setParameterToDefault(Integer.toString(para.getP_Number_To().intValue())); } else if (DisplayType.isDate(processPara.getAD_Reference_ID())) { if (para.getP_Date() != null) From c82b03a2186b3e088ba1f0e7dfe92119866d8552 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 2 Apr 2014 22:19:47 -0500 Subject: [PATCH 13/13] IDEMPIERE-166 Rebranding of logo and product name --- org.adempiere.install/Adempiere/install.html | 43 ++++++++++---------- org.adempiere.server/error.html | 6 +-- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/org.adempiere.install/Adempiere/install.html b/org.adempiere.install/Adempiere/install.html index cdc9c5f3ca..9c9ab3a093 100644 --- a/org.adempiere.install/Adempiere/install.html +++ b/org.adempiere.install/Adempiere/install.html @@ -2,9 +2,9 @@ -ADempiere - Smart Open Source ERP Software with integrated CRM Solution - - +iDempiere - Smart Open Source ERP Software with integrated CRM Solution + + @@ -41,8 +41,8 @@ function MM_swapImage() { //v3.0
@@ -50,42 +50,41 @@ function MM_swapImage() { //v3.0
-

Install StepsADempiere +

Install StepsiDempiere Server Installation

-

Please check the more detailed page on ADempiere Wiki
-
for the latest version and help from ADempiere Partners.

+

Please check the more detailed page on iDempiere Wiki
+
for the latest version and help from iDempiere Partners.

License information

 

Prerequisites

    -
  1. Download and install Sun Java 1.5.0 SDK (not just JRE)
  2. -
  3. Install +
  4. Download and install Oracle Java 7 SDK (not just JRE)
  5. +
  6. Install Database (Oracle 10g free download for development, Oracle 10gXE, PostgreSQL)
  7. -
  8. You downloaded ADempiere
  9. +
  10. You downloaded iDempiere

Installation

    -
  1. Install ADempiere Server
  2. -
  3. Create ADempiere Database
  4. -
  5. Complete ADempiere Server Install
  6. +
  7. Install iDempiere Server
  8. +
  9. Create iDempiere Database
  10. +
  11. Complete iDempiere Server Install

Client Installation

    -
  1. Download and install Sun Java 1.5.0 JRE
  2. +
  3. Download and install Oracle Java 7 JRE
  4. Point your browser to your application server - options -
      -
    1. Start the client with WebStart
    2. -
    3. Download and extract the file AdempiereClient.zip
    4. +
    5. Download and extract the idempiere client
-

ADempiere Application Client Install Details.

+

iDempiere Application Client Install Details.

Installing Language Packs

-

Please check the Download +

Please check the Translations Project Page for the availability of Language Packs. You find the - installation details here.
+ installation details here.

@@ -94,8 +93,8 @@ function MM_swapImage() { //v3.0

Copyright - © 2010 ADempiere, Inc. - All rights reserved
- ADempiere™ is a registered trademark of ADempiere, Inc
+ © 2010 iDempiere, Inc. - All rights reserved
+ iDempiere™ is a registered trademark of iDempiere, Inc

diff --git a/org.adempiere.server/error.html b/org.adempiere.server/error.html index 1b64ae59a4..c97548dfe7 100644 --- a/org.adempiere.server/error.html +++ b/org.adempiere.server/error.html @@ -2,12 +2,12 @@ -ADempiere Server Error +iDempiere Server Error -

ADempiere Server Error

-

The ADempiere Server encountered a unrecoverable error.

+

iDempiere Server Error

+

The iDempiere Server encountered a unrecoverable error.

Please notify the administrator.