<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%INVOICE_AUDIT}}".
 *
 * @property string $ID
 * @property string $USER_ID 会员ID
 * @property string $WITHDRAW_ID 提现ID
 * @property string $INVOICE_CODE 发票代码
 * @property string $INVOICE_NUM 发票号码
 * @property string $INVOICE_DATE 开票日期
 * @property string $AMOUNT 交易金额
 * @property string $TAX_RATE 税率
 * @property string $PURCHASER_NAME 购买方名称
 * @property string $PURCHASER_REGISTER_NUM 购买方纳税人识别号
 * @property string $PURCHASER_ADDRESS 购买方地址电话
 * @property string $PURCHASER_BANK 购买方开户行及帐号
 * @property string $SELLER_NAME 销售方名称
 * @property string $SELLER_REGISTER_NUM 销售方纳税人识别号
 * @property string $SELLER_ADDRESS 销售方地址电话
 * @property string $SELLER_BANK 销售方开户行及帐号
 * @property string $ITEM_NAME 货物或应税劳务、服务名称
 * @property string $INVOICE_REMARK 发票备注
 * @property string $UPLOAD_ID 上传ID
 * @property int $AUDIT_STATUS 审核状态
 * @property string $CREATE_ADMIN 创建管理员
 * @property string $AUDIT_ADMIN 审核管理员
 * @property string $CREATE_REMARK 申请备注
 * @property string $AUDIT_REMARK 审核备注
 * @property int $CREATED_AT 创建时间
 * @property int $AUDITED_AT 审核时间
 */
class InvoiceAudit extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%INVOICE_AUDIT}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['USER_ID', 'WITHDRAW_ID', 'INVOICE_CODE', 'INVOICE_NUM', 'INVOICE_DATE', 'PURCHASER_NAME', 'PURCHASER_REGISTER_NUM', 'PURCHASER_ADDRESS', 'PURCHASER_BANK', 'SELLER_NAME', 'SELLER_REGISTER_NUM', 'SELLER_ADDRESS', 'SELLER_BANK', 'ITEM_NAME', 'CREATED_AT'], 'required'],
            [['AMOUNT'], 'number'],
            [['AUDIT_STATUS', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
            [['ID', 'USER_ID', 'WITHDRAW_ID', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
            [['INVOICE_CODE', 'INVOICE_NUM', 'INVOICE_DATE', 'PURCHASER_NAME', 'PURCHASER_REGISTER_NUM', 'PURCHASER_ADDRESS', 'PURCHASER_BANK', 'SELLER_NAME', 'SELLER_REGISTER_NUM', 'SELLER_ADDRESS', 'SELLER_BANK', 'ITEM_NAME', 'INVOICE_REMARK', 'UPLOAD_ID'], 'string', 'max' => 255],
            [['TAX_RATE'], 'string', 'max' => 10],
            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
            [['ID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '会员ID',
            'WITHDRAW_ID' => '提现ID',
            'INVOICE_CODE' => '发票代码',
            'INVOICE_NUM' => '发票号码',
            'INVOICE_DATE' => '开票日期',
            'AMOUNT' => '交易金额',
            'TAX_RATE' => '税率',
            'PURCHASER_NAME' => '购买方名称',
            'PURCHASER_REGISTER_NUM' => '购买方纳税人识别号',
            'PURCHASER_ADDRESS' => '购买方地址电话',
            'PURCHASER_BANK' => '购买方开户行及帐号',
            'SELLER_NAME' => '销售方名称',
            'SELLER_REGISTER_NUM' => '销售方纳税人识别号',
            'SELLER_ADDRESS' => '销售方地址电话',
            'SELLER_BANK' => '销售方开户行及帐号',
            'ITEM_NAME' => '货物或应税劳务、服务名称',
            'INVOICE_REMARK' => '发票备注',
            'UPLOAD_ID' => '上传ID',
            'AUDIT_STATUS' => '审核状态',
            'CREATE_ADMIN' => '创建管理员',
            'AUDIT_ADMIN' => '审核管理员',
            'CREATE_REMARK' => '申请备注',
            'AUDIT_REMARK' => '审核备注',
            'CREATED_AT' => '创建时间',
            'AUDITED_AT' => '审核时间',
        ];
    }
}
