package com.naz.sdkdemo.bean;

import java.io.Serializable;

public class TrademarkInfo implements Serializable {

    public boolean select;
    public int count = -1;

    public String created_date_lt;
    public String created_date;
    public String last_modified_by_show;
    public String device_code;
    public String material_code; //产品编码
    public String material_code_show; //产品名称
    public String last_modified_by;
    public String unit_code_show; //单位
    public String bus_type_dk;
    public String created_by;
    public String unit_code;
    public String dynamic_form_value_id;
    public String supplier_code_show;
    public String device_code_show;
    public String belong_org;
    public String bus_type_dk_show;
    public String created_by_show;
    public String id;
    public String supplier_code;
    public String main_table_id;
    public String last_modified_date_lt;
    public float qty;
    public String specs;
    public String box_code;
    public String request_id;
    public String detail_table_id;
    public String last_modified_date;
    public String box_code_show;
    public int in_stock_qty;
    public int use_qty;
    public int out_stock_qty_total; //数量
    public OrderInfo exe_sale_order_b;
    public double total_order_quantity;
    public String no;
    public String customer_name;
    public String customer_code_show;
    public String customer_code;
    public String jingxiaoshang;
    public String jingxiaoshang_show;
    public String order_type_code;
    public String order_type_code_show;
    public String order_date;
    public String decor_code_show; //标签
    public String decor_two_code_show;
    public String craft_type_code_show;
    public String craft_type_two_code_show;

    public String decor_model;//规格
    public String craft_type_dk_show; //型号
    public TrademarkCompareView prod_trademark_compare_view;

    public int getTotalOrderQuantity(){
        try {
            return (int) total_order_quantity;
        } catch (NumberFormatException e) {

        }
        return 0;
    }

    public int getOrderCount() {
        try {
            if (count == -1) {
                count = (int) (qty-out_stock_qty_total);
            }
            return count;
        } catch (NumberFormatException e) {

        }
        return 0;
    }

    public int getRestoreQty() {
        int restoreQty = (int)(count - qty);
        return Math.max(restoreQty, 0);
    }

    public int getMaxOrderCount() {
        return (int) (qty-out_stock_qty_total);
    }

    public static class OrderInfo implements Serializable{
        public String jingxiaoshang_show;
        public String jingxiaoshang;
        public String customer_name;
        public String order_date;
        public String customer_code_show;
        public String customer_code;
        public String no;
        public String dynamic_form_value_id;
        public String id;
        public String main_table_id;
        public String request_id;
    }

    public static class TrademarkCompareView implements Serializable{
        public String brand_code_show;//商标
    }
}
