/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.workreceiptsregister.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jeeplus.modules.sys.entity.Office;

import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.utils.DictUtils;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
import com.jeeplus.modules.workinvoicedetail.entity.WorkInvoiceDetail;
import org.springframework.format.annotation.NumberFormat;

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

/**
 * 登记明细Entity
 * @author ssrh
 * @version 2018-05-21
 */
public class WorkReceiptsRegisterDetail extends DataEntity<WorkReceiptsRegisterDetail> {
	
	private static final long serialVersionUID = 1L;
	private Office office;		// 所属部门
	private WorkInvoiceDetail invoice;		// 发票编号
    @NumberFormat(style = NumberFormat.Style.CURRENCY)
	private Double registerAmt;		// 登记金额
	private Date registerDate;		// 登记日期
	private String status;		// 登记状态
	private String statusStr;		// 登记状态
	private String registerId;		// 收入登记编号
	
	public WorkReceiptsRegisterDetail() {
		super();
	}

	public WorkReceiptsRegisterDetail(String id){
		super(id);
	}

	@ExcelField(title="所属部门", fieldType=Office.class, value="", align=2, sort=6)
	public Office getOffice() {
		return office;
	}

	public void setOffice(Office office) {
		this.office = office;
	}
	
	@ExcelField(title="发票编号", align=2, sort=7)
	public WorkInvoiceDetail getInvoice() {
		return invoice;
	}

	public void setInvoice(WorkInvoiceDetail invoice) {
		this.invoice = invoice;
	}
	
	public Double getRegisterAmt() {
		return registerAmt;
	}

    @ExcelField(title="登记金额", align=2, sort=8)
    public String getReceiptAmtStr() {
        return UserUtils.getDecimalFormat(new BigDecimal(this.registerAmt));
    }

	public void setRegisterAmt(Double registerAmt) {
		this.registerAmt = registerAmt;
	}
	
	@ExcelField(title="登记日期", align=2, sort=9)
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}
	
	@ExcelField(title="登记状态", align=2, sort=10)
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@ExcelField(title="收入登记编号", align=2, sort=11)
	public String getRegisterId() {
		return registerId;
	}

	public void setRegisterId(String registerId) {
		this.registerId = registerId;
	}

    public String getStatusStr() {
        return DictUtils.getDictLabel(this.status,"register_type","");
    }

    public void setStatusStr(String statusStr) {
        this.statusStr = statusStr;
    }
}