Search in sources :

Example 31 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VCreateFromInvoiceUI 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(C_BPartner_ID);
    //  initial loading
    initBPOrderDetails(C_BPartner_ID, forInvoice);
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup)

Example 32 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VCollectDetail method loadCreditMemo.

/**
	 * Load for Credit Memo
	 * @return void
	 */
private void loadCreditMemo() {
    creditMemoPanel = new CPanel(layout);
    //	Add label credit note
    labelCreditMemo = new CLabel(Msg.translate(Env.getCtx(), "CreditMemo") + ":");
    labelCreditMemo.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    //	For Credit Memo
    MLookup cardNotelookup = getCreditMemoLockup(parentCollect.getC_BPartner_ID());
    fieldCreditMemo = new VLookup("CreditMemo", false, false, true, cardNotelookup);
    //	For Credit Memo Type
    //		((VComboBox)fieldCreditMemo.getCombo()).setRenderer(new POSLookupListCellRenderer(font));
    fieldCreditMemo.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    //		((VComboBox)fieldCreditMemo.getCombo()).setFont(font);
    fieldCreditMemo.addVetoableChangeListener(this);
    //	Add to Panel
    creditMemoPanel.add(labelCreditMemo, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    creditMemoPanel.add(fieldCreditMemo, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    //	Default visible false
    creditMemoPanel.setVisible(false);
}
Also used : CLabel(org.compiere.swing.CLabel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) MLookup(org.compiere.model.MLookup) CPanel(org.compiere.swing.CPanel) VLookup(org.compiere.grid.ed.VLookup) Dimension(java.awt.Dimension)

Example 33 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VCollectDetail method loadStandardPanel.

/**
	 * Load Standard Fields for Collect
	 * @return void
	 */
private void loadStandardPanel() {
    standardPanel = new CPanel(layout);
    //	For Tender Type
    //  C_Payment_v.TenderType
    int columnId = 8416;
    MLookup lookup = MLookupFactory.get(Env.getCtx(), 0, 0, columnId, DisplayType.List);
    fieldTenderType = new VLookup("TenderType", true, false, true, lookup);
    ((VComboBox) fieldTenderType.getCombo()).setRenderer(new POSLookupListCellRenderer(font));
    fieldTenderType.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    ((VComboBox) fieldTenderType.getCombo()).setFont(font);
    fieldTenderType.addVetoableChangeListener(this);
    //	For Amount
    fieldPayAmt = new VNumber("PayAmt", true, false, true, DisplayType.Amount, "");
    fieldPayAmt.setPreferredSize(new Dimension(FIELD_WIDTH, FIELD_HEIGHT));
    fieldPayAmt.setFont(font);
    fieldPayAmt.setValue(Env.ZERO);
    fieldPayAmt.addVetoableChangeListener(this);
    fieldPayAmt.addKeyListener(this);
    //	Button
    AppsAction action = new AppsAction("Minus", KeyStroke.getKeyStroke(KeyEvent.VK_F2, Event.F2), false);
    action.setDelegate(this);
    buttonMinus = (CButton) action.getButton();
    buttonMinus.setPreferredSize(new Dimension(FIELD_HEIGHT, FIELD_HEIGHT));
    buttonMinus.setFocusable(false);
    //	Add Tender Type
    standardPanel.add(fieldTenderType, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
    standardPanel.add(fieldPayAmt, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NORTH, new Insets(2, 0, 2, 2), 0, 0));
}
Also used : AppsAction(org.compiere.apps.AppsAction) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) MLookup(org.compiere.model.MLookup) CPanel(org.compiere.swing.CPanel) VLookup(org.compiere.grid.ed.VLookup) VNumber(org.compiere.grid.ed.VNumber) VComboBox(org.compiere.grid.ed.VComboBox) Dimension(java.awt.Dimension)

Example 34 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VOrderDistributionReceipt method fillPicks.

//	jbInit
/**
	 *	Fill Picks.
	 *		Column_ID from C_Order
	 *  @throws Exception if Lookups cannot be initialized
	 */
private void fillPicks() throws Exception {
    Language language = Language.getLoginLanguage();
    MLookup orderL = MLookupFactory.get(Env.getCtx(), m_WindowNo, MColumn.getColumn_ID(MDDOrder.Table_Name, MDDOrder.COLUMNNAME_DD_Order_ID), DisplayType.Search, language, MDDOrder.COLUMNNAME_DD_Order_ID, 0, false, "DocStatus='CO' AND IsInTransit='Y'");
    fOrder = new VLookup(MDDOrder.COLUMNNAME_DD_Order_ID, true, false, true, orderL);
    lOrder.setText(Msg.translate(Env.getCtx(), MDDOrder.COLUMNNAME_DD_Order_ID));
    fOrder.addVetoableChangeListener(this);
    Timestamp today = new Timestamp(System.currentTimeMillis());
    m_MovementDate = today;
    fMovementDate.setValue(today);
    fMovementDate.addVetoableChangeListener(this);
}
Also used : Language(org.compiere.util.Language) MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup) Timestamp(java.sql.Timestamp)

