BF [ 1748449 ] Info Account - Posting Type is not translated
http://sourceforge.net/tracker/index.php?func=detail&aid=1748449&group_id=176962&atid=879332
This commit is contained in:
parent
d6a35fc815
commit
d433b9c78e
|
@ -27,6 +27,8 @@ import org.compiere.util.*;
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: MRefList.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $
|
* @version $Id: MRefList.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $
|
||||||
|
*
|
||||||
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1748449 ]
|
||||||
*/
|
*/
|
||||||
public class MRefList extends X_AD_Ref_List
|
public class MRefList extends X_AD_Ref_List
|
||||||
{
|
{
|
||||||
|
@ -137,15 +139,24 @@ public class MRefList extends X_AD_Ref_List
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Reference List
|
* Get Reference List (translated)
|
||||||
* @param AD_Reference_ID reference
|
* @param ctx context
|
||||||
* @param optional if true add "",""
|
* @param AD_Reference_ID reference
|
||||||
* @return List or null
|
* @param optional if true add "",""
|
||||||
|
* @return List or null
|
||||||
*/
|
*/
|
||||||
public static ValueNamePair[] getList (int AD_Reference_ID, boolean optional)
|
public static ValueNamePair[] getList (Properties ctx, int AD_Reference_ID, boolean optional)
|
||||||
{
|
{
|
||||||
String sql = "SELECT Value, Name FROM AD_Ref_List "
|
String ad_language = Env.getAD_Language(ctx);
|
||||||
+ "WHERE AD_Reference_ID=? AND IsActive='Y' ORDER BY 1";
|
boolean isBaseLanguage = Env.isBaseLanguage(ad_language, "AD_Ref_List");
|
||||||
|
String sql = isBaseLanguage ?
|
||||||
|
"SELECT Value, Name FROM AD_Ref_List WHERE AD_Reference_ID=? AND IsActive='Y' ORDER BY Name"
|
||||||
|
:
|
||||||
|
"SELECT r.Value, t.Name FROM AD_Ref_List_Trl t"
|
||||||
|
+ " INNER JOIN AD_Ref_List r ON (r.AD_Ref_List_ID=t.AD_Ref_List_ID)"
|
||||||
|
+ " WHERE r.AD_Reference_ID=? AND t.AD_Language=? AND r.IsActive='Y'"
|
||||||
|
+ " ORDER BY t.Name"
|
||||||
|
;
|
||||||
PreparedStatement pstmt = null;
|
PreparedStatement pstmt = null;
|
||||||
ArrayList<ValueNamePair> list = new ArrayList<ValueNamePair>();
|
ArrayList<ValueNamePair> list = new ArrayList<ValueNamePair>();
|
||||||
if (optional)
|
if (optional)
|
||||||
|
@ -154,6 +165,8 @@ public class MRefList extends X_AD_Ref_List
|
||||||
{
|
{
|
||||||
pstmt = DB.prepareStatement(sql, null);
|
pstmt = DB.prepareStatement(sql, null);
|
||||||
pstmt.setInt(1, AD_Reference_ID);
|
pstmt.setInt(1, AD_Reference_ID);
|
||||||
|
if (!isBaseLanguage)
|
||||||
|
pstmt.setString(2, ad_language);
|
||||||
ResultSet rs = pstmt.executeQuery();
|
ResultSet rs = pstmt.executeQuery();
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
list.add(new ValueNamePair(rs.getString(1), rs.getString(2)));
|
list.add(new ValueNamePair(rs.getString(1), rs.getString(2)));
|
||||||
|
|
|
@ -30,7 +30,9 @@ import org.compiere.util.*;
|
||||||
* Account Viewer State - maintaines State information for the Account Viewer
|
* Account Viewer State - maintaines State information for the Account Viewer
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AcctViewerData.java,v 1.3 2006/08/10 01:00:27 jjanke Exp $
|
* @version $Id: AcctViewerData.java,v 1.3 2006/08/10 01:00:27 jjanke Exp $
|
||||||
|
*
|
||||||
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1748449 ]
|
||||||
*/
|
*/
|
||||||
class AcctViewerData
|
class AcctViewerData
|
||||||
{
|
{
|
||||||
|
@ -149,7 +151,7 @@ class AcctViewerData
|
||||||
protected void fillPostingType (JComboBox cb)
|
protected void fillPostingType (JComboBox cb)
|
||||||
{
|
{
|
||||||
int AD_Reference_ID = 125;
|
int AD_Reference_ID = 125;
|
||||||
ValueNamePair[] pt = MRefList.getList(AD_Reference_ID, true);
|
ValueNamePair[] pt = MRefList.getList(Env.getCtx(), AD_Reference_ID, true);
|
||||||
for (int i = 0; i < pt.length; i++)
|
for (int i = 0; i < pt.length; i++)
|
||||||
cb.addItem(pt[i]);
|
cb.addItem(pt[i]);
|
||||||
} // fillPostingType
|
} // fillPostingType
|
||||||
|
|
|
@ -35,6 +35,8 @@ import org.compiere.wf.*;
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: WFActivity.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
* @version $Id: WFActivity.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
|
||||||
|
*
|
||||||
|
* @author Teo Sarca, SC ARHIPAC SERVICE SRL - BF [ 1748449 ]
|
||||||
*/
|
*/
|
||||||
public class WFActivity extends CPanel
|
public class WFActivity extends CPanel
|
||||||
implements FormPanel, ActionListener
|
implements FormPanel, ActionListener
|
||||||
|
@ -392,13 +394,13 @@ public class WFActivity extends CPanel
|
||||||
int dt = m_column.getAD_Reference_ID();
|
int dt = m_column.getAD_Reference_ID();
|
||||||
if (dt == DisplayType.YesNo)
|
if (dt == DisplayType.YesNo)
|
||||||
{
|
{
|
||||||
ValueNamePair[] values = MRefList.getList(319, false); // _YesNo
|
ValueNamePair[] values = MRefList.getList(Env.getCtx(), 319, false); // _YesNo
|
||||||
fAnswerList.setModel(new DefaultComboBoxModel(values));
|
fAnswerList.setModel(new DefaultComboBoxModel(values));
|
||||||
fAnswerList.setVisible(true);
|
fAnswerList.setVisible(true);
|
||||||
}
|
}
|
||||||
else if (dt == DisplayType.List)
|
else if (dt == DisplayType.List)
|
||||||
{
|
{
|
||||||
ValueNamePair[] values = MRefList.getList(m_column.getAD_Reference_Value_ID(), false);
|
ValueNamePair[] values = MRefList.getList(Env.getCtx(), m_column.getAD_Reference_Value_ID(), false);
|
||||||
fAnswerList.setModel(new DefaultComboBoxModel(values));
|
fAnswerList.setModel(new DefaultComboBoxModel(values));
|
||||||
fAnswerList.setVisible(true);
|
fAnswerList.setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue