package cn.superdesk.uniorder.openapi.api._thirdpart.qchjc._dto.invoice;

import cn.superdesk.uniorder.openapi.api._thirdpart.qchjc._dto.accounting.QchjcSupplierOrderDto;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.Valid;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * @author xc
 * @description 供应商发票单
 * @date 2022/3/18 19:10
 */
@Data
public class QchjcSupplierInvoiceDto {
    /**
     * 对账单
     */
    private Long    accountingOrderId;//对账单Id
    private String  accountingOrderSn;//对账单编号
    private Integer accountingOrderType;//对账单类型 1-一般 2-积分
    private String  invoiceSn;//开票申请编号
    /**
     * 寄票登记
     */
    private String  mailTickUserId;//寄票登记人id
    private Integer mailTickStatus;//寄票状态:0-未寄票;1-已寄票
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date    mailTickTime;//寄票时间
    private String  expressCompanyName;//快递公司名称
    private String  expressNo;//快递单号

    /**
     * 开票申请
     */
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal                  invoiceApplyAmount;//开票申请金额:商品或流水累加,集采的订单金额
    private BigDecimal                  freeAmount = new BigDecimal("0.00");//减免金额，默认0
    //private BigDecimal unAccountingAmount;//取该对账单中所有积分类型为`微信支付`的结算金额总和 也称之为不对账金额 不结算金额
//    @NotNull(message = "不能为空")
//    @DecimalMin(value = "0", message = "金额需大于等于0.00")
//    private BigDecimal jcUnAccountingAmount;//集采不对账金额
    @NotNull(message = "不能为空")
    @DecimalMin(value = "0", message = "金额需大于等于0.00")
    private BigDecimal                  realAmount;//实际金额
    //    @NotNull(message = "不能为空")
//    @DecimalMin(value = "0", message = "金额需大于等于0.00")
//    private BigDecimal rebateAmount;//返点金额
    @NotNull(message = "不能为空")
    private Integer                     invoiceType;//发票种类 1-增值税电子普通发票，2-增值税专用发票，3-增值税普通发票，4-增值税电子专用发票
    @NotBlank(message = "不能为空")
    private String                      invoiceMode;//开票方式 线下开票(offLine)|深圳航天信息电子发票(szhtxxElectronicInvoice)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date                        applyTime;//申请时间
    @NotNull(message = "不能为空")
    private String                      applyUserId;//申请人id
    @NotBlank(message = "不能为空")
    private String                      applyUserName;//申请人姓名
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date                        updateTime;//最后修改时间
    @NotNull(message = "不能为空")
    private String                      updateUserId;//最后修改人id
    @NotBlank(message = "不能为空")
    private String                      updateUserName;//最后修改人姓名
    private String                      remark;//备注
    @NotBlank(message = "不能为空")
    private String invoiceNumber; //发票号，多个发票号用","分割
    @NotNull(message = "不能为空")
    private String                      makeInvoiceUserId;//开票登记人id
    @NotBlank(message = "不能为空")
    private String                      makeInvoiceUserName;//开票登记人姓名
    @NotNull(message = "不能为空")
    private Integer                     makeInvoiceStatus;//开票状态 0-未开票;1-已开票;2-重新开票;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "不能为空")
    private Date                        makeInvoiceTime;//开票时间
    @NotEmpty(message = "不能为空")
    @Valid
    private List<QchjcSupplierOrderDto> orderSelected;
}