package com.fjhx.params.contract;

import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class DateStatisticsResult {

    /**
     * 展示日期
     */
    private String showDate;

    /**
     * 统计开始时间
     */
    private Date beginTime;

    /**
     * 统计结束时间
     */
    private Date endTime;

    /**
     * 账期类型 1历史账期 2当前账期 3未来账期
     */
    private Integer type;

    /**
     * 已付预付款
     */
    private BigDecimal paidPayInAdvance;

    /**
     * 已付有账期
     */
    private BigDecimal paidAccountingPeriod;

    /**
     * 未付预付款
     */
    private BigDecimal unpaidPayInAdvance;

    /**
     * 未付有账期
     */
    private BigDecimal unpaidAccountingPeriod;

    /**
     * 获取付款合计
     */
    public BigDecimal getTotalPaid() {
        return getPaidPayInAdvance().add(getPaidAccountingPeriod());
    }

    /**
     * 获取未付款合计
     */
    public BigDecimal getTotalUnpaid() {
        return getUnpaidPayInAdvance().add(getUnpaidAccountingPeriod());
    }

    /**
     * 获取应付预付款
     */
    public BigDecimal getCopeWithPayInAdvance() {
        return getPaidPayInAdvance().add(getUnpaidPayInAdvance());
    }

    /**
     * 获取应付有账期
     */
    public BigDecimal getCopeWithAccountingPeriod() {
        return getPaidAccountingPeriod().add(getUnpaidAccountingPeriod());
    }

    /**
     * 获取应付总数
     */
    public BigDecimal getTotalCopeWith() {
        return getCopeWithPayInAdvance().add(getCopeWithAccountingPeriod());
    }

    public BigDecimal getPaidPayInAdvance() {
        return paidPayInAdvance == null ? BigDecimal.ZERO : paidPayInAdvance;
    }

    public BigDecimal getPaidAccountingPeriod() {
        return paidAccountingPeriod == null ? BigDecimal.ZERO : paidAccountingPeriod;
    }

    public BigDecimal getUnpaidPayInAdvance() {
        return unpaidPayInAdvance == null ? BigDecimal.ZERO : unpaidPayInAdvance;
    }

    public BigDecimal getUnpaidAccountingPeriod() {
        return unpaidAccountingPeriod == null ? BigDecimal.ZERO : unpaidAccountingPeriod;
    }


}
