<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%INVOICE_FLOW}}".
 *
 * @property string $ID
 * @property string $USER_ID 会员ID
 * @property string $REAL_NAME 会员姓名
 * @property string $DEC_LV 报单级别
 * @property string $EMP_LV 聘级
 * @property string $MOBILE 手机号
 * @property string $REG_TYPE 注册类型
 * @property string $REG_NAME 注册名称
 * @property string $CREDIT_CODE 统一社会信用代码
 * @property string $SALE_NAME 销售方名称
 * @property string $TAXPAYER_NUMBER 纳税人识别号
 * @property string $INVOICE_ACCOUNT 交易账户-发票账户
 * @property string $INVOICE_SN 发票号
 * @property string $TAX_ACCOUNT 交易账户-税款账户
 * @property int $OUTED_AT 开票日期
 * @property int $DEDUCT_PERIOD_NUM 发票冲减期数
 * @property string $AMOUNT 金额
 * @property string $TOTAL 当前总金额
 * @property string $WITHDRAW_SN 提现流水号
 * @property int $IS_INCR 是否增加
 * @property string $REMARK 备注
 * @property int $PERIOD_NUM 所在期数
 * @property int $CALC_MONTH 所在结算月
 * @property string $CREATE_ADMIN 创建人
 * @property string $CREATE_REMARK 创建备注
 * @property int $CREATE_TIME 创建时间
 * @property string $AUDIT_ADMIN 审核人
 * @property string $AUDIT_REMARK 审核备注
 * @property int $AUDIT_TIME 审核时间
 * @property string $P_MONTH 表分区的日期索引
 * @property int $CREATED_AT 创建时间
 */
class InvoiceFlow extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%INVOICE_FLOW}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['USER_ID', 'REAL_NAME', 'DEC_LV', 'EMP_LV', 'MOBILE', 'REG_TYPE', 'REG_NAME', 'CREDIT_CODE', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'CREATE_ADMIN', 'CREATE_TIME', 'AUDIT_ADMIN', 'AUDIT_TIME', 'P_MONTH', 'CREATED_AT'], 'required'],
            [['OUTED_AT', 'DEDUCT_PERIOD_NUM', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATE_TIME', 'AUDIT_TIME', 'CREATED_AT'], 'integer'],
            [['AMOUNT', 'TOTAL'], 'number'],
            [['ID', 'USER_ID', 'DEC_LV', 'EMP_LV', 'MOBILE', 'REG_TYPE', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
            [['REAL_NAME'], 'string', 'max' => 128],
            [['REG_NAME', 'CREDIT_CODE', 'SALE_NAME', 'TAXPAYER_NUMBER', 'INVOICE_ACCOUNT', 'INVOICE_SN', 'TAX_ACCOUNT', 'WITHDRAW_SN', 'REMARK'], 'string', 'max' => 255],
            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
            [['P_MONTH'], 'string', 'max' => 7],
            [['ID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '会员ID',
            'REAL_NAME' => '会员姓名',
            'DEC_LV' => '报单级别',
            'EMP_LV' => '聘级',
            'MOBILE' => '手机号',
            'REG_TYPE' => '注册类型',
            'REG_NAME' => '注册名称',
            'CREDIT_CODE' => '统一社会信用代码',
            'SALE_NAME' => '销售方名称',
            'TAXPAYER_NUMBER' => '纳税人识别号',
            'INVOICE_ACCOUNT' => '交易账户-发票账户',
            'INVOICE_SN' => '发票号',
            'TAX_ACCOUNT' => '交易账户-税款账户',
            'OUTED_AT' => '开票日期',
            'DEDUCT_PERIOD_NUM' => '发票冲减期数',
            'AMOUNT' => '金额',
            'TOTAL' => '当前总金额',
            'WITHDRAW_SN' => '提现流水号',
            'IS_INCR' => '是否增加',
            'REMARK' => '备注',
            'PERIOD_NUM' => '所在期数',
            'CALC_MONTH' => '所在结算月',
            'CREATE_ADMIN' => '创建人',
            'CREATE_REMARK' => '创建备注',
            'CREATE_TIME' => '创建时间',
            'AUDIT_ADMIN' => '审核人',
            'AUDIT_REMARK' => '审核备注',
            'AUDIT_TIME' => '审核时间',
            'P_MONTH' => '表分区的日期索引',
            'CREATED_AT' => '创建时间',
        ];
    }
}
