IDEMPIERE-844 Trial Balance displaying account names only in system language / Thanks to Richard Morales

This commit is contained in:
Carlos Ruiz 2013-04-23 15:51:48 -05:00
parent 652d86479d
commit 40984c23e7
1 changed files with 9 additions and 26 deletions

View File

@ -369,10 +369,6 @@ public class DataEngine
eSql = MLookupFactory.getLookup_TableDirEmbed(m_language, ColumnName, tableName); eSql = MLookupFactory.getLookup_TableDirEmbed(m_language, ColumnName, tableName);
} }
// TableName
String table = ColumnName;
if (table.endsWith("_ID"))
table = table.substring(0, table.length()-3);
// DisplayColumn // DisplayColumn
String display = ColumnName; String display = ColumnName;
// => (..) AS AName, Table.ID, // => (..) AS AName, Table.ID,
@ -394,31 +390,18 @@ public class DataEngine
{ {
lookupSQL = ColumnSQL; lookupSQL = ColumnSQL;
} }
if (AD_Reference_Value_ID <= 0)
{ String eSql;
log.warning(ColumnName + " - AD_Reference_Value_ID not set");
continue; eSql = MLookupFactory.getLookup_TableEmbed(m_language, ColumnName, tableName, AD_Reference_Value_ID);
}
TableReference tr = getTableReference(AD_Reference_Value_ID); // DisplayColumn
String display = tr.DisplayColumn; String display = ColumnName;
// => A.Name AS AName, Table.ID, // => (..) AS AName, Table.ID,
if (tr.IsValueDisplayed) sqlSELECT.append("(").append(eSql).append(") AS ").append(m_synonym).append(display).append(",")
sqlSELECT.append(m_synonym).append(".Value||'-'||");
sqlSELECT.append(m_synonym).append(".").append(display);
sqlSELECT.append(" AS ").append(m_synonym).append(display).append(",")
.append(lookupSQL).append(" AS ").append(ColumnName).append(","); .append(lookupSQL).append(" AS ").append(ColumnName).append(",");
groupByColumns.add(m_synonym+display); groupByColumns.add(m_synonym+display);
groupByColumns.add(lookupSQL); groupByColumns.add(lookupSQL);
orderName = m_synonym + display;
// => x JOIN table A ON (x.KeyColumn=A.Key)
if (IsMandatory)
sqlFROM.append(" INNER JOIN ");
else
sqlFROM.append(" LEFT OUTER JOIN ");
sqlFROM.append(tr.TableName).append(" ").append(m_synonym).append(" ON (")
.append(lookupSQL).append("=")
.append(m_synonym).append(".").append(tr.KeyColumn).append(")");
// //
pdc = new PrintDataColumn(AD_Column_ID, ColumnName, AD_Reference_ID, FieldLength, orderName, isPageBreak); pdc = new PrintDataColumn(AD_Column_ID, ColumnName, AD_Reference_ID, FieldLength, orderName, isPageBreak);
synonymNext(); synonymNext();