📄 infoinvoice.java
字号:
/******************************************************************************
* The contents of this file are subject to the Compiere License Version 1.1
* ("License"); You may not use this file except in compliance with the License
* You may obtain a copy of the License at http://www.compiere.org/license.html
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
* the specific language governing rights and limitations under the License.
* The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
* are Copyright (C) 1999-2005 Jorg Janke.
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
* Contributor(s): ______________________________________.
*****************************************************************************/
package org.compiere.apps.search;
import java.awt.*;
import java.math.*;
import java.sql.*;
import java.util.*;
import org.compiere.apps.*;
import org.compiere.grid.ed.*;
import org.compiere.minigrid.*;
import org.compiere.model.*;
import org.compiere.plaf.*;
import org.compiere.swing.*;
import org.compiere.util.*;
/**
* Info Invoice
*
* @author Jorg Janke
* @version $Id: InfoInvoice.java,v 1.37 2005/12/09 05:17:54 jjanke Exp $
*/
public class InfoInvoice extends Info
{
/**
* Detail Protected Contructor
*
* @param frame parent frame
* @param modal modal
* @param WindowNo window no
* @param value query value
* @param multiSelection multiple selections
* @param whereClause where clause
*/
protected InfoInvoice(Frame frame, boolean modal, int WindowNo, String value,
boolean multiSelection, String whereClause)
{
super (frame, modal, WindowNo, "i", "C_Invoice_ID", multiSelection, whereClause);
setTitle(Msg.getMsg(Env.getCtx(), "InfoInvoice"));
//
try
{
statInit();
p_loadedOK = initInfo ();
}
catch (Exception e)
{
return;
}
//
int no = p_table.getRowCount();
setStatusLine(Integer.toString(no) + " " + Msg.getMsg(Env.getCtx(), "SearchRows_EnterQuery"), false);
setStatusDB(Integer.toString(no));
if (value != null && value.length() > 0)
{
fDocumentNo.setValue(value);
executeQuery();
}
//
pack();
// Focus
fDocumentNo.requestFocus();
} // InfoInvoice
/** String Array of Column Info */
private Info_Column[] m_generalLayout;
/** list of query columns */
private ArrayList m_queryColumns = new ArrayList();
/** Table Name */
private String m_tableName;
/** Key Column Name */
private String m_keyColumn;
// Static Info
private CLabel lDocumentNo = new CLabel(Msg.translate(Env.getCtx(), "DocumentNo"));
private CTextField fDocumentNo = new CTextField(10);
private CLabel lDescription = new CLabel(Msg.translate(Env.getCtx(), "Description"));
private CTextField fDescription = new CTextField(10);
// private CLabel lPOReference = new CLabel(Msg.translate(Env.getCtx(), "POReference"));
// private CTextField fPOReference = new CTextField(10);
//
// private CLabel lOrg_ID = new CLabel(Msg.translate(Env.getCtx(), "AD_Org_ID"));
// private VLookup fOrg_ID;
private CLabel lBPartner_ID = new CLabel(Msg.translate(Env.getCtx(), "BPartner"));
private VLookup fBPartner_ID;
private CLabel lOrder_ID = new CLabel(Msg.translate(Env.getCtx(), "C_Order_ID"));
private VLookup fOrder_ID;
private VCheckBox fIsPaid = new VCheckBox ("IsPaid", false, false, true, Msg.translate(Env.getCtx(), "IsPaid"), "", false);
private VCheckBox fIsSOTrx = new VCheckBox ("IsSOTrx", false, false, true, Msg.translate(Env.getCtx(), "IsSOTrx"), "", false);
//
private CLabel lDateFrom = new CLabel(Msg.translate(Env.getCtx(), "DateInvoiced"));
private VDate fDateFrom = new VDate("DateFrom", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateFrom"));
private CLabel lDateTo = new CLabel("-");
private VDate fDateTo = new VDate("DateTo", false, false, true, DisplayType.Date, Msg.translate(Env.getCtx(), "DateTo"));
private CLabel lAmtFrom = new CLabel(Msg.translate(Env.getCtx(), "GrandTotal"));
private VNumber fAmtFrom = new VNumber("AmtFrom", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtFrom"));
private CLabel lAmtTo = new CLabel("-");
private VNumber fAmtTo = new VNumber("AmtTo", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "AmtTo"));
/** Array of Column Info */
private static final Info_Column[] s_invoiceLayout = {
new Info_Column(" ", "i.C_Invoice_ID", IDColumn.class),
new Info_Column(Msg.translate(Env.getCtx(), "C_BPartner_ID"), "(SELECT Name FROM C_BPartner bp WHERE bp.C_BPartner_ID=i.C_BPartner_ID)", String.class),
new Info_Column(Msg.translate(Env.getCtx(), "DateInvoiced"), "i.DateInvoiced", Timestamp.class),
new Info_Column(Msg.translate(Env.getCtx(), "DocumentNo"), "i.DocumentNo", String.class),
new Info_Column(Msg.translate(Env.getCtx(), "C_Currency_ID"), "(SELECT ISO_Code FROM C_Currency c WHERE c.C_Currency_ID=i.C_Currency_ID)", String.class),
new Info_Column(Msg.translate(Env.getCtx(), "GrandTotal"), "i.GrandTotal", BigDecimal.class),
new Info_Column(Msg.translate(Env.getCtx(), "ConvertedAmount"), "currencyBase(i.GrandTotal, i.C_Currency_ID, i.DateAcct, i.AD_Client_ID, i.AD_Org_ID)", BigDecimal.class),
new Info_Column(Msg.translate(Env.getCtx(), "OpenAmt"), "invoiceOpen(C_Invoice_ID,C_InvoicePaySchedule_ID)", BigDecimal.class, true, true, null),
new Info_Column(Msg.translate(Env.getCtx(), "IsPaid"), "i.IsPaid", Boolean.class),
new Info_Column(Msg.translate(Env.getCtx(), "IsSOTrx"), "i.IsSOTrx", Boolean.class),
new Info_Column(Msg.translate(Env.getCtx(), "Description"), "i.Description", String.class),
new Info_Column(Msg.translate(Env.getCtx(), "POReference"), "i.POReference", String.class),
new Info_Column("", "''", KeyNamePair.class, "i.C_InvoicePaySchedule_ID")
};
private static int INDEX_PAYSCHEDULE = s_invoiceLayout.length - 1; // last item
/**
* Static Setup - add fields to parameterPanel
* @throws Exception
*/
private void statInit() throws Exception
{
lDocumentNo.setLabelFor(fDocumentNo);
fDocumentNo.setBackground(CompierePLAF.getInfoBackground());
fDocumentNo.addActionListener(this);
lDescription.setLabelFor(fDescription);
fDescription.setBackground(CompierePLAF.getInfoBackground());
fDescription.addActionListener(this);
// lPOReference.setLabelFor(lPOReference);
// fPOReference.setBackground(CompierePLAF.getInfoBackground());
// fPOReference.addActionListener(this);
fIsPaid.setSelected(false);
fIsPaid.addActionListener(this);
fIsSOTrx.setSelected(!"N".equals(Env.getContext(Env.getCtx(), p_WindowNo, "IsSOTrx")));
fIsSOTrx.addActionListener(this);
//
// fOrg_ID = new VLookup("AD_Org_ID", false, false, true,
// MLookupFactory.create(Env.getCtx(), 3486, m_WindowNo, DisplayType.TableDir, false),
// DisplayType.TableDir, m_WindowNo);
// lOrg_ID.setLabelFor(fOrg_ID);
// fOrg_ID.setBackground(CompierePLAF.getInfoBackground());
// C_Invoice.C_BPartner_ID
fBPartner_ID = new VLookup("C_BPartner_ID", false, false, true,
MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 3499, DisplayType.Search));
lBPartner_ID.setLabelFor(fBPartner_ID);
fBPartner_ID.setBackground(CompierePLAF.getInfoBackground());
// C_Invoice.C_Order_ID
fOrder_ID = new VLookup("C_Order_ID", false, false, true,
MLookupFactory.get (Env.getCtx(), p_WindowNo, 0, 4247, DisplayType.Search));
lOrder_ID.setLabelFor(fOrder_ID);
fOrder_ID.setBackground(CompierePLAF.getInfoBackground());
//
lDateFrom.setLabelFor(fDateFrom);
fDateFrom.setBackground(CompierePLAF.getInfoBackground());
fDateFrom.setToolTipText(Msg.translate(Env.getCtx(), "DateFrom"));
lDateTo.setLabelFor(fDateTo);
fDateTo.setBackground(CompierePLAF.getInfoBackground());
fDateTo.setToolTipText(Msg.translate(Env.getCtx(), "DateTo"));
lAmtFrom.setLabelFor(fAmtFrom);
fAmtFrom.setBackground(CompierePLAF.getInfoBackground());
fAmtFrom.setToolTipText(Msg.translate(Env.getCtx(), "AmtFrom"));
lAmtTo.setLabelFor(fAmtTo);
fAmtTo.setBackground(CompierePLAF.getInfoBackground());
fAmtTo.setToolTipText(Msg.translate(Env.getCtx(), "AmtTo"));
//
parameterPanel.setLayout(new ALayout());
// First Row
parameterPanel.add(lDocumentNo, new ALayoutConstraint(0,0));
parameterPanel.add(fDocumentNo, null);
parameterPanel.add(lBPartner_ID, null);
parameterPanel.add(fBPartner_ID, null);
parameterPanel.add(fIsSOTrx, new ALayoutConstraint(0,5));
parameterPanel.add(fIsPaid, null);
// 2nd Row
parameterPanel.add(lDescription, new ALayoutConstraint(1,0));
parameterPanel.add(fDescription, null);
parameterPanel.add(lDateFrom, null);
parameterPanel.add(fDateFrom, null);
parameterPanel.add(lDateTo, null);
parameterPanel.add(fDateTo, null);
// 3rd Row
parameterPanel.add(lOrder_ID, new ALayoutConstraint(2,0));
parameterPanel.add(fOrder_ID, null);
parameterPanel.add(lAmtFrom, null);
parameterPanel.add(fAmtFrom, null);
parameterPanel.add(lAmtTo, null);
parameterPanel.add(fAmtTo, null);
// parameterPanel.add(lOrg_ID, null);
// parameterPanel.add(fOrg_ID, null);
} // statInit
/**
* General Init
* @return true, if success
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -