Search in sources :

Example 36 with VLookup

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

the class VInvoiceGen 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(), m_WindowNo, 0, 2163, DisplayType.TableDir);
    fOrg = new VLookup("AD_Org_ID", false, false, true, orgL);
    //	lOrg.setText(Msg.translate(Env.getCtx(), "AD_Org_ID"));
    fOrg.addVetoableChangeListener(this);
    MLookup docActionL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 3494, /* C_Invoice.DocStatus */
    DisplayType.List, Env.getLanguage(Env.getCtx()), "DocAction", 135, /* _Document Action */
    false, "AD_Ref_List.Value IN ('CO','PR')");
    docAction = new VLookup("DocAction", true, false, true, docActionL);
    //  lDcoACtion.setText((Msg.translate(Env.getCtx(), "DocAction")););
    docAction.addVetoableChangeListener(this);
    //@Trifon - Pre-select "Prepare"
    docAction.setValue("PR");
    //
    MLookup bpL = MLookupFactory.get(Env.getCtx(), m_WindowNo, 0, 2762, DisplayType.Search);
    fBPartner = new VLookup("C_BPartner_ID", false, false, true, bpL);
    //	lBPartner.setText(Msg.translate(Env.getCtx(), "C_BPartner_ID"));
    fBPartner.addVetoableChangeListener(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);
    //@@
    panel.getStatusBar().setStatusLine(Msg.getMsg(Env.getCtx(), "InvGenerateSel"));
}
Also used : MLookup(org.compiere.model.MLookup) VLookup(org.compiere.grid.ed.VLookup) KeyNamePair(org.compiere.util.KeyNamePair)

Example 37 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 38 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 39 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 40 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)

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