package cn.palmte.work.model.process;

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

import lombok.Data;

/**
 * 预算采购明细
 *
 * @author <a href="https://github.com/TAKETODAY">Harry Yang</a>
 * @since 2.0 2022/12/28 16:01
 */
@Data
public class ProcurementDetail {

  private int type;
  private String category;

  private String name;

  private String unit;

  private BigDecimal price;

  private BigDecimal taxRate;

  private String contractParty;

  private int isUnderwritten;
  private String isUnderwrittenDesc;

  private BigDecimal underwrittenAmount;

  private Date payTime;

  private BigDecimal totalTax;
  private BigDecimal totalTaxInclude;
  private BigDecimal totalTaxExclude;

  private BigDecimal payAmount;
  private String payWay;
  private String remark;

  // 项目的成本明细ID
  private Integer budgetCostId;

  // 要采购的总量
  private BigDecimal amount;

  // 已采购数量
  private BigDecimal amountAlready = BigDecimal.ZERO;
  private BigDecimal amountCurrent;

  // 未采购数量
  private BigDecimal amountLeft;

  private List<BudgetPurchaseDetail> purchaseDetails;

  private Integer amountId;

  public void setIsUnderwritten(int isUnderwritten) {
    this.isUnderwritten = isUnderwritten;
    this.isUnderwrittenDesc = isUnderwritten == 1 ? "是" : "否";
  }
}
