use of org.compiere.model.MLookup in project adempiere by adempiere.
the class VCreateFromRMAUI method initBPartner.
// vetoableChange
/**************************************************************************
* Load BPartner Field
* @param forInvoice true if Invoices are to be created, false receipts
* @throws Exception if Lookups cannot be initialized
*/
protected void initBPartner(boolean forInvoice) throws Exception {
// load BPartner
// C_Invoice.C_BPartner_ID
int AD_Column_ID = 3499;
MLookup lookup = MLookupFactory.get(Env.getCtx(), p_WindowNo, 0, AD_Column_ID, DisplayType.Search);
bPartnerField = new VLookup("C_BPartner_ID", true, false, true, lookup);
//
int C_BPartner_ID = getC_BPartner_ID();
bPartnerField.setValue(new Integer(C_BPartner_ID));
}
use of org.compiere.model.MLookup 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.MLookup in project adempiere by adempiere.
the class WInvoiceGen method dynInit.
// jbInit
/**
* Fill Picks.
* Column_ID from C_Order
* @throws Exception if Lookups cannot be initialized
*/
public void dynInit() throws Exception {
MLookup orgL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2163, DisplayType.TableDir);
fOrg = new WTableDirEditor("AD_Org_ID", false, false, true, orgL);
// lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
fOrg.addValueChangeListener(this);
//
MLookup bpL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2762, DisplayType.Search);
fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
// lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
fBPartner.addValueChangeListener(this);
// Document Action Prepared/ Completed
lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction"));
MLookup docActionL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 3495, /* C_Invoice.DocAction */
DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135, /* _Document Action */
false, "AD_Ref_List.Value IN ('CO','PR')");
docAction = new WTableDirEditor("DocAction", true, false, true, docActionL);
docAction.setValue(DocAction.ACTION_Complete);
docAction.addValueChangeListener(this);
// Document Type Sales Order/Vendor RMA
lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order")));
cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "CustomerRMA")));
cmbDocType.addActionListener(this);
cmbDocType.setSelectedIndex(0);
//@@
form.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));
}
use of org.compiere.model.MLookup in project adempiere by adempiere.
the class WDelete method dynInit.
public void dynInit() throws Exception {
// Client Pick
String sql = "SELECT AD_Client_ID, Name FROM AD_Client WHERE AD_Client_ID <> 0";
clientPick = new Combobox();
PreparedStatement pstmt1 = DB.prepareStatement(sql, null);
ResultSet rs1 = null;
String clientName = null;
Integer clientID = null;
try {
rs1 = pstmt1.executeQuery();
while (rs1.next()) {
clientID = new Integer(rs1.getInt(1));
clientName = new String(rs1.getString(2));
clientPick.appendItem(clientName, clientID);
clientMap.put(clientName, clientID);
}
} catch (SQLException e) {
System.out.println(e);
} finally {
DB.close(rs1);
DB.close(pstmt1);
}
// Table Pick
MLookup lookupTable = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, ad_table_id, DisplayType.TableDir);
tablePick = new WTableDirEditor("AD_Table_ID", true, false, true, lookupTable);
tablePick.setValue(new Integer((Integer) Env.getContextAsInt(Env.getCtx(), "$AD_Table_ID")));
tablePick.addValueChangeListener(this);
}
use of org.compiere.model.MLookup in project adempiere by adempiere.
the class WInOutGen method dynInit.
// jbInit
/**
* Fill Picks.
* Column_ID from C_Order
* @throws Exception if Lookups cannot be initialized
*/
public void dynInit() throws Exception {
// C_OrderLine.M_Warehouse_ID
MLookup orgL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2223, DisplayType.TableDir);
fWarehouse = new WTableDirEditor("M_Warehouse_ID", true, false, true, orgL);
lWarehouse.setText(Msg.translate(Env.getCtx(), "M_Warehouse_ID"));
fWarehouse.addValueChangeListener(this);
fWarehouse.setValue(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"));
setM_Warehouse_ID(fWarehouse.getValue());
// Document Action Prepared/ Completed
lDocAction.setText(Msg.translate(Env.getCtx(), "DocAction"));
MLookup docActionL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 4324, /* M_InOut.DocAction */
DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135, /* _Document Action */
false, "AD_Ref_List.Value IN ('CO','PR')");
docAction = new WTableDirEditor("DocAction", true, false, true, docActionL);
docAction.setValue(DocAction.ACTION_Complete);
docAction.addValueChangeListener(this);
// C_Order.C_BPartner_ID
MLookup bpL = MLookupFactory.get(Env.getCtx(), form.getWindowNo(), 0, 2762, DisplayType.Search);
fBPartner = new WSearchEditor("C_BPartner_ID", false, false, true, bpL);
lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
fBPartner.addValueChangeListener(this);
//Document Type Sales Order/Vendor RMA
lDocType.setText(Msg.translate(Env.getCtx(), "C_DocType_ID"));
cmbDocType.addItem(new KeyNamePair(MOrder.Table_ID, Msg.translate(Env.getCtx(), "Order")));
cmbDocType.addItem(new KeyNamePair(MRMA.Table_ID, Msg.translate(Env.getCtx(), "VendorRMA")));
cmbDocType.addActionListener(this);
cmbDocType.setSelectedIndex(0);
//@@
form.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InOutGenerateSel"));
}
Aggregations