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


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.jeeplus.common.persistence.ActEntity;
import com.jeeplus.common.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;
import com.jeeplus.modules.sys.utils.UserUtils;
import com.jeeplus.modules.workinvoice.entity.WorkInvoice;
import com.jeeplus.modules.sys.entity.Office;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;

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

/**
 * 发票明细Entity
 * @author lw
 * @version 2018-05-09
 */
public class WorkInvoiceDetail extends ActEntity<WorkInvoiceDetail> {
	public static final String SERIAL_BIZCODE = "4";//编号模板类型

	private static final long serialVersionUID = 1L;
	private String number;		// 发票号
	private String code;         //发票代码
	private String totalMoney;		// 价税合计
    @JsonIgnore
	private String totalMoneyStr;		// 价税合计
	private String tax;		// 税率
	private String taxMoney;		// 金额 开票金额
    @JsonIgnore
	private String taxMoneyStr;		// 金额 开票金额
	private String taxRate;		// 税额
    @JsonIgnore
	private String taxRateStr;		// 税额
	private String incomeMoney;		// 登记金额 收款金额
    @JsonIgnore
	private String incomeMoneyStr;		// 登记金额 收款金额
	private String state;		// 发票状态
	private String backSign;		// 被退标记
	private String backNumber;		// 被退票号
	private String backCode;        //被退代码
	private Date date;		// 开票日期
	private String invoiceId;		// 发票主键
	private String ainvoiceId;       //变更发票主键
	private String sign;       //操作标记
	private WorkInvoice workInvoice; //发票
    private String[] exclusiveIds;
    private String comId;
    private String officeId;
	private String home;
	private String settleFlag;
	private Date beginContractDate;		// 开始
	private Date endContractDate;		// 结束
	private String returnNumbers;       //作废-申请编号
	private String returnId;             //作废-原明细Id
	//导出功能-属性
	private String invoiceExt;//0分公司开票 1总公司开票
	private String invoiceInvoiceType;  //发票类型1专票2普票
	private String invoiceClientName;   //实际开票单位
	private String invoiceOrUnicode;    //纳税人识别号
	private String invoiceContent;      //开票内容要求
	private String invoiceRemarks;      //备注
	private String invocieNumber;      //申请编号
	private String invoiceDrawerName;  //开票人
	private String invoiceOfficeName;  //所属部门
	private String contractNum ;       //合同编号
	private String contractName;       //合同名称
	private String contractClientName; //主委托方
	// 流程任务
	private Task task;
	private Map<String, Object> variables;
	// 运行中的流程实例
	private ProcessInstance processInstance;
	// 历史的流程实例
	private HistoricProcessInstance historicProcessInstance;
	// 流程定义
	private ProcessDefinition processDefinition;
    /*暂弃*/
	private String returnNumber;     //退票申请编号
	private String returnReason;     //退票原因
	private String returnCancle;     //作废退票（1退票2作废）
	private String returnSign;      //原票是否退回（1是2否）
	private Date returnDate;         //退票时间
	private String returnUser;       //退票人
	private String processInstanceId; // 流程实例编号
	private String status;             //状态

	public WorkInvoiceDetail() {
		super();
	}

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

	public String getHome() {
		return home;
	}

	public void setHome(String home) {
		this.home = home;
	}
	@ExcelField(title="发票代码", align=2, sort=6)
	public String getCode() {
		return code;
	}

	@ExcelField(title="发票号", align=2, sort=7)
	public String getNumber() {
		return number;
	}


	public String getTotalMoney() {
		return totalMoney;
	}
	@ExcelField(title="价税合计", align=2, sort=8)
	public String getTotalMoneyStr() {
		return UserUtils.getDecimalFormat(new BigDecimal(this.totalMoney));
	}
	@ExcelField(title="税率", align=2, sort=9)
	public String getTax() {
		return tax;
	}


	public String getTaxMoney() {
		return taxMoney;
	}
	@ExcelField(title="金额", align=2, sort=10)
	public String getTaxMoneyStr() {
		return UserUtils.getDecimalFormat(new BigDecimal(this.taxMoney));
	}
	@ExcelField(title="税额", align=2, sort=11)
	public String getTaxRateStr() {
		return UserUtils.getDecimalFormat(new BigDecimal(this.taxRate));
	}

	public String getTaxRate() {
		return taxRate;
	}

	public String getReturnId() {
		return returnId;
	}

	public void setReturnId(String returnId) {
		this.returnId = returnId;
	}

