package cn.muchinfo.rma.global.data

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

/**
 * 财务管理
 * @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 enumdicname String?单位名称
 * @property goodscode String?点价合约
 * @property goodsname String?商品名称
 * @property invoiceAmount 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 relatedid String?现货合同ID
 * @property sellusername String?销售方名字
 * @property userid String?用户ID
 * @constructor
 */
data class FinancialManageData(
    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 enumdicname : String? = "",
    val goodscode : String? = "",
    val goodsname : String? = "",
    val invoiceAmount : String? = "",
    val operateapplyid : String? = "",
    val operateapplytype : String? = "",
    val pricemove : String? = "",
    val pricetype : String? = "",
    val relatedid : String? = "",
    val sellusername : String? = "",
    val userid : String? = "",
    val kxtype : String? = "",//款项类型 1-收付款(PayAmount字段有值) 2-退款(DeductAmount字段有值) 3-收付款/退款(2个字段都有)
    val payamount : String? = "",//收付款(非必填)
    var indexSelect : Int = 0,
    val deductamount : 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.readInt(),
        parcel.readString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        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(enumdicname)
        parcel.writeString(goodscode)
        parcel.writeString(goodsname)
        parcel.writeString(invoiceAmount)
        parcel.writeString(operateapplyid)
        parcel.writeString(operateapplytype)
        parcel.writeString(pricemove)
        parcel.writeString(pricetype)
        parcel.writeString(relatedid)
        parcel.writeString(sellusername)
        parcel.writeString(userid)
        parcel.writeString(kxtype)
        parcel.writeString(payamount)
        parcel.writeInt(indexSelect)
        parcel.writeString(deductamount)
    }

    override fun describeContents(): Int {
        return 0
    }

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

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


}