コード例 #1
0
ファイル: index.php プロジェクト: kaihatsusha/kpimon
}, 'value' => function ($model) {
    $amount = $model->account_source == 0 ? '' : NumberUtils::format($model->entry_value);
    return $amount;
}], ['label' => Yii::t('fin.grid', 'Credit Account'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right', 'colspan' => 2], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getJarPaymentStatusColorRow($model->entry_status, $index)];
}, 'value' => function ($model) use($arrAccount) {
    return isset($arrAccount[$model->account_target]) ? $arrAccount[$model->account_target] : '';
}, 'footer' => $htmlFooterCredit], ['class' => DataColumn::className(), 'label' => Yii::t('fin.grid', 'Credit Amount'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['colspan' => 0], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getJarPaymentStatusColorRow($model->entry_status, $index)];
}, 'value' => function ($model) {
    $amount = $model->account_target == 0 ? '' : NumberUtils::format($model->entry_value);
    return $amount;
}], ['attribute' => 'description', 'label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: left', 'class' => MasterValueUtils::getJarPaymentStatusColorRow($model->entry_status, $index)];
}, 'enableSorting' => false], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
    return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getJarPaymentStatusColorRow($model->entry_status, $index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
    $btnClass = MasterValueUtils::getColorRow($index);
    $lblView = Yii::t('button', 'View');
    $lblEdit = Yii::t('button', 'Edit');
    $urlEdit = null;
    $arrBtns = [];
    $entryId = $model->id;
    if ($model->share_id > 0) {
        $urlEdit = BaseUrl::toRoute(['distribute/update', 'id' => $model->share_id]);
    } else {
        $urlEdit = BaseUrl::toRoute(['payment/update', 'id' => $entryId]);
    }
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
    $urlView = BaseUrl::toRoute(['payment/view', 'id' => $entryId]);
    $arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);