package cn.com.countrygarden.bi.main.dto.investment;

import java.math.BigDecimal;

import javax.persistence.Column;

public class InvestRegionExcelSummaryVo {
	private String summaryFlag;

	/**
	 * 资金池（项目收益）合计
	 */
	private BigDecimal incomeCapitalSummary;
	/**
	 * 单独资金账户（项目收益）合计
	 */

	private BigDecimal incomeCapitalAccountSummary;
	/**
	 * 资金池（已发放项目收益)合计
	 */
	private BigDecimal issuedIncomeCapitalSummary;
	/**
	 * 单独资金账户（已发放项目收益）合计
	 */
	private BigDecimal issuedIncomeCapitalAccountSummary;
	/**
	 * 项目总跟投金额（计算：项目跟投情况）合计
	 */
	private BigDecimal projectFollowTotalCapitalSummary;
	/**
	 * 资金池跟投金额（项目跟投情况）合计
	 */
	private BigDecimal projectFollowCapitalSummary;

	/**
	 * 独资金跟投金额（项目跟投情况）合计
	 */
	private BigDecimal projectFollowSingleCapitalSummary;
	/**
	 * 阶段性返还金额（阶段性返还）合计
	 */
	private BigDecimal cashReturnMoneySummary;
	/**
	 * 资金池（阶段性返还）合计
	 */
	private BigDecimal cashReturnCapitalSummary;
	/**
	 * 单独资金账户（阶段性返还）合计
	 */
	private BigDecimal cashReturnCapitalAccountSummary;
	/**
	 * 本金返还金额（本金返还）合计
	 */
	private BigDecimal principalReturnMoneySummary;
	/**
	 * 资金池（本金返还）合计
	 */
	private BigDecimal principalReturnCapitalSummary;
	/**
	 * 单独资金账户（本金返还）合计
	 */
	private BigDecimal principalReturnCapitalAccountSummary;
	/**
	 * 资金池（利润分配）合计
	 */
	private BigDecimal profitDistributionCapitalSummary;
	/**
	 * 单独资金账户（利润分配）合计
	 */
	private BigDecimal profitDistributionCapitalAccountSummary;
	/**
	 * 资金池（本金未收回）合计
	 */
	private BigDecimal principalNotrecoveredCapitalSummary;
	/**
	 * 单独资金账户（本金未收回）合计
	 */
	private BigDecimal principalNotrecoveredCapitalAccountSummary;
	/**
	 * 资金池（理财收益）合计
	 */
	private BigDecimal financialIncomeCapitalSummary;
	/**
	 * 单独资金账户（理财收益）合计
	 */
	private BigDecimal financialIncomeCapitalAccountSummary;

	/**
	 * 区域总募集金额 合计
	 * 
	 */
	private BigDecimal regionAmountRaisedSummary;

	/**
	 * 独资金总募资金额 合计
	 */
	private BigDecimal singleAmountRaisedSummary;
	/**
	 * 区域-资金池（募集资金余额）合计
	 */
	private BigDecimal regionaRaisingBalanceCapitalSummary;
	/**
	 * 区域-单独资金账户（募集资金余额）合计
	 */
	private BigDecimal regionaRaisingBalanceCapitalAccountSummary;

	/**
	 * 区域-资金池（可用资金余额）合计
	 */
	private BigDecimal regionaAailableBalanceCapitalSummary;
	/**
	 * 区域-单独资金账户（可用资金余额）合计
	 */
	private BigDecimal regionaAvailableBalanceCapitalAccountSummary;

	
	public String getSummaryFlag() {
		return summaryFlag;
	}

	public void setSummaryFlag(String summaryFlag) {
		this.summaryFlag = summaryFlag;
	}

	public BigDecimal getRegionAmountRaisedSummary() {
		if(regionAmountRaisedSummary==null) {
			return regionAmountRaisedSummary=new BigDecimal(0);
		}
		return regionAmountRaisedSummary;
	}

	public void setRegionAmountRaisedSummary(BigDecimal regionAmountRaisedSummary) {
		this.regionAmountRaisedSummary = regionAmountRaisedSummary;
	}

	public BigDecimal getSingleAmountRaisedSummary() {
		if(singleAmountRaisedSummary==null) {
			return singleAmountRaisedSummary=new BigDecimal(0);
		}
		return singleAmountRaisedSummary;
	}

	public void setSingleAmountRaisedSummary(BigDecimal singleAmountRaisedSummary) {
		this.singleAmountRaisedSummary = singleAmountRaisedSummary;
	}

