package cn.superdesk.uniorder.dto.param.invoice.excel;

import cn.superdesk.uniorder.common.excel.model.ExcelRow;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Description: 回款 手动与导入 共用同一个
 * https://www.tapd.cn/33003868/prong/stories/view/1133003868001002623
 * <p>
 * InvoiceInvoicedOperationLogCommonForm
 * @Author: linjinyu
 * @CreateDate: 2021/7/28 上午10:18
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/7/28 上午10:18
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@ExcelIgnoreUnannotated
@Data
@ToString
public class InvoiceInvoicedOpBackCollectionForm extends ExcelRow implements Serializable {

	@ApiModelProperty("批次Id(后端填充)")
	private String batchId;

	/****************************************** 用于较验 源于列表数据 start ******************************************/

	@ApiModelProperty("应收账款Id 手动的可以直接用 invoiceNumber(发票号码)")
	private Long id;

	@ApiModelProperty("发票号码")
	@ExcelProperty(value = "*发票号码", index = 1)
	@NotEmpty(message = "亲爱的小主^_^发票号码不能为空哦")
	private String invoiceNumber;

	@ApiModelProperty("购方名称 页面名称-开票抬头")
	private String     purchaserCompanyName;
	@ApiModelProperty("含税总金额 eg ￥3,532.50 页面名称-发票金额")
	private BigDecimal totalAmountIncludingTax;
	@ApiModelProperty("实际应收金额 如果没有红冲 此值等于发票金额 含税金额(total_amount_including_tax) 页面名称-应收金额")
	private BigDecimal receivableAmount;

	@ApiModelProperty("已回款金额")
	private BigDecimal backCollectionAmountAlready;
	@ApiModelProperty("待回款金额")
	private BigDecimal backCollectionAmountWaitFor;

	/****************************************** 用于修改 start ******************************************/

	//  10:02:34
	@ApiModelProperty("回款时间 eg 2021-03-03")
	@ExcelProperty(value = "*回款日期", index = 0)
	@DateTimeFormat(value = "yyyy/MM/dd")
	@NotNull(message = "亲爱的小主^_^回款日期不能为空哦")
	private Date backCollectionTime;

	@ExcelProperty(value = "*回款金额", index = 2)
	@ApiModelProperty("本次回款金额")
	@DecimalMin(value = "0.01",message = "亲爱的小主^_^回款金额必须大于或等于{value}")
	private BigDecimal backCollectionAmount;

}
