use of org.compiere.model.MLocatorLookup in project adempiere by adempiere.
the class WStocktake method dynParameter.
// jbInit
/**
* Initialize Parameter fields
* @throws Exception if Lookups cannot be initialized
*/
private void dynParameter() throws Exception {
Properties ctx = Env.getCtx();
// Physical Inventory
String vcode = "M_Inventory.IsStocktake='Y' ";
MLookup inventoryLookup = MLookupFactory.get(ctx, m_WindowNo, 3563, DisplayType.TableDir, Env.getLanguage(Env.getCtx()), "M_Inventory_ID", 53249, true, vcode);
inventoryField = new WTableDirEditor("M_Inventory_ID", false, false, true, inventoryLookup);
// Locator
MLocatorLookup locatorLookup = new MLocatorLookup(ctx, m_WindowNo);
locatorField = new WLocatorEditor("M_Locator_ID", false, false, true, locatorLookup, m_WindowNo);
// locatorField.addVetoableChangeListener(this);
// Product
MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, 3668, DisplayType.Search);
productField = new WSearchEditor("M_Product_ID", false, false, true, productLookup);
productField.addValueChangeListener(this);
// Aisle(X)
MLookup aislexLookup = MLookupFactory.get(ctx, m_WindowNo, 1399, DisplayType.Table, Env.getLanguage(Env.getCtx()), "X", 53562, false, null);
aislexField = new WTableDirEditor("X", false, false, true, aislexLookup);
// Dates
lineFField = new WNumberEditor();
lineTField = new WNumberEditor();
//
confirmPanel.addActionListener(this);
statusBar.setStatusLine("");
}
use of org.compiere.model.MLocatorLookup in project adempiere by adempiere.
the class WOrderReceiptIssue method fillPicks.
// init
/**
* Fill Picks
* Column_ID from C_Order
* This is only run as part of the windows initialization process
* @throws Exception if Lookups cannot be initialized
*/
private void fillPicks() throws Exception {
Properties ctx = Env.getCtx();
// Base Language
Language language = Language.getLoginLanguage();
MLookup orderLookup = MLookupFactory.get(ctx, m_WindowNo, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_PP_Order_ID), DisplayType.Search, language, "PP_Order_ID", 0, false, "PP_Order.DocStatus = '" + MPPOrder.DOCACTION_Complete + "'");
orderField = new WSearchEditor(MPPOrder.COLUMNNAME_PP_Order_ID, false, false, true, orderLookup);
orderField.addValueChangeListener(this);
MLookup resourceLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_S_Resource_ID), DisplayType.TableDir);
resourceField = new WSearchEditor(MPPOrder.COLUMNNAME_S_Resource_ID, false, false, false, resourceLookup);
MLookup warehouseLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir);
warehouseField = new WSearchEditor(MPPOrder.COLUMNNAME_M_Warehouse_ID, false, false, false, warehouseLookup);
MLookup productLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Product_ID), DisplayType.TableDir);
productField = new WSearchEditor(MPPOrder.COLUMNNAME_M_Product_ID, false, false, false, productLookup);
MLookup uomLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
uomField = new WSearchEditor(MPPOrder.COLUMNNAME_C_UOM_ID, false, false, false, uomLookup);
MLookup uomOrderLookup = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
uomorderField = new WSearchEditor(MPPOrder.COLUMNNAME_C_UOM_ID, false, false, false, uomOrderLookup);
MLocatorLookup locatorL = new MLocatorLookup(ctx, m_WindowNo);
locatorField = new WLocatorEditor(MLocator.COLUMNNAME_M_Locator_ID, true, false, true, locatorL, m_WindowNo);
// Tab, Window
int m_Window = MWindow.getWindow_ID("Manufacturing Order");
GridFieldVO vo = GridFieldVO.createStdField(ctx, m_WindowNo, 0, m_Window, MTab.getTab_ID(m_Window, "Manufacturing Order"), false, false, false);
vo.AD_Column_ID = MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID);
vo.ColumnName = MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID;
vo.displayType = DisplayType.PAttribute;
GridField field = new GridField(vo);
// M_AttributeSetInstance_ID
attribute = new WPAttributeEditor(field.getGridTab(), field);
attribute.setReadWrite(true);
attribute.setValue(0);
// 4Layers - Further init
scrapQtyField.setValue(Env.ZERO);
rejectQty.setValue(Env.ZERO);
// 4Layers - end
pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@IsBackflush@"), 1);
pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@OnlyIssue@"), 2);
pickcombo.appendItem(Msg.parseTranslation(Env.getCtx(), "@OnlyReceiptProduct@"), 3);
pickcombo.addEventListener(Events.ON_CHANGE, this);
Process.addActionListener(this);
toDeliverQty.addValueChangeListener(this);
scrapQtyField.addValueChangeListener(this);
}
use of org.compiere.model.MLocatorLookup in project adempiere by adempiere.
the class WExpressReceiptScanBarUI method createProductPanel.
/**
* Creates the New Charge panel.
*
* The New Charge panel is used to specify the name and key of an account
* and whether or not the account is a charge account.
*/
private void createProductPanel() {
// load Locator
locatorLabel.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID"));
locatorLabel.setMandatory(true);
MLocatorLookup locator = new MLocatorLookup(Env.getCtx(), form.getWindowNo());
locator.setOnly_Warehouse_ID(getDefaultWarehouseId());
locatorField = new WLocatorEditor("M_Locator_ID", true, false, true, locator, form.getWindowNo());
locatorField.setMandatory(true);
locatorField.setValue(Env.getContextAsInt(Env.getCtx(), form.getWindowNo(), "M_Locator_ID"));
locatorField.addValueChangeListener(this);
upcLabel.setText(Msg.getElement(Env.getCtx(), "Value", false));
upcLabel.setMandatory(true);
upcField = new WStringEditor("UPC", false, false, true, 10, 30, null, null);
upcField.getComponent().addEventListener(Events.ON_CHANGE, this);
qtyCountLabel.setText(Msg.getElement(Env.getCtx(), "QtyCount", false));
qtyCountField.getComponent().addEventListener(Events.ON_CHANGE, this);
lotLabel.setText(Msg.getElement(Env.getCtx(), "Lot", false));
lotField = new WStringEditor("Lot", false, false, true, 10, 30, null, null);
lotField.getComponent().addEventListener(Events.ON_CHANGE, this);
serNoLabel.setText(Msg.getElement(Env.getCtx(), "SerNo", false));
serNoField = new WStringEditor("SerNo", false, false, true, 10, 30, null, null);
serNoField.getComponent().addEventListener(Events.ON_CHANGE, this);
productValueLabel.setValue(Msg.translate(Env.getCtx(), "Value"));
productLabel.setValue(Msg.translate(Env.getCtx(), "Name"));
UOMLabel.setValue(Msg.translate(Env.getCtx(), "C_UOM_ID"));
Rows rows = new Rows();
newGrid.appendChild(rows);
Row row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(locatorLabel);
row.appendChild(locatorField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(upcLabel);
row.appendChild(upcField.getComponent());
row.appendChild(qtyCountLabel);
row.appendChild(qtyCountField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(serNoLabel);
row.appendChild(serNoField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(lotLabel);
row.appendChild(lotField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
//Product Info
productValueField.setReadonly(true);
row = new Row();
rows.appendChild(row);
row.appendChild(productValueLabel);
row.appendChild(productValueField);
productField.setReadonly(true);
row.appendChild(productLabel);
row.appendChild(productField);
UOMField.setReadonly(true);
row.appendChild(UOMLabel);
row.appendChild(UOMField);
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
upcField.setVisible(false);
qtyCountField.setVisible(false);
lotField.setVisible(false);
serNoField.setVisible(false);
return;
}
use of org.compiere.model.MLocatorLookup in project adempiere by adempiere.
the class WScanBarUI method createProductPanel.
/**
* Creates the New Charge panel.
*
* The New Charge panel is used to specify the name and key of an account
* and whether or not the account is a charge account.
*/
private void createProductPanel() {
// load Locator
locatorLabel.setValue(Msg.translate(Env.getCtx(), "M_Locator_ID"));
locatorLabel.setMandatory(true);
MLocatorLookup locator = new MLocatorLookup(Env.getCtx(), form.getWindowNo());
locator.setOnly_Warehouse_ID(Env.getContextAsInt(Env.getCtx(), "#M_Warehouse_ID"));
locatorField = new WLocatorEditor("M_Locator_ID", true, false, true, locator, form.getWindowNo());
locatorField.setMandatory(true);
locatorField.addValueChangeListener(this);
locatorToLabel.setValue(Msg.translate(Env.getCtx(), "M_LocatorTo_ID"));
locatorToLabel.setVisible(false);
MLocatorLookup locatorTo = new MLocatorLookup(Env.getCtx(), form.getWindowNo());
locatorToField = new WLocatorEditor("M_LocatorTo_ID", true, false, true, locatorTo, form.getWindowNo());
//locatorField.setMandatory(true);
locatorToField.addValueChangeListener(this);
locatorToField.setVisible(false);
upcLabel.setText(Msg.getElement(Env.getCtx(), "Value", false));
upcLabel.setMandatory(true);
upcField = new WStringEditor("UPC", false, false, true, 10, 30, null, null);
upcField.getComponent().addEventListener(Events.ON_CHANGE, this);
qtyCountLabel.setText(Msg.getElement(Env.getCtx(), "QtyCount", false));
qtyCountField.getComponent().addEventListener(Events.ON_CHANGE, this);
lotLabel.setText(Msg.getElement(Env.getCtx(), "Lot", false));
lotField = new WStringEditor("Lot", false, false, true, 10, 30, null, null);
lotField.getComponent().addEventListener(Events.ON_CHANGE, this);
serNoLabel.setText(Msg.getElement(Env.getCtx(), "SerNo", false));
serNoField = new WStringEditor("SerNo", false, false, true, 10, 30, null, null);
serNoField.getComponent().addEventListener(Events.ON_CHANGE, this);
productValueLabel.setValue(Msg.translate(Env.getCtx(), "Value"));
productLabel.setValue(Msg.translate(Env.getCtx(), "Name"));
UOMLabel.setValue(Msg.translate(Env.getCtx(), "C_UOM_ID"));
Rows rows = new Rows();
newGrid.appendChild(rows);
Row row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(locatorLabel);
row.appendChild(locatorField.getComponent());
row = new Row();
rows.appendChild(row);
row.appendChild(locatorToLabel);
row.appendChild(locatorToField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(upcLabel);
row.appendChild(upcField.getComponent());
row.appendChild(qtyCountLabel);
row.appendChild(qtyCountField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(serNoLabel);
row.appendChild(serNoField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.appendChild(lotLabel);
row.appendChild(lotField.getComponent());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
//Product Info
productValueField.setReadonly(true);
row = new Row();
rows.appendChild(row);
row.appendChild(productValueLabel);
row.appendChild(productValueField);
productField.setReadonly(true);
row.appendChild(productLabel);
row.appendChild(productField);
UOMField.setReadonly(true);
row.appendChild(UOMLabel);
row.appendChild(UOMField);
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
row = new Row();
rows.appendChild(row);
row.setSpans("3");
row.appendChild(new Separator());
upcField.setVisible(false);
qtyCountField.setVisible(false);
lotField.setVisible(false);
serNoField.setVisible(false);
return;
}
use of org.compiere.model.MLocatorLookup in project adempiere by adempiere.
the class WCreateFromShipmentUI method dynInit.
/**
* Dynamic Init
* @throws Exception if Lookups cannot be initialized
* @return true if initialized
*/
public boolean dynInit() throws Exception {
log.config("");
sameWarehouseCb.setSelected(true);
sameWarehouseCb.addActionListener(this);
// load Locator
MLocatorLookup locator = new MLocatorLookup(Env.getCtx(), p_WindowNo);
locatorField = new WLocatorEditor("M_Locator_ID", true, false, true, locator, p_WindowNo);
initBPartner(false);
bPartnerField.addValueChangeListener(this);
locatorLabel.setMandatory(true);
upcField = new WStringEditor("UPC", false, false, true, 10, 30, null, null);
upcField.getComponent().addEventListener(Events.ON_CHANGE, this);
return true;
}
Aggregations