⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mreport.java

📁 Java写的ERP系统
💻 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  and ComPiere, Inc.
 * Portions created by Jorg Janke are Copyright (C) 1999-2003 Jorg Janke, parts
 * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
 * Contributor(s): ______________________________________.
 *****************************************************************************/
package org.compiere.report;

import java.util.*;
import java.sql.*;
import java.math.*;
import java.io.Serializable;

import org.compiere.model.*;
import org.compiere.util.*;


/**
 *  Report Model
 *
 *  @author Jorg Janke
 *  @version $Id: MReport.java,v 1.5 2003/02/15 06:31:15 jjanke Exp $
 */
public class MReport
  extends PO
{
	/**
	 * 	Constructor
	 * 	@param ctx context
	 * 	@param PA_Report_ID id
	 */
	public MReport (Properties ctx, int PA_Report_ID)
	{
		super (ctx, PA_Report_ID);
		if (PA_Report_ID == 0)
		{
			setName (null);
			setPA_ReportLineSet_ID (0);
			setPA_ReportColumnSet_ID (0);
			setListSources(false);
			setListTrx(false);
		}
		else
		{
			m_columnSet = new MReportColumnSet (ctx, getPA_ReportColumnSet_ID());
			m_lineSet = new MReportLineSet (ctx, getPA_ReportLineSet_ID());
		}
	}	//	MReport

	private MReportColumnSet	m_columnSet = null;
	private MReportLineSet		m_lineSet = null;

	/**
	 * 	Initialize
	 * 	@param ctx context
	 * 	@return meta data
	 */
	protected POInfo initPO (Properties ctx)
	{
		int AD_Table_ID = 445;
		POInfo poi = POInfo.getPOInfo (ctx, AD_Table_ID);
		return poi;
	}	//	initPO

	/**
	 * 	List Info
	 */
	public void list()
	{
		System.out.println(toString());
		if (m_columnSet != null)
			m_columnSet.list();
		System.out.println();
		if (m_lineSet != null)
			m_lineSet.list();
	}	//	dump

	/**
	 * 	Get Where Clause for Report
	 * 	@return Where Clause for Report
	 */
	public String getWhereClause()
	{
		//	AD_Client indirectly via AcctSchema
		StringBuffer sb = new StringBuffer();
		//	Mandatory 	AcctSchema
		sb.append("C_AcctSchema_ID=").append(getC_AcctSchema_ID());
		//
		return sb.toString();
	}	//	getWhereClause

	/*************************************************************************/

	/**
	 * 	String Representation
	 * 	@return Info
	 */
	public String toString ()
	{
		StringBuffer sb = new StringBuffer ("MReport[")
			.append(getID()).append(" - ").append(getName());
		if (getDescription() != null)
			sb.append("(").append(getDescription()).append(")");
		sb.append(" - C_AcctSchema_ID=").append(getC_AcctSchema_ID())
			.append(", C_Calendar_ID=").append(getC_Calendar_ID());
		sb.append ("]");
		return sb.toString ();
	}	//	toString


	public boolean save ()
	{
		Log.trace (Log.l4_Data, "MReport.save");
		return super.save ();
	}

	public MReportColumnSet	getColumnSet()
	{
		return m_columnSet;
	}

	public MReportLineSet getLineSet()
	{
		return m_lineSet;
	}

	public void setListSources (boolean ListSources)
	{
		setValue ("ListSources", new Boolean(ListSources));
	}

	public boolean isListSources ()
	{
		Boolean bb = (Boolean)getValue ("ListSources");
		if (bb != null)
			return bb.booleanValue ();
		return false;
	}

	public void setListTrx (boolean ListTrx)
	{
		setValue ("ListTrx", new Boolean(ListTrx));
	}

	public boolean isListTrx ()
	{
		Boolean bb = (Boolean)getValue ("ListTrx");
		if (bb != null)
			return bb.booleanValue ();
		return false;
	}

	public void setAD_PrintFormat_ID (int AD_PrintFormat_ID)
	{
		setValue ("AD_PrintFormat_ID", new Integer (AD_PrintFormat_ID));
	}

	public int getAD_PrintFormat_ID ()
	{
		Integer ii = (Integer)getValue ("AD_PrintFormat_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setName (String Name)
	{
		if (Name == null)
			throw new IllegalArgumentException ("Name is mandatory");
		setValue ("Name", Name);
	}

	public String getName ()
	{
		return (String)getValue ("Name");
	}

	public void setPA_ReportLineSet_ID (int PA_ReportLineSet_ID)
	{
		setValue ("PA_ReportLineSet_ID", new Integer (PA_ReportLineSet_ID));
	}

	public int getPA_ReportLineSet_ID ()
	{
		Integer ii = (Integer)getValue ("PA_ReportLineSet_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setDescription (String Description)
	{
		setValue ("Description", Description);
	}

	public String getDescription ()
	{
		return (String)getValue ("Description");
	}

	public int getPA_Report_ID ()
	{
		return getID();
	}

	public void setPA_ReportColumnSet_ID (int PA_ReportColumnSet_ID)
	{
		setValue ("PA_ReportColumnSet_ID", new Integer (PA_ReportColumnSet_ID));
	}

	public int getPA_ReportColumnSet_ID ()
	{
		Integer ii = (Integer)getValue ("PA_ReportColumnSet_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setC_AcctSchema_ID (int C_AcctSchema_ID)
	{
		setValue ("C_AcctSchema_ID", new Integer (C_AcctSchema_ID));
	}

	public int getC_AcctSchema_ID ()
	{
		Integer ii = (Integer)getValue ("C_AcctSchema_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

	public void setC_Calendar_ID (int C_Calendar_ID)
	{
		setValue ("C_Calendar_ID", new Integer (C_Calendar_ID));
	}

	public int getC_Calendar_ID ()
	{
		Integer ii = (Integer)getValue ("C_Calendar_ID");
		if (ii == null)
			return 0;
		return ii.intValue ();
	}

}	//	MReport

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -