package com.zfire.mall.manager.bean.k3.bill;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.zfire.mall.manager.constant.KingDeeCons;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AccessLevel;
import lombok.Data;
import lombok.Setter;

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

@ApiModel
@Data
@JsonIgnoreProperties(value = { "unit", "stock", "mustQty" ,"priceUnit","remainInStockUnit"})
public class PurchaseInStockItemBean {

    /**
     * 物料编码
     */
    @JsonProperty("FMaterialId")
    @Setter(AccessLevel.NONE)
    private Map<String, String> materialId = new HashMap<String, String>();

    /**
     * 单位
     */
    @JsonProperty("FUnitID")
    @Setter(AccessLevel.NONE)
    private Map<String, String> unitId = new HashMap<>();


    /**
     * 单位
     */
    @JsonProperty("FPriceUnitID")
    @Setter(AccessLevel.NONE)
    private Map<String, String> priceUnitId = new HashMap<>();

    /**
     * 单位
     */
    @JsonProperty("FRemainInStockUnitId")
    @Setter(AccessLevel.NONE)
    private Map<String, String> remainInStockUnitId = new HashMap<>();

    /**
     * 应收数量
     */
    @JsonProperty("FRealQty")
    private BigDecimal realQty;

    /**
     * 单价
     */
    @JsonProperty("FPrice")
    private BigDecimal price ;

    /**
     * 折扣
     */
    @JsonProperty("FDiscount")
    private BigDecimal discount  ;


    /**
     * 金额
     */
    @JsonProperty("FAmount")
    private BigDecimal amount ;


    /**
     * 含税单价
     */
    @JsonProperty("FTaxPrice")
    private BigDecimal fTaxPrice  ;


    /**
     *税率
     */
    @JsonProperty("FTaxRate")
    private BigDecimal fTaxRate;


   /**
     *价税合计
     */
    @JsonProperty("FAllAmount")
    private BigDecimal fAllAmount ;


   /**
     *是否赠品
     */
    @JsonProperty("FGiveAway")
    private Boolean fGiveAway ;


    /**
     * 仓库
     */
    @JsonProperty("FStockId")
    @ApiModelProperty(value = "仓库", required = true)
    private Map<String, String> stockId = new HashMap<>();


    @ApiModelProperty(value = "单位编码", required = true)
    private String unit;

    @ApiModelProperty(value = "仓库", required = true)
    private String stock;



    @ApiModelProperty(value = "单位编码", required = true)
    private String priceUnit;


    @ApiModelProperty(value = "物料编码", required = true)
    private String material;

    @ApiModelProperty(value = "单位编码", required = true)
    private String remainInStockUnit;

    public void setUnit(String unit) {
        this.unit = unit;
        this.unitId.put(KingDeeCons.NUMBER, this.unit);
    }

    public void setRemainInStockUnit(String remainInStockUnit) {
        this.remainInStockUnit = remainInStockUnit;
        this.remainInStockUnitId.put(KingDeeCons.NUMBER, this.remainInStockUnit);
    }

    public void setPriceUnit(String priceUnit) {
        this.priceUnit = priceUnit;
        this.priceUnitId.put(KingDeeCons.NUMBER, this.priceUnit);
    }

    public void setMaterial(String material) {
        this.material = material;
        this.materialId.put(KingDeeCons.NUMBER, this.material);
    }

    public void setStock(String stock) {
        this.stock = stock;
        this.stockId.put(KingDeeCons.NUMBER, this.stock);
    }



}
