From 02b7c217b3f5014df61f94f58d00d50eec5018fb Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Sat, 13 Apr 2013 20:25:26 -0500 Subject: [PATCH] IDEMPIERE-489 Make use of AD_Language configuration --- .../oracle/201304132014_IDEMPIERE-489.sql | 8 +++++++ .../postgresql/201304132014_IDEMPIERE-489.sql | 8 +++++++ .../src/org/compiere/model/I_AD_Language.java | 4 ++-- .../src/org/compiere/model/X_AD_Language.java | 24 +++++++++---------- .../src/org/compiere/util/Language.java | 5 +--- 5 files changed, 31 insertions(+), 18 deletions(-) create mode 100644 migration/i1.0a-release/oracle/201304132014_IDEMPIERE-489.sql create mode 100644 migration/i1.0a-release/postgresql/201304132014_IDEMPIERE-489.sql diff --git a/migration/i1.0a-release/oracle/201304132014_IDEMPIERE-489.sql b/migration/i1.0a-release/oracle/201304132014_IDEMPIERE-489.sql new file mode 100644 index 0000000000..76dd00feb5 --- /dev/null +++ b/migration/i1.0a-release/oracle/201304132014_IDEMPIERE-489.sql @@ -0,0 +1,8 @@ +-- Apr 13, 2013 8:13:48 PM COT +-- IDEMPIERE-489 Make use of AD_Language configuration +UPDATE AD_Column SET AD_Reference_Value_ID=NULL, AD_Reference_ID=20, Updated=TO_DATE('2013-04-13 20:13:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13080 +; + +SELECT register_migration_script('201304132014_IDEMPIERE-489.sql') FROM dual +; + diff --git a/migration/i1.0a-release/postgresql/201304132014_IDEMPIERE-489.sql b/migration/i1.0a-release/postgresql/201304132014_IDEMPIERE-489.sql new file mode 100644 index 0000000000..2f2230f021 --- /dev/null +++ b/migration/i1.0a-release/postgresql/201304132014_IDEMPIERE-489.sql @@ -0,0 +1,8 @@ +-- Apr 13, 2013 8:13:48 PM COT +-- IDEMPIERE-489 Make use of AD_Language configuration +UPDATE AD_Column SET AD_Reference_Value_ID=NULL, AD_Reference_ID=20, Updated=TO_TIMESTAMP('2013-04-13 20:13:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13080 +; + +SELECT register_migration_script('201304132014_IDEMPIERE-489.sql') FROM dual +; + diff --git a/org.adempiere.base/src/org/compiere/model/I_AD_Language.java b/org.adempiere.base/src/org/compiere/model/I_AD_Language.java index 7d6c22c8e5..8e4773583e 100644 --- a/org.adempiere.base/src/org/compiere/model/I_AD_Language.java +++ b/org.adempiere.base/src/org/compiere/model/I_AD_Language.java @@ -182,12 +182,12 @@ public interface I_AD_Language /** Set Decimal Point. * The number notation has a decimal point (no decimal comma) */ - public void setIsDecimalPoint (String IsDecimalPoint); + public void setIsDecimalPoint (boolean IsDecimalPoint); /** Get Decimal Point. * The number notation has a decimal point (no decimal comma) */ - public String getIsDecimalPoint(); + public boolean isDecimalPoint(); /** Column name IsLoginLocale */ public static final String COLUMNNAME_IsLoginLocale = "IsLoginLocale"; diff --git a/org.adempiere.base/src/org/compiere/model/X_AD_Language.java b/org.adempiere.base/src/org/compiere/model/X_AD_Language.java index 2289bfc83e..39bad4641a 100644 --- a/org.adempiere.base/src/org/compiere/model/X_AD_Language.java +++ b/org.adempiere.base/src/org/compiere/model/X_AD_Language.java @@ -30,7 +30,7 @@ public class X_AD_Language extends PO implements I_AD_Language, I_Persistent /** * */ - private static final long serialVersionUID = 20130315L; + private static final long serialVersionUID = 20130413L; /** Standard Constructor */ public X_AD_Language (Properties ctx, int AD_Language_ID, String trxName) @@ -214,28 +214,28 @@ public class X_AD_Language extends PO implements I_AD_Language, I_Persistent return false; } - /** IsDecimalPoint AD_Reference_ID=319 */ - public static final int ISDECIMALPOINT_AD_Reference_ID=319; - /** Yes = Y */ - public static final String ISDECIMALPOINT_Yes = "Y"; - /** No = N */ - public static final String ISDECIMALPOINT_No = "N"; /** Set Decimal Point. @param IsDecimalPoint The number notation has a decimal point (no decimal comma) */ - public void setIsDecimalPoint (String IsDecimalPoint) + public void setIsDecimalPoint (boolean IsDecimalPoint) { - - set_Value (COLUMNNAME_IsDecimalPoint, IsDecimalPoint); + set_Value (COLUMNNAME_IsDecimalPoint, Boolean.valueOf(IsDecimalPoint)); } /** Get Decimal Point. @return The number notation has a decimal point (no decimal comma) */ - public String getIsDecimalPoint () + public boolean isDecimalPoint () { - return (String)get_Value(COLUMNNAME_IsDecimalPoint); + Object oo = get_Value(COLUMNNAME_IsDecimalPoint); + if (oo != null) + { + if (oo instanceof Boolean) + return ((Boolean)oo).booleanValue(); + return "Y".equals(oo); + } + return false; } /** Set Login Locale. diff --git a/org.adempiere.base/src/org/compiere/util/Language.java b/org.adempiere.base/src/org/compiere/util/Language.java index e8887df195..c35c3b5ad3 100644 --- a/org.adempiere.base/src/org/compiere/util/Language.java +++ b/org.adempiere.base/src/org/compiere/util/Language.java @@ -154,9 +154,6 @@ public class Language implements Serializable } MLanguage dblang = MLanguage.get(Env.getCtx(), langInfo); if (dblang != null) { - Boolean decimalPoint = null; - if (dblang.getIsDecimalPoint() != null) - decimalPoint = "Y".equals(dblang.getIsDecimalPoint()); if (!( language.equals(dblang.getLanguageISO()) && country.equals(dblang.getCountryCode()) ) @@ -168,7 +165,7 @@ public class Language implements Serializable MPrintPaper pp = MPrintPaper.get(dblang.getAD_PrintPaper_ID()); mediaSize = pp.getMediaSize(); } - ll = new Language(dblang.getPrintName(), langInfo, locale, decimalPoint, dblang.getDatePattern(), mediaSize); + ll = new Language(dblang.getPrintName(), langInfo, locale, null, dblang.getDatePattern(), mediaSize); ll.m_fromDB = true; if (dblang.isBaseLanguage()) { idxReplace = 0;