Exemple #1
0
     */
    public function getInvoiceDtls()
    {
        return $this->hasMany(InvoiceDtl::className(), ['invoice_id' => 'id']);
    }
    public function getNmReffType()
    {
        if (($config = $this->reffConfig) !== null) {
            return isset($config['name']) ? $config['name'] : null;
        }
        return null;
    }
    public function getReffLink()
    {
        if (($config = $this->reffConfig) !== null && isset($config['link'])) {
            return $this->reffDoc ? Html::a($this->reffDoc->number, [$config['link'], 'id' => $this->reffDoc->id]) : null;
        }
        return null;
    }
    /**
     * @inheritdoc
     */
    public function behaviors()
    {
        $behaviors = parent::behaviors();
        return array_merge($behaviors, [['class' => 'mdm\\converter\\DateConverter', 'attributes' => ['Date' => 'date', 'DueDate' => 'due_date']], ['class' => 'mdm\\converter\\EnumConverter', 'attributes' => ['nmType' => 'type'], 'enumPrefix' => 'TYPE_']]);
    }
}
// Extend reference
Configs::merge('invoice', '@app/config/biz/invoice.php');
    {
        if (($config = $this->reffConfig) !== null && isset($config['link'])) {
            return $this->reffDoc ? Html::a($this->reffDoc->number, [$config['link'], 'id' => $this->reffDoc->id]) : null;
        }
        return null;
    }
    /**
     * 
     * @param sting $name
     * @return boolean
     */
    public function visibleButton($name)
    {
        switch ($name) {
            case 'update':
            case 'delete':
            case 'apply':
                return $this->status == static::STATUS_DRAFT;
            default:
                return true;
        }
    }
    public function behaviors()
    {
        $behaviors = parent::behaviors();
        return array_merge($behaviors, [['class' => 'mdm\\converter\\DateConverter', 'attributes' => ['Date' => 'date']], ['class' => 'mdm\\converter\\EnumConverter', 'attributes' => ['nmType' => 'type'], 'enumPrefix' => 'TYPE_']]);
    }
}
// Extend reference
Configs::merge('movement', '@app/config/biz/movement.php');