package cn.muchinfo.rma.global.data

import android.os.Parcel
import android.os.Parcelable

/**
 *
 * @property accountid String? 账户ID
 * @property accountname String? 账户名称
 * @property contracctstatus String? 合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
 * @property contractno String? 合同编号
 * @property contracttype String? 合同类型 1-采购, -1-销售
 * @property convertfactor String? 标仓系数
 * @property daikaiamount String? 待开票额
 * @property deliveryenddate String? 交割结束日
 * @property deliverygoodscode String? 现货商品代码
 * @property deliverygoodsid String? 现货商品ID
 * @property deliverygoodsname String? 现货商品名称
 * @property deliverystartdate String? 交割开始日
 * @property enddate String? 点价结束日
 * @property enumdicname String? 单位名称
 * @property goodscode String? 点价商品代码
 * goodsname  点价商品名称
 * @property goodsid String? 点价商品ID
 * @property invoiceamount String? 已开票额
 * @property loanamount String? 贷款总额=已定价额+调整金额
 * @property margin String? 保证金
 * @property payamount String? 已收付额(收款或付款)
 * @property price String? 价格
 * @property pricedamount String? 已定价额
 * @property pricedavg String? 已点均价
 * @property pricedqty String? 已定价量
 * @property pricemove String? 升贴水
 * @property pricetype String? 定价类型 - 1:一口价 2:点价 3:暂定价
 * @property producttype String? 产品类型 - 1:标准仓单 2:等标 3:非标
 * @property qty String? 合同量
 * @property reckonadjustamount String? 调整金额
 * @property reckonedamount String? 已收付额(已确定额)
 * @property reckonotheramount String? 其它费用
 * @property reckonrealqty String? 已确定量
 * @property remark String? 备注
 * @property spotcontractid String? 合同ID
 * @property spotgoodsdesc String? 商品型号(商品规格)
 * @property startdate String? 点价开始日
 * @property totalamount String? 合计总额
 * @property unpayamount String? 待支收额(支付或收款)
 * @property unpricedqty String? 未定价量
 * @property unsureqty String? 未确定量
 * @property userid String? 用户ID
 * @constructor
 */
data class ContractData(
    val accountid: String? = "",
    val accountname: String? = "",
    val contracctstatus: String? = "",
    val contractno: String? = "",
    val contracttype: String? = "",
    val convertfactor: String? = "",
    val daikaiamount: String?  = "",
    val deliveryenddate: String? = "",
    val deliverygoodscode: String? = "",
    val deliverygoodsid: String? = "",
    val deliverygoodsname: String? = "",
    val deliverystartdate: String? = "",
    val enddate: String? = "",
    val enumdicname: String? = "",
    val goodscode: String? = "",
    val goodsid: String? = "",
    val invoiceamount: String? = "",
    val loanamount: String? = "",
    val margin: String? = "",
    val payamount: String? = "",
    val price: String? = "",
    val pricedamount: String? = "",
    val pricedavg: String? = "",
    val pricedqty: String? = "",
    val pricemove: String? = "",
    val pricetype: String? = "",
    val producttype: String? = "",
    val qty: String? = "",
    val reckonadjustamount: String? = "",
    val reckonedamount: String? = "",
    val reckonotheramount: String? = "",
    val reckonrealqty: String? = "",
    val remark: String? = "",
    val spotcontractid:String? = "",
    val spotgoodsdesc: String? = "",
    val startdate: String? = "",
    val totalamount: String? = "",
    val unpayamount: String? = "",
    val unpricedqty: String? = "",
    val unsureqty: String? = "",
    val userid: String? = "",
    var indexSelect: Int = 0,
    val buyuserid: String? = "",
    val buyusername: String? = "",
    val selluserid: String? = "",
    val sellusername: String? = "",
    val contractmargin: String? = "",
    val audittime : String? = "",//审核时间
    var rightData : List<String>? = arrayListOf(),
    val brandname : String? = "",//品牌名称
    val modelname : String? = "",//型号名称
    val goodsname : String? = ""
) : Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readInt(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString(),
        parcel.createStringArrayList(),
        parcel.readString(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(accountid)
        parcel.writeString(accountname)
        parcel.writeString(contracctstatus)
        parcel.writeString(contractno)
        parcel.writeString(contracttype)
        parcel.writeString(convertfactor)
        parcel.writeString(daikaiamount)
        parcel.writeString(deliveryenddate)
        parcel.writeString(deliverygoodscode)
        parcel.writeString(deliverygoodsid)
        parcel.writeString(deliverygoodsname)
        parcel.writeString(deliverystartdate)
        parcel.writeString(enddate)
        parcel.writeString(enumdicname)
        parcel.writeString(goodscode)
        parcel.writeString(goodsid)
        parcel.writeString(invoiceamount)
        parcel.writeString(loanamount)
        parcel.writeString(margin)
        parcel.writeString(payamount)
        parcel.writeString(price)
        parcel.writeString(pricedamount)
        parcel.writeString(pricedavg)
        parcel.writeString(pricedqty)
        parcel.writeString(pricemove)
        parcel.writeString(pricetype)
        parcel.writeString(producttype)
        parcel.writeString(qty)
        parcel.writeString(reckonadjustamount)
        parcel.writeString(reckonedamount)
        parcel.writeString(reckonotheramount)
        parcel.writeString(reckonrealqty)
        parcel.writeString(remark)
        parcel.writeString(spotcontractid)
        parcel.writeString(spotgoodsdesc)
        parcel.writeString(startdate)
        parcel.writeString(totalamount)
        parcel.writeString(unpayamount)
        parcel.writeString(unpricedqty)
        parcel.writeString(unsureqty)
        parcel.writeString(userid)
        parcel.writeInt(indexSelect)
        parcel.writeString(buyuserid)
        parcel.writeString(buyusername)
        parcel.writeString(selluserid)
        parcel.writeString(sellusername)
        parcel.writeString(contractmargin)
        parcel.writeString(audittime)
        parcel.writeStringList(rightData)
        parcel.writeString(brandname)
        parcel.writeString(modelname)
        parcel.writeString(goodsname)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<ContractData> {
        override fun createFromParcel(parcel: Parcel): ContractData {
            return ContractData(parcel)
        }

        override fun newArray(size: Int): Array<ContractData?> {
            return arrayOfNulls(size)
        }
    }


}