Example 35 with VLookup

use of org.compiere.grid.ed.VLookup in project adempiere by adempiere.

the class VOrderReceiptIssue 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 orderL = 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 VLookup("PP_Order_ID", false, false, true, orderL);
    orderField.setBackground(AdempierePLAF.getInfoBackground());
    orderField.addVetoableChangeListener(this);
    MLookup resourceL = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_S_Resource_ID), DisplayType.TableDir);
    resourceField = new VLookup("S_Resource_ID", false, false, false, resourceL);
    MLookup warehouseL = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Warehouse_ID), DisplayType.TableDir);
    warehouseField = new VLookup("M_Warehouse_ID", false, false, false, warehouseL);
    MLookup productL = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_Product_ID), DisplayType.TableDir);
    productField = new VLookup("M_Product_ID", false, false, false, productL);
    MLookup uomL = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
    uomField = new VLookup("C_UOM_ID", false, false, false, uomL);
    MLookup uomorderL = MLookupFactory.get(ctx, m_WindowNo, 0, MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_C_UOM_ID), DisplayType.TableDir);
    uomorderField = new VLookup("C_UOM_ID", false, false, false, uomorderL);
    MLocatorLookup locatorL = new MLocatorLookup(ctx, m_WindowNo);
    locatorField = new VLocator("M_Locator_ID", true, false, true, locatorL, m_WindowNo);
    MPAttributeLookup attributeL = new MPAttributeLookup(ctx, m_WindowNo);
    attribute = new VPAttribute(false, false, true, m_WindowNo, attributeL, false);
    attribute.setValue(0);
    // 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, "Order"), false, false, false);
    // M_AttributeSetInstance_ID
    vo.AD_Column_ID = MColumn.getColumn_ID(MPPOrder.Table_Name, MPPOrder.COLUMNNAME_M_AttributeSetInstance_ID);
    GridField field = new GridField(vo);
    attribute.setField(field);
    // 4Layers - Further init
    scrapQtyField.setValue(Env.ZERO);
    rejectQty.setValue(Env.ZERO);
    // 4Layers - end
    pickcombo.addItem(new KeyNamePair(1, Msg.parseTranslation(Env.getCtx(), "@IsBackflush@")));
    pickcombo.addItem(new KeyNamePair(2, Msg.parseTranslation(Env.getCtx(), "@OnlyIssue@")));
    pickcombo.addItem(new KeyNamePair(3, Msg.parseTranslation(Env.getCtx(), "@OnlyReceiptProduct@")));
    pickcombo.addActionListener(this);
    Process.addActionListener(this);
    toDeliverQty.addActionListener(this);
    scrapQtyField.addActionListener(this);
}
Also used : MLocatorLookup(org.compiere.model.MLocatorLookup) VPAttribute(org.compiere.grid.ed.VPAttribute) Language(org.compiere.util.Language) GridFieldVO(org.compiere.model.GridFieldVO) MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup) VLocator(org.compiere.grid.ed.VLocator) GridField(org.compiere.model.GridField) KeyNamePair(org.compiere.util.KeyNamePair) Properties(java.util.Properties) MPAttributeLookup(org.compiere.model.MPAttributeLookup)

Aggregations

VLookup (org.compiere.grid.ed.VLookup)44 MLookup (org.compiere.model.MLookup)25 ALayoutConstraint (org.compiere.apps.ALayoutConstraint)10 CPanel (org.compiere.swing.CPanel)9 Dimension (java.awt.Dimension)7 Properties (java.util.Properties)7 ALayout (org.compiere.apps.ALayout)7 Insets (java.awt.Insets)6 VComboBox (org.compiere.grid.ed.VComboBox)6 GridBagConstraints (java.awt.GridBagConstraints)5 KeyNamePair (org.compiere.util.KeyNamePair)5 CTextField (org.compiere.swing.CTextField)4 Language (org.compiere.util.Language)4 VCheckBox (org.compiere.grid.ed.VCheckBox)3 VLocator (org.compiere.grid.ed.VLocator)3 VPAttribute (org.compiere.grid.ed.VPAttribute)3 MLocatorLookup (org.compiere.model.MLocatorLookup)3 CLabel (org.compiere.swing.CLabel)3 BorderLayout (java.awt.BorderLayout)2 PropertyVetoException (java.beans.PropertyVetoException)2