예제 #1
0
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="col-lg-12">
    <div class='btn-group pull-right'>
        <?php 
echo Html::button('New Good Movement', ['class' => 'btn bg-aqua', 'type' => 'button']);
?>
        
        <?php 
echo Html::button('<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>', ['class' => 'btn btn-default dropdown-toggle', 'aria-expanded' => false, 'type' => 'button', 'data-toggle' => 'dropdown']);
?>
        <ul class="dropdown-menu" role="menu">
            <li><?php 
echo Html::a('Receive', ['create', 'type' => $searchModel::TYPE_RECEIVE]);
?>
</li>
            <li><?php 
echo Html::a('Issue', ['create', 'type' => $searchModel::TYPE_ISSUE]);
?>
</li>
        </ul>        
    </div>
</div>
<br><br>
<div class="col-lg-12 goods-movement-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'number', 'nmReffType', ['attribute' => 'warehouse_id', 'value' => 'warehouse.name', 'filter' => Warehouse::selectOptions()], ['attribute' => 'vendor_id', 'value' => 'vendor.name'], 'Date', ['attribute' => 'type', 'value' => 'nmType', 'filter' => GoodsMovement::enums('TYPE_')], ['attribute' => 'status', 'value' => 'nmStatus', 'filter' => GoodsMovement::enums('STATUS_')], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
예제 #2
0
<?php

use yii\helpers\Html;
use yii\grid\GridView;
use backend\models\inventory\GoodsMovement;
use backend\models\master\Warehouse;
/* @var $this yii\web\View */
/* @var $searchModel GoodsMovement */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = $searchModel->type == GoodsMovement::TYPE_RECEIVE ? 'Penerimaan' : 'Mutasi';
$this->title = $searchModel->type == GoodsMovement::TYPE_ISSUE ? 'Pengeluaran' : $this->title;
$this->title .= ' Barang';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="col-lg-12">
    <div class='btn-group pull-right'>
        <?php 
echo $searchModel->type ? Html::a($searchModel->type == GoodsMovement::TYPE_RECEIVE ? 'Penerimaan Baru' : 'Pengeluaran Baru', ['inventory/gm-manual/create', 'type' => $searchModel->type], ['class' => 'btn btn-default']) : '';
?>
    </div>
</div>
<br><br>
<div class="col-lg-12 goods-movement-index">
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'number', ['attribute' => 'type', 'value' => 'nmType', 'filter' => GoodsMovement::enums('TYPE_')], 'description', ['attribute' => 'warehouse_id', 'value' => 'warehouse.name', 'filter' => Warehouse::selectOptions()], ['attribute' => 'vendor_id', 'value' => 'vendor.name', 'filter' => \backend\models\master\Vendor::selectOptions()], 'date', ['attribute' => 'status', 'value' => 'nmStatus', 'filter' => GoodsMovement::enums('STATUS_')], ['label' => 'Invoice Number', 'format' => 'raw', 'value' => function ($model) {
    return $model->invoice != null ? Html::a($model->invoice->number, ['/accounting/invoice/view', 'id' => $model->invoice->id]) : '';
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>