	public String getIncomeMoney() {
		return incomeMoney;
	}
	@ExcelField(title="累计登记金额", align=2, sort=12)
	public String getIncomeMoneyStr() {
		return UserUtils.getDecimalFormat(new BigDecimal(this.incomeMoney));
	}
	@ExcelField(title="开票日期", align=2, sort=13)
	public Date getDate() {
		return date;
	}

	@ExcelField(title="总/分公司开票", align=2, sort=14,dictType = "ext_type")
	public String getInvoiceExt() { return invoiceExt; }

	@ExcelField(title="发票类型", align=2, sort=15,dictType = "invoice_type")
	public String getInvoiceInvoiceType() { return invoiceInvoiceType; }

	@ExcelField(title="实际开票单位", align=2, sort=16)
	public String getInvoiceClientName() { return invoiceClientName; }

	@ExcelField(title="纳税人识别号", align=2, sort=17)
	public String getInvoiceOrUnicode() { return invoiceOrUnicode; }

	@ExcelField(title="开票内容要求", align=2, sort=18)
	public String getInvoiceContent() { return invoiceContent; }

	public String getReturnNumbers() {
		return returnNumbers;
	}

	public void setReturnNumbers(String returnNumbers) {
		this.returnNumbers = returnNumbers;
	}

	public String getBackCode() {
		return backCode;
	}

	public void setBackCode(String backCode) {
		this.backCode = backCode;
	}

	@ExcelField(title="备注", align=2, sort=19)
	public String getInvoiceRemarks() { return invoiceRemarks; }

	@ExcelField(title="发票状态", align=2, sort=20)
	public String getState() {
		return state;
	}

	@ExcelField(title="被退标记", align=2, sort=21)
	public String getBackSign() {
		return backSign;
	}

	@ExcelField(title="被退票号", align=2, sort=22)
	public String getBackNumber() {
		return backNumber;
	}

	@ExcelField(title="申请编号", align=2, sort=23)
	public String getInvocieNumber() { return invocieNumber; }

	@ExcelField(title="开票人", align=2, sort=24)
	public String getInvoiceDrawerName() { return invoiceDrawerName; }

	@ExcelField(title="所属部门", align=2, sort=25)
	public String getInvoiceOfficeName() { return invoiceOfficeName; }

	@ExcelField(title="合同编号", align=2, sort=26)
	public String getContractNum() { return contractNum; }

	@ExcelField(title="合同名称", align=2, sort=27)
	public String getContractName() { return contractName; }

	@ExcelField(title="主委托方", align=2, sort=28)
	public String getContractClientName() { return contractClientName; }

	public void setNumber(String number) {
		this.number = number;
	}
	
	public void setTotalMoney(String totalMoney) {
		this.totalMoney = totalMoney;
	}
	
	public void setTax(String tax) {
		this.tax = tax;
	}

	public void setTaxMoney(String taxMoney) {
		this.taxMoney = taxMoney;
	}

