package com.wd.workoffice.ui.adapter;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.wd.workoffice.R;
import com.wd.workoffice.bean.ProPriceBean;
import com.wd.workoffice.bean.TicketBean;
import com.wd.workoffice.util.MathUtils;
import com.wd.workoffice.util.WorkUtils;

import java.util.List;

/**
 * Created by flexible on 2018/8/13.
 */

public class WorkTicketAdapter extends BaseQuickAdapter<TicketBean.RecordsBean, BaseViewHolder> {

    public WorkTicketAdapter(int layoutResId, List data) {
        super(layoutResId, data);
    }


    @Override
    protected void convert(BaseViewHolder helper, TicketBean.RecordsBean item) {
        helper.setText(R.id.tv_name, item.getSupplierName());
        helper.setText(R.id.tv_tax,MathUtils.converData(item.getTax(),3));
        helper.setText(R.id.tv_person, item.getApplierName());
        helper.setText(R.id.tv_time, item.getCreatedTime());
        helper.setText(R.id.tv_all_price, MathUtils.converData(item.getInvoiceSum(),3));
        helper.setText(R.id.tv_status, WorkUtils.getFinancialStatus(Integer.valueOf(item.getStatus())));
    }
}

