From 79cf3109d013db5e8f1ee9bf96f96fcc6aa637bf Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 5 Sep 2013 14:44:45 -0500 Subject: [PATCH 1/3] IDEMPIERE-1323 Zoom Condition bug --- .../WEB-INF/src/org/adempiere/webui/apps/AEnv.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java index 6e40073b13..9eca46c30c 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/apps/AEnv.java @@ -386,8 +386,13 @@ public final class AEnv zoomQuery.addRestriction(column, MQuery.EQUAL, value); zoomQuery.setRecordCount(1); // guess } - int windowId = lookup.getZoom(zoomQuery); - zoom(windowId, zoomQuery); + if (value instanceof Integer && ((Integer) value).intValue() >= 0 && zoomQuery != null && zoomQuery.getZoomTableName() != null) { + int tableId = MTable.getTable_ID(zoomQuery.getZoomTableName()); + zoom(tableId, ((Integer) value).intValue()); + } else { + int windowId = lookup.getZoom(zoomQuery); + zoom(windowId, zoomQuery); + } } /** From b57c8c638f5f2651e4fdd0243764a1b5184ffb81 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 5 Sep 2013 17:36:19 -0500 Subject: [PATCH 2/3] IDEMPIERE-1025 Improve translation for custom tables / do not insert translations if the language is not installed --- .../adempiere/pipo2/handler/CommonTranslationHandler.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java index 07daff48fb..40901fc17f 100644 --- a/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java +++ b/org.adempiere.pipo.handlers/src/org/adempiere/pipo2/handler/CommonTranslationHandler.java @@ -16,6 +16,7 @@ import org.adempiere.pipo2.ElementHandler; import org.adempiere.pipo2.PIPOContext; import org.adempiere.pipo2.PackOut; import org.adempiere.pipo2.PoExporter; +import org.compiere.model.MLanguage; import org.compiere.model.MTable; import org.compiere.util.DB; import org.compiere.util.Env; @@ -52,6 +53,10 @@ public class CommonTranslationHandler extends AbstractElementHandler implements throw new SAXException(); String language = getStringValue(element, "AD_Language"); + MLanguage lang = MLanguage.get(ctx.ctx, language); + // skip if not system installed language + if (! lang.isSystemLanguage()) + return; if (log.isLoggable(Level.INFO)) log.info(elementValue+" "+getStringValue(element, "Name")); From 1ab0741364ab982572b49a2348d6a79df3c86469 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Thu, 5 Sep 2013 18:01:05 -0500 Subject: [PATCH 3/3] IDEMPIERE-1270 PaymentFormOnCredit is not translating payment terms / based on patch from Naim Berisha --- .../org/compiere/grid/PaymentFormOnCredit.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/org.adempiere.ui/src/org/compiere/grid/PaymentFormOnCredit.java b/org.adempiere.ui/src/org/compiere/grid/PaymentFormOnCredit.java index a023f6e6c5..eb31219957 100644 --- a/org.adempiere.ui/src/org/compiere/grid/PaymentFormOnCredit.java +++ b/org.adempiere.ui/src/org/compiere/grid/PaymentFormOnCredit.java @@ -23,6 +23,7 @@ import org.compiere.model.GridTab; import org.compiere.model.MRole; import org.compiere.util.DB; import org.compiere.util.KeyNamePair; +import org.compiere.util.Env; /** * @@ -52,9 +53,21 @@ public abstract class PaymentFormOnCredit extends PaymentForm { /** * Load Payment Terms */ + String ad_language = Env.getAD_Language(Env.getCtx()); + boolean isBaseLanguage = Env.isBaseLanguage(ad_language, "C_PaymentTerm"); + StringBuilder sb = new StringBuilder(); + if (isBaseLanguage) { + sb.append("SELECT p.C_PaymentTerm_ID, p.Name FROM C_PaymentTerm p") + .append(" WHERE p.IsActive='Y' ORDER BY p.Name"); + } else { + sb.append("SELECT p.C_PaymentTerm_ID, pt.Name FROM C_PaymentTerm p") + .append(" JOIN C_PaymentTerm_Trl pt ON (p.C_PaymentTerm_ID=pt.C_PaymentTerm_ID AND pt.AD_Language='") + .append(ad_language).append("')") + .append(" WHERE p.IsActive='Y' ORDER BY p.Name"); + } + String SQL = MRole.getDefault().addAccessSQL( - "SELECT C_PaymentTerm_ID, Name FROM C_PaymentTerm WHERE IsActive='Y' ORDER BY Name", - "C_PaymentTerm", MRole.SQL_NOTQUALIFIED, MRole.SQL_RO); + sb.toString(), "p", MRole.SQL_FULLYQUALIFIED, MRole.SQL_RO); PreparedStatement pstmt = null; ResultSet rs = null; try