	public void setTaxRate(String taxRate) {
		this.taxRate = taxRate;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public void setInvoiceExt(String invoiceExt) {
		this.invoiceExt = invoiceExt;
	}

	public void setInvoiceInvoiceType(String invoiceInvoiceType) {
		this.invoiceInvoiceType = invoiceInvoiceType;
	}

	public void setInvoiceClientName(String invoiceClientName) {
		this.invoiceClientName = invoiceClientName;
	}

	public void setInvoiceOrUnicode(String invoiceOrUnicode) {
		this.invoiceOrUnicode = invoiceOrUnicode;
	}

	public void setInvoiceContent(String invoiceContent) {
		this.invoiceContent = invoiceContent;
	}



	public void setInvoiceRemarks(String invoiceRemarks) {
		this.invoiceRemarks = invoiceRemarks;
	}



	public void setInvocieNumber(String invocieNumber) {
		this.invocieNumber = invocieNumber;
	}



	public void setInvoiceDrawerName(String invoiceDrawerName) {
		this.invoiceDrawerName = invoiceDrawerName;
	}



	public void setInvoiceOfficeName(String invoiceOfficeName) {
		this.invoiceOfficeName = invoiceOfficeName;
	}


	public void setContractNum(String contractNum) {
		this.contractNum = contractNum;
	}


	public void setTaxMoneyStr(String taxMoneyStr) {
		this.taxMoneyStr = taxMoneyStr;
	}



	public void setTaxRateStr(String taxRateStr) {
		this.taxRateStr = taxRateStr;
	}

	public void setContractName(String contractName) {
		this.contractName = contractName;
	}



	public void setTotalMoneyStr(String totalMoneyStr) {
		this.totalMoneyStr = totalMoneyStr;
	}


	public void setIncomeMoneyStr(String incomeMoneyStr) {
		this.incomeMoneyStr = incomeMoneyStr;
	}

	public void setContractClientName(String contractClientName) {
		this.contractClientName = contractClientName;
	}

	public String getAinvoiceId() {
		return ainvoiceId;
	}

	public void setAinvoiceId(String ainvoiceId) {
		this.ainvoiceId = ainvoiceId;
	}

	public void setIncomeMoney(String incomeMoney) {
		this.incomeMoney = incomeMoney;
	}
	


	public void setState(String state) {
		this.state = state;
	}

	public String getReturnNumber() {
		return returnNumber;
	}

	public Date getBeginContractDate() {
		return beginContractDate;
	}

	public void setBeginContractDate(Date beginContractDate) {
		this.beginContractDate = beginContractDate;
	}

	public Date getEndContractDate() {
		return endContractDate;
	}

	public void setEndContractDate(Date endContractDate) {
		this.endContractDate = endContractDate;
	}

	public String getProcessInstanceId() {
		return processInstanceId;
	}

	public void setProcessInstanceId(String processInstanceId) {
		this.processInstanceId = processInstanceId;
	}

	public void setReturnNumber(String returnNumber) {
		this.returnNumber = returnNumber;
	}

	public String getReturnReason() {
		return returnReason;
	}

	public void setReturnReason(String returnReason) {
		this.returnReason = returnReason;
	}

	public String getReturnCancle() {
		return returnCancle;
	}

	public void setReturnCancle(String returnCancle) {
		this.returnCancle = returnCancle;
	}

	public String getReturnSign() {
		return returnSign;
	}

	public void setReturnSign(String returnSign) {
		this.returnSign = returnSign;
	}

	public Date getReturnDate() {
		return returnDate;
	}

	public void setReturnDate(Date returnDate) {
		this.returnDate = returnDate;
	}

	public String getReturnUser() {
		return returnUser;
	}

	public void setReturnUser(String returnUser) {
		this.returnUser = returnUser;
	}

	public Task getTask() {
		return task;
	}

	public void setTask(Task task) {
		this.task = task;
	}

	public Map<String, Object> getVariables() {
		return variables;
	}

	public void setVariables(Map<String, Object> variables) {
		this.variables = variables;
	}

	public ProcessInstance getProcessInstance() {
		return processInstance;
	}

	public void setProcessInstance(ProcessInstance processInstance) {
		this.processInstance = processInstance;
	}

	public HistoricProcessInstance getHistoricProcessInstance() {
		return historicProcessInstance;
	}

	public void setHistoricProcessInstance(HistoricProcessInstance historicProcessInstance) {
		this.historicProcessInstance = historicProcessInstance;
	}

	public ProcessDefinition getProcessDefinition() {
		return processDefinition;
	}

	public void setProcessDefinition(ProcessDefinition processDefinition) {
		this.processDefinition = processDefinition;
	}



	public void setBackSign(String backSign) {
		this.backSign = backSign;
	}
	


	public void setBackNumber(String backNumber) {
		this.backNumber = backNumber;
	}


	public void setCode(String code) {
		this.code = code;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public WorkInvoice getWorkInvoice() {
		return workInvoice;
	}

	public void setWorkInvoice(WorkInvoice workInvoice) {
		this.workInvoice = workInvoice;
	}



	public void setDate(Date date) {
		this.date = date;
	}
	
	public String getInvoiceId() {
		return invoiceId;
	}

	public void setInvoiceId(String invoiceId) {
		this.invoiceId = invoiceId;
	}

    public String[] getExclusiveIds() {
        return exclusiveIds;
    }

    public void setExclusiveIds(String[] exclusiveIds) {
        this.exclusiveIds = exclusiveIds;
    }

    public String getComId() {
        return comId;
    }

    public void setComId(String comId) {
        this.comId = comId;
    }

    public String getOfficeId() {
        return officeId;
    }

    public void setOfficeId(String officeId) {
        this.officeId = officeId;
    }

    public String getSettleFlag() {
        return settleFlag;
    }

    public void setSettleFlag(String settleFlag) {
        this.settleFlag = settleFlag;
    }
}