package thyyxxk.webserver.entity.inpatient.chargelist;

import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Data
public class ChargeItem {
    private String code;
    private String name;
    private String specification;
    private String unit;
    private BigDecimal price;
    private BigDecimal quantity;
    private BigDecimal cost;
    private String execDept;
    private String billItemCode;
    private String billItemName;
    private String priceString;
    private String quantityString;
    private String costString;

    public String getPriceString() {
        return price.setScale(2, RoundingMode.HALF_DOWN).toString();
    }

    public String getQuantityString() {
        return quantity.setScale(1, RoundingMode.HALF_DOWN).toString();
    }

    public String getCostString() {
        return cost.setScale(2, RoundingMode.HALF_DOWN).toString();
    }
}
