コード例 #1
0
ファイル: journal.php プロジェクト: chaimvaid/linet3
use app\models\Transactions;
use yii\grid\GridView;
use yii\data\ActiveDataProvider;
/* * *********************************************************************************
 * The contents of this file are subject to the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
 * ("License"); You may not use this file except in compliance with the GNU AFFERO GENERAL PUBLIC LICENSE Version 3
 * The Original Code is:  Linet 3.0 Open Source
 * The Initial Developer of the Original Code is Adam Ben Hur.
 * All portions are Copyright (C) Adam Ben Hur.
 * All Rights Reserved.
 * ********************************************************************************** */
app\widgets\MiniForm::begin(array('header' => Yii::t('app', "Transactions")));
echo app\widgets\GridView::widget(['dataProvider' => $model->search([]), 'filterModel' => $model, 'id' => 'transactions-grid', 'columns' => array(array('attribute' => 'num'), 'linenum', array('attribute' => 'type', 'filter' => \yii\helpers\ArrayHelper::map(\app\models\TransactionType::find()->All(), 'id', 'name'), 'value' => function ($data) {
    return Yii::t("app", $data->ttype->name);
}), array('attribute' => 'account_id', 'value' => function ($data) {
    return \yii\helpers\Html::a(\app\models\Accounts::findName($data->account_id), yii\helpers\BaseUrl::base() . ("/accounts/transaction/" . $data->account_id));
}, 'format' => 'raw'), array('attribute' => 'refnum1', 'value' => function ($data) {
    return $data->refnumDocsLink();
}, 'format' => 'raw'), 'refnum2', 'details', ['attribute' => 'valuedate', 'filterType' => \kartik\grid\GridView::FILTER_DATE_RANGE, 'filterWidgetOptions' => ['convertFormat' => true, 'useWithAddon' => true, 'pluginOptions' => ['format' => 'Y-m-d', 'separator' => ' to '], 'hideInput' => true, 'presetDropdown' => false], 'width' => '150px', 'value' => function ($data) {
    return $data->readDateFormat($data->valuedate);
}], ['attribute' => 'reg_date', 'filterType' => \kartik\grid\GridView::FILTER_DATE_RANGE, 'filterWidgetOptions' => ['convertFormat' => true, 'useWithAddon' => true, 'pluginOptions' => ['format' => 'Y-m-d', 'separator' => ' to '], 'hideInput' => true, 'presetDropdown' => false], 'width' => '150px', 'value' => function ($data) {
    return $data->readDateFormat($data->reg_date);
}], array('header' => Yii::t('app', 'Debit'), 'attribute' => 'sum', 'filter' => '', 'value' => function ($data) {
    return $data->sum < 0 ? $data->sum : "";
}), array('header' => Yii::t('app', 'Credit'), 'attribute' => 'sum', 'filter' => '', 'value' => function ($data) {
    return $data->sum > 0 ? $data->sum : "";
}))]);
?>

<?php 
app\widgets\MiniForm::end();
コード例 #2
0
<tr>
    <td>
        <?php 
use app\models\ItemVatCat;
use app\models\Accounts;
echo ItemVatCat::findName($model->itemVatCat_id);
//echo $form->hiddenField($model, "[$i]itemVatCat_id");
?>
    </td>
    <td>
        <?php 
echo Accounts::findName($model->account_id);
?>
    </td> 
</tr>