package cn.muchinfo.rma.global.data

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

/**
 * 查询业务管理(结算)(对应菜单:业务管理/结算) + 点价
 * @property addmargin String?追加保证金(非必填)
 * @property applyid String?申请人
 * @property applyname String?申请人名称
 * @property applystatus String?申请状态 - 1:待审核 2:审核通过 3:审核拒绝 4:处理失败 5:已撤回
 * @property applytime String?申请时间
 * @property auditname String?审核人名称
 * @property audittime String?审核时间
 * @property buyusername String?采购方名称
 * @property contractno String?合同编号
 * @property contractstatus String?合同状态- 0:未提交 1:待审核 2:执行中 3:正常完结 4:审核拒绝 5:异常完结 6:已撤回
 * @property contracttype String?现货合同类型 - 1:采购 -1:销售
 * @property decmargin String?减少保证金(非必填)
 * @property enumdicname String?单位名称
 * @property goodscode String?点价合约
 * @property goodsname String?商品名称
 * @property operateapplyid String?操作申请ID(603+Unix秒时间戳(10位)+xxxxxx)
 * @property operateapplytype String?操作申请类型 - 1:点价 2:结算登记 3:款项登记 4:发票登记
 * @property pricemove String?升贴水
 * @property pricetype String?定价类型 - 1:一口价 2:点价 3:暂定价
 * @property reckonadjustamount String?结算调整金额(非必填)
 * @property reckonosamount String?结算溢短金额(非必填)
 * @property reckonotheramount String?结算其他费用(非必填)
 * @property reckonrealqty String?结算实际数量(非必填)
 * @property relatedid String?现货合同ID
 * @property sellusername String?销售方名字
 * @property userid String?用户ID
 * @constructor
 */
data class BusinessData(
    val addmargin: String? = "",
    val applyid: String? = "",
    val applyname: String? ="",
    val applystatus: String? = "",
    val applytime: String? = "",
    val auditname: String? = "",
    val audittime: String? = "",
    val buyusername: String? = "",
    val contractno: String? = "",
    val contractstatus: String? = "",
    val contracttype: String? = "",
    val decmargin: String? = "",
    val enumdicname: String? = "",
    val goodscode: String? = "",
    val goodsname: String? = "",
    val operateapplyid: String? = "",
    val operateapplytype: String? = "",
    val pricemove: String? = "",
    val pricetype: String? = "",
    val reckonadjustamount: String? = "",
    val reckonosamount: String? = "",
    val reckonotheramount: String? = "",
    val reckonrealqty: String? = "",
    val relatedid: String? = "",
    val sellusername: String? = "",
    val userid: String? = "",
    val amount :String? = "",//点价金额=(点价价格+升贴水)*点价数量
    val pricedPrice : String? = "",//点价价格(非必填)
    val pricedQty : String? = "",//点价数量(非必填)
    var indexSelect : Int = 0,
    val reckontype : String? = "",//结算类型
    val reckonvalue : 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.readInt(),
        parcel.readString(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeString(addmargin)
        parcel.writeString(applyid)
        parcel.writeString(applyname)
        parcel.writeString(applystatus)
        parcel.writeString(applytime)
        parcel.writeString(auditname)
        parcel.writeString(audittime)
        parcel.writeString(buyusername)
        parcel.writeString(contractno)
        parcel.writeString(contractstatus)
        parcel.writeString(contracttype)
        parcel.writeString(decmargin)
        parcel.writeString(enumdicname)
        parcel.writeString(goodscode)
        parcel.writeString(goodsname)
        parcel.writeString(operateapplyid)
        parcel.writeString(operateapplytype)
        parcel.writeString(pricemove)
        parcel.writeString(pricetype)
        parcel.writeString(reckonadjustamount)
        parcel.writeString(reckonosamount)
        parcel.writeString(reckonotheramount)
        parcel.writeString(reckonrealqty)
        parcel.writeString(relatedid)
        parcel.writeString(sellusername)
        parcel.writeString(userid)
        parcel.writeString(amount)
        parcel.writeString(pricedPrice)
        parcel.writeString(pricedQty)
        parcel.writeInt(indexSelect)
        parcel.writeString(reckontype)
        parcel.writeString(reckonvalue)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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

}