use of org.compiere.model.MLookupInfo in project adempiere by adempiere.
the class WGraph method loadData.
private void loadData() {
list = builder.loadData();
if (m_renderChart && m_chartSelection) {
Toolbar toolbar = new Toolbar();
panel.appendChild(toolbar);
int AD_Reference_Value_ID = DB.getSQLValue(null, "SELECT AD_Reference_ID FROM AD_Reference WHERE Name = ?", "PA_Goal ChartType");
MLookupInfo info = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), AD_Reference_Value_ID);
MLookup mLookup = new MLookup(info, 0);
WTableDirEditor editor = new WTableDirEditor("ChartType", false, false, true, mLookup);
toolbar.appendChild(editor.getComponent());
editor.addValueChangeListener(new ValueChangeListener() {
public void valueChange(ValueChangeEvent evt) {
Object value = evt.getNewValue();
if (value == null || value.toString().trim().length() == 0)
return;
JFreeChart chart = null;
chart = builder.createChart(value.toString());
if (chart != null)
render(chart);
}
});
}
}
use of org.compiere.model.MLookupInfo in project adempiere by adempiere.
the class HRPayPrint method loadPaymentRule.
// loadPaySelectInfo
/**
* Bank changed - load PaymentRule
*/
public ArrayList<ValueNamePair> loadPaymentRule(int C_PaySelection_ID) {
ArrayList<ValueNamePair> data = new ArrayList<ValueNamePair>();
// load PaymentRule for Bank
// MLookupInfo.getAD_Reference_ID("All_Payment Rule");
int AD_Reference_ID = 195;
Language language = Language.getLanguage(Env.getAD_Language(Env.getCtx()));
MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
String sql = info.Query.substring(0, info.Query.indexOf(" ORDER BY")) + " AND " + info.KeyColumn + " IN (SELECT PaymentRule FROM HR_PaySelectionCheck WHERE HR_PaySelection_ID=?) " + info.Query.substring(info.Query.indexOf(" ORDER BY"));
try {
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, C_PaySelection_ID);
ResultSet rs = pstmt.executeQuery();
//
while (rs.next()) {
ValueNamePair pp = new ValueNamePair(rs.getString(2), rs.getString(3));
data.add(pp);
}
rs.close();
pstmt.close();
} catch (SQLException e) {
log.log(Level.SEVERE, sql, e);
}
if (data.size() == 0)
log.config("PaySel=" + C_PaySelection_ID + ", BAcct=" + m_C_BankAccount_ID + " - " + sql);
return data;
}
use of org.compiere.model.MLookupInfo in project adempiere by adempiere.
the class PayPrint method loadPaymentRule.
// loadPaySelectInfo
/**
* Bank changed - load PaymentRule
*/
public ArrayList<ValueNamePair> loadPaymentRule(int paySelectionId) {
ArrayList<ValueNamePair> data = new ArrayList<ValueNamePair>();
// load PaymentRule for Bank
// MLookupInfo.getAD_Reference_ID("All_Payment Rule");
int AD_Reference_ID = 195;
Language language = Language.getLanguage(Env.getAD_Language(Env.getCtx()));
MLookupInfo info = MLookupFactory.getLookup_List(language, AD_Reference_ID);
String sql = info.Query.substring(0, info.Query.indexOf(" ORDER BY")) + " AND " + info.KeyColumn + " IN (SELECT PaymentRule FROM C_PaySelectionCheck WHERE C_PaySelection_ID=?) " + info.Query.substring(info.Query.indexOf(" ORDER BY"));
try {
PreparedStatement pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, paySelectionId);
ResultSet rs = pstmt.executeQuery();
//
while (rs.next()) {
ValueNamePair pp = new ValueNamePair(rs.getString(2), rs.getString(3));
data.add(pp);
}
rs.close();
pstmt.close();
} catch (SQLException e) {
log.log(Level.SEVERE, sql, e);
}
if (data.size() == 0)
log.config("PaySel=" + paySelectionId + ", BAcct=" + bankAccountId + " - " + sql);
return data;
}
use of org.compiere.model.MLookupInfo in project adempiere by adempiere.
the class WPayPrint method dynInit.
// VPayPrint
/**
* Dynamic Init
*/
private void dynInit() {
// C_PaySelection_ID
// C_PaySelectionCheck.C_PaySelection_ID
int AD_Column_ID = 7670;
// FR [ 297 ]
// Add DocStatus for validation
MLookupInfo info = MLookupFactory.getLookupInfo(Env.getCtx(), windowNo, AD_Column_ID, DisplayType.Search);
info.ValidationCode = "C_PaySelection.DocStatus IN('CO', 'CL') AND C_PaySelection.C_BankAccount_ID IS NOT NULL";
MLookup lookupPS = new MLookup(info, 0);
paySelectSearch = new WSearchEditor("C_PaySelection_ID", true, false, true, lookupPS);
paySelectSearch.addValueChangeListener(this);
}
use of org.compiere.model.MLookupInfo in project adempiere by adempiere.
the class Graph method loadData.
private void loadData() {
list = builder.loadData();
JFreeChart chart = builder.createChart(builder.getMGoal().getChartType());
if (chartPanel != null)
remove(chartPanel);
chartPanel = new ChartPanel(chart);
chartPanel.setSize(getSize());
chartPanel.addChartMouseListener(this);
add(chartPanel, BorderLayout.CENTER);
if (m_userSelection) {
int AD_Reference_Value_ID = DB.getSQLValue(null, "SELECT AD_Reference_ID FROM AD_Reference WHERE Name = ?", "PA_Goal ChartType");
MLookupInfo info = MLookupFactory.getLookup_List(Env.getLanguage(Env.getCtx()), AD_Reference_Value_ID);
MLookup mLookup = new MLookup(info, 0);
VLookup lookup = new VLookup("ChartType", false, false, true, mLookup);
lookup.addVetoableChangeListener(new VetoableChangeListener() {
public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
Object value = evt.getNewValue();
if (value == null)
return;
JFreeChart chart = null;
chart = builder.createChart(value.toString());
if (chart != null) {
if (chartPanel != null)
remove(chartPanel);
chartPanel = new ChartPanel(chart);
chartPanel.setSize(getSize());
chartPanel.addChartMouseListener(Graph.this);
add(chartPanel, BorderLayout.CENTER);
getParent().validate();
}
}
});
add(lookup, BorderLayout.NORTH);
}
this.setMinimumSize(paneldimension);
}
Aggregations