	public BigDecimal getIncomeCapitalSummary() {
		if(incomeCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return incomeCapitalSummary;
	}

	public void setIncomeCapitalSummary(BigDecimal incomeCapitalSummary) {
		this.incomeCapitalSummary = incomeCapitalSummary;
	}

	public BigDecimal getIncomeCapitalAccountSummary() {
		if(incomeCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return incomeCapitalAccountSummary;
	}

	public void setIncomeCapitalAccountSummary(BigDecimal incomeCapitalAccountSummary) {
		this.incomeCapitalAccountSummary = incomeCapitalAccountSummary;
	}

	public BigDecimal getIssuedIncomeCapitalSummary() {
		if(issuedIncomeCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return issuedIncomeCapitalSummary;
	}

	public void setIssuedIncomeCapitalSummary(BigDecimal issuedIncomeCapitalSummary) {
		this.issuedIncomeCapitalSummary = issuedIncomeCapitalSummary;
	}

	public BigDecimal getIssuedIncomeCapitalAccountSummary() {
		if(issuedIncomeCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return issuedIncomeCapitalAccountSummary;
	}

	public void setIssuedIncomeCapitalAccountSummary(BigDecimal issuedIncomeCapitalAccountSummary) {
		this.issuedIncomeCapitalAccountSummary = issuedIncomeCapitalAccountSummary;
	}

	public BigDecimal getProjectFollowTotalCapitalSummary() {
		if(projectFollowTotalCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return projectFollowTotalCapitalSummary;
	}

	public void setProjectFollowTotalCapitalSummary(BigDecimal projectFollowTotalCapitalSummary) {
		this.projectFollowTotalCapitalSummary = projectFollowTotalCapitalSummary;
	}

	public BigDecimal getProjectFollowCapitalSummary() {
		if(projectFollowCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return projectFollowCapitalSummary;
	}

	public void setProjectFollowCapitalSummary(BigDecimal projectFollowCapitalSummary) {
		this.projectFollowCapitalSummary = projectFollowCapitalSummary;
	}

	public BigDecimal getProjectFollowSingleCapitalSummary() {
		if(projectFollowSingleCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return projectFollowSingleCapitalSummary;
	}

	public void setProjectFollowSingleCapitalSummary(BigDecimal projectFollowSingleCapitalSummary) {
		this.projectFollowSingleCapitalSummary = projectFollowSingleCapitalSummary;
	}

	public BigDecimal getCashReturnMoneySummary() {
		if(cashReturnMoneySummary==null) {
			return new BigDecimal(0);
		}
		return cashReturnMoneySummary;
	}

	public void setCashReturnMoneySummary(BigDecimal cashReturnMoneySummary) {
		this.cashReturnMoneySummary = cashReturnMoneySummary;
	}

	public BigDecimal getCashReturnCapitalSummary() {
		if(cashReturnCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return cashReturnCapitalSummary;
	}

	public void setCashReturnCapitalSummary(BigDecimal cashReturnCapitalSummary) {
		this.cashReturnCapitalSummary = cashReturnCapitalSummary;
	}

	public BigDecimal getCashReturnCapitalAccountSummary() {
		if(cashReturnCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return cashReturnCapitalAccountSummary;
	}

	public void setCashReturnCapitalAccountSummary(BigDecimal cashReturnCapitalAccountSummary) {
		this.cashReturnCapitalAccountSummary = cashReturnCapitalAccountSummary;
	}

	public BigDecimal getPrincipalReturnMoneySummary() {
		if(principalReturnMoneySummary==null) {
			return new BigDecimal(0);
		}
		return principalReturnMoneySummary;
	}

	public void setPrincipalReturnMoneySummary(BigDecimal principalReturnMoneySummary) {
		this.principalReturnMoneySummary = principalReturnMoneySummary;
	}

	public BigDecimal getPrincipalReturnCapitalSummary() {
		if(principalReturnCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return principalReturnCapitalSummary;
	}

	public void setPrincipalReturnCapitalSummary(BigDecimal principalReturnCapitalSummary) {
		this.principalReturnCapitalSummary = principalReturnCapitalSummary;
	}

	public BigDecimal getPrincipalReturnCapitalAccountSummary() {
		if(principalReturnCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return principalReturnCapitalAccountSummary;
	}

	public void setPrincipalReturnCapitalAccountSummary(BigDecimal principalReturnCapitalAccountSummary) {
		this.principalReturnCapitalAccountSummary = principalReturnCapitalAccountSummary;
	}

	public BigDecimal getProfitDistributionCapitalSummary() {
		if(profitDistributionCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return profitDistributionCapitalSummary;
	}

	public void setProfitDistributionCapitalSummary(BigDecimal profitDistributionCapitalSummary) {
		this.profitDistributionCapitalSummary = profitDistributionCapitalSummary;
	}

	public BigDecimal getProfitDistributionCapitalAccountSummary() {
		if(profitDistributionCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return profitDistributionCapitalAccountSummary;
	}

	public void setProfitDistributionCapitalAccountSummary(BigDecimal profitDistributionCapitalAccountSummary) {
		this.profitDistributionCapitalAccountSummary = profitDistributionCapitalAccountSummary;
	}

	public BigDecimal getPrincipalNotrecoveredCapitalSummary() {
		if(principalNotrecoveredCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return principalNotrecoveredCapitalSummary;
	}

	public void setPrincipalNotrecoveredCapitalSummary(BigDecimal principalNotrecoveredCapitalSummary) {
		this.principalNotrecoveredCapitalSummary = principalNotrecoveredCapitalSummary;
	}

	public BigDecimal getPrincipalNotrecoveredCapitalAccountSummary() {
		if(principalNotrecoveredCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return principalNotrecoveredCapitalAccountSummary;
	}

	public void setPrincipalNotrecoveredCapitalAccountSummary(BigDecimal principalNotrecoveredCapitalAccountSummary) {
		this.principalNotrecoveredCapitalAccountSummary = principalNotrecoveredCapitalAccountSummary;
	}

	public BigDecimal getFinancialIncomeCapitalSummary() {
		if(financialIncomeCapitalSummary==null) {
			return new BigDecimal(0);
		}
		return financialIncomeCapitalSummary;
	}

	public void setFinancialIncomeCapitalSummary(BigDecimal financialIncomeCapitalSummary) {
		this.financialIncomeCapitalSummary = financialIncomeCapitalSummary;
	}

	public BigDecimal getFinancialIncomeCapitalAccountSummary() {
		if(financialIncomeCapitalAccountSummary==null) {
			return new BigDecimal(0);
		}
		return financialIncomeCapitalAccountSummary;
	}

	public void setFinancialIncomeCapitalAccountSummary(BigDecimal financialIncomeCapitalAccountSummary) {
		this.financialIncomeCapitalAccountSummary = financialIncomeCapitalAccountSummary;
	}
	
	//2.区域募集资金余额=区域总募集金额-项目跟投情况（资金池跟投项目金额总计）+项目投资资金收回（本金返还金额总计）
	
	public BigDecimal getRegionaRaisingBalanceCapitalSummary() {
		return new BigDecimal(
    			getRegionAmountRaisedSummary().doubleValue()-getProjectFollowCapitalSummary().doubleValue()
    			+getPrincipalReturnMoneySummary().doubleValue()).setScale(2, BigDecimal.ROUND_HALF_UP);
	}

	
	public BigDecimal getRegionaRaisingBalanceCapitalAccountSummary() {
		return new BigDecimal(
    			getSingleAmountRaisedSummary().doubleValue()-getProjectFollowSingleCapitalSummary().doubleValue()
    			+getPrincipalReturnCapitalAccountSummary().doubleValue()).setScale(2, BigDecimal.ROUND_HALF_UP);
	}

	//3.资金池（可用资金余额）=N16-J16+T16+X16-E16+Q16
		//=区域总募集金额-项目跟投情况(资金池跟投项目金额)+项目投资资金收回(本金返还金额)+利润分配(资金池)-已发放项目收益（资金池）+阶段性现金返还（资金池）

	public BigDecimal getRegionaAailableBalanceCapitalSummary() {
		return new BigDecimal(getRegionaRaisingBalanceCapitalSummary().doubleValue()+getProfitDistributionCapitalSummary().doubleValue()
    	    	-getIssuedIncomeCapitalSummary().doubleValue()+getCashReturnCapitalSummary().doubleValue()).setScale(2, BigDecimal.ROUND_HALF_UP);
	}



	public BigDecimal getRegionaAvailableBalanceCapitalAccountSummary() {
		
		return new BigDecimal(getRegionaRaisingBalanceCapitalAccountSummary().doubleValue()+getProfitDistributionCapitalAccountSummary().doubleValue()
    	    	-getIssuedIncomeCapitalAccountSummary().doubleValue()+getCashReturnCapitalAccountSummary().doubleValue()).setScale(2, BigDecimal.ROUND_HALF_UP);
	}


}
