From 0e09ac40e97eec8b22db92c1782686bc97d6bd35 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 8 Mar 2013 00:02:30 -0500 Subject: [PATCH 1/4] IDEMPIERE-678 Cannot copy a print format twice --- .../src/org/compiere/print/MPrintFormat.java | 22 ++++++++++++++----- .../src/org/compiere/report/FinReport.java | 4 +++- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java index 8b30fe1e49..546311b9f3 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java @@ -61,7 +61,7 @@ public class MPrintFormat extends X_AD_PrintFormat /** * */ - private static final long serialVersionUID = -8307496567084341384L; + private static final long serialVersionUID = -1378114118642378625L; /** * Public Constructor. @@ -803,17 +803,27 @@ public class MPrintFormat extends X_AD_PrintFormat return pf; } // createFromReportView - private static void setUniqueName(int AD_Client_ID, MPrintFormat pf, String basename) { + public static void setUniqueName(int AD_Client_ID, MPrintFormat pf, String basename) { String name = basename; pf.setName(name); + boolean dateAsSuffix = true; boolean sleep = false; - while (exists(AD_Client_ID, name)) { + while (exists(AD_Client_ID, pf.getName())) { if (sleep) Env.sleep(1); // wait 1 sec to get next second in datetime else sleep = true; - name = basename + "_" + getDateTime(); + if (dateAsSuffix) { + name = basename + "_" + getDateTime(); + } else { + name = getDateTime() + "_" + basename; + } pf.setName(name); + if (sleep && !name.equals(pf.getName())) { + // there has been already one iteration and the name is being truncated + // change method to put date as prefix + dateAsSuffix = false; + } } } @@ -1029,8 +1039,8 @@ public class MPrintFormat extends X_AD_PrintFormat // Set Name - Remove TEMPLATE - add copy to.setName(Util.replace(to.getName(), "TEMPLATE", String.valueOf(to_Client_ID))); to.setName(to.getName() - + " - " + Util.cleanAmp(Msg.getMsg(ctx, "Copy")) - + " " + getDateTime()); // unique name + + " - " + Util.cleanAmp(Msg.getMsg(ctx, "Copy"))); + setUniqueName(to.getAD_Client_ID(), to, to.getName()); // to.saveEx(); diff --git a/org.adempiere.base/src/org/compiere/report/FinReport.java b/org.adempiere.base/src/org/compiere/report/FinReport.java index 0f016ee7bc..74ef82445c 100644 --- a/org.adempiere.base/src/org/compiere/report/FinReport.java +++ b/org.adempiere.base/src/org/compiere/report/FinReport.java @@ -1473,8 +1473,10 @@ public class FinReport extends SvrProcess pf = MPrintFormat.get (getCtx(), AD_PrintFormat_ID, false); // use Cache // Print Format Sync - if (!m_report.getName().equals(pf.getName())) + if (!m_report.getName().equals(pf.getName())) { pf.setName(m_report.getName()); + MPrintFormat.setUniqueName(pf.getAD_Client_ID(), pf, pf.getName()); + } if (m_report.getDescription() == null) { if (pf.getDescription () != null) From f5ede31a713207eabc75627fd33882edf2cffb98 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Fri, 8 Mar 2013 00:40:26 -0500 Subject: [PATCH 2/4] IDEMPIERE-379 Reporting wizard for end users / Error with button copy format --- .../src/org/adempiere/webui/apps/form/WReportCustomization.java | 1 + 1 file changed, 1 insertion(+) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java index 1795be60a4..8d3c7bb60f 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/form/WReportCustomization.java @@ -516,6 +516,7 @@ public class WReportCustomization implements IFormController,EventListener Date: Fri, 8 Mar 2013 00:51:57 -0500 Subject: [PATCH 3/4] =?UTF-8?q?IDEMPIERE-684=20problem=20with=20calculator?= =?UTF-8?q?=20with=20value=200.02=20/=20Thanks=20to=20David=20Pe=C3=B1uela?= =?UTF-8?q?=20(dpenuela)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WEB-INF/src/org/adempiere/webui/component/NumberBox.java | 2 +- org.adempiere.ui.zk/js/calc.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java index 1411ddfe9b..8f5c0e42c7 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/component/NumberBox.java @@ -204,7 +204,7 @@ public class NumberBox extends Div decimalBox.setId(decimalBox.getUuid()); txtCalc.setId(txtCalc.getUuid()); - txtCalc.setWidgetListener("onKeyPress", "return calc.validate('" + + txtCalc.setWidgetListener("onKeyUp", "return calc.validate('" + decimalBox.getId() + "','" + txtCalc.getId() + "'," + integral + "," + (int)separatorChar + ", event);"); txtCalc.setMaxlength(250); diff --git a/org.adempiere.ui.zk/js/calc.js b/org.adempiere.ui.zk/js/calc.js index 9f10380124..2e28aee360 100644 --- a/org.adempiere.ui.zk/js/calc.js +++ b/org.adempiere.ui.zk/js/calc.js @@ -18,7 +18,7 @@ function Calc() if(key == 13 || key == 61) // Enter, = { - evaluate(displayTextId, calcTextId); + evaluate(displayTextId, calcTextId, String.fromCharCode(separatorKey)); return false; } else if (key == 0) // control, delete, ... From 7e89dd0d26a853c13ed6a2ee58924c78ec461e8f Mon Sep 17 00:00:00 2001 From: Juliana Corredor Date: Fri, 8 Mar 2013 00:57:03 -0500 Subject: [PATCH 4/4] IDEMPIERE-707 can't customize view grid with user System --- .../src/org/adempiere/webui/panel/CustomizeGridViewPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java index 0a7cbe5692..b918d7a526 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/CustomizeGridViewPanel.java @@ -532,7 +532,7 @@ public class CustomizeGridViewPanel extends Panel } else{ uc = new MTabCustomization(Env.getCtx(), 0, null); uc.setAD_Tab_ID(m_AD_Tab_ID); - uc.setAD_User_ID(m_AD_User_ID); + uc.set_ValueOfColumn("AD_User_ID", m_AD_User_ID); uc.setCustom(custom.toString()); } if (uc.getCustom() == null || uc.getCustom().trim().length() == 0)