예제 #1
0
use app\components\Toolbar;
use app\models\purchase\Purchase;
use app\models\master\Branch;
use app\models\master\Supplier;
use app\components\ActionToolbar;
/* @var $this yii\web\View */
/* @var $searchModel app\models\purchase\searchs\Purchase */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Purchases';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="row purchase-index">
    <section class="col-lg-12">
        <?php 
echo Toolbar::widget(['items' => [['label' => '', 'url' => ['print-html'], 'icon' => 'fa fa-print', 'linkOptions' => ['class' => 'btn btn-default btn-sm disabled', 'target' => '_blank', 'title' => 'Html Print']], ['label' => '', 'url' => ['print-pdf'], 'icon' => 'fa fa-file', 'linkOptions' => ['class' => 'btn btn-default btn-sm disabled', 'target' => '_blank', 'title' => 'Export to Pdf']], ['label' => '', 'url' => ['print-xsl'], 'icon' => 'fa fa-table', 'linkOptions' => ['class' => 'btn btn-default btn-sm disabled', 'target' => '_blank', 'title' => 'Export to Excel']]]]) . '&nbsp;&nbsp;';
echo ActionToolbar::widget(['items' => [['label' => 'Create New', 'url' => ['create', 'type' => 100], 'icon' => 'fa fa-plus-square'], ['label' => 'Update', 'url' => ['update'], 'icon' => 'fa fa-pencil', 'linkOptions' => ['class' => 'disabled']], ['label' => 'Delete', 'url' => ['delete'], 'icon' => 'fa fa-trash-o', 'linkOptions' => ['class' => 'disabled', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]], ['label' => 'PO List', 'url' => ['index'], 'icon' => 'fa fa-list', 'linkOptions' => ['class' => 'disabled']]]]);
?>
        <div class="box box-info">
            <div class="box-body no-padding">
                <?php 
\yii\widgets\Pjax::begin(['enablePushState' => false]);
?>
                <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'layout' => "{items}\n{pager}", 'tableOptions' => ['class' => 'table table-striped'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'number', ['attribute' => 'supplier_id', 'value' => 'supplier.name', 'filter' => Supplier::selectOptions()], ['attribute' => 'branch_id', 'value' => 'branch.name', 'filter' => Branch::selectOptions()], 'date:date', 'value:currency', ['attribute' => 'status', 'format' => 'raw', 'value' => function ($data) {
    $color = $data->status == Purchase::STATUS_DRAFT ? 'danger' : 'success';
    $color = $data->status == Purchase::STATUS_CONFIRMED ? 'warning' : $color;
    $color = $data->status == Purchase::STATUS_PROCESS ? 'info' : $color;
    $color = $data->status == Purchase::STATUS_CLOSE ? 'success' : $color;
    return Html::tag('small', $data->nmStatus, ['class' => 'label label-' . $color]);
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>
예제 #2
0
    #tabular-input input{
        text-align: right;
    }
</style>
<div class="col-lg-12 price-create">
    <?php 
echo Html::beginForm('', '', ['id' => 'price-form']);
?>
    <?php 
echo Html::errorSummary($products);
?>
    <?php 
echo Toolbar::widget(['items' => [['label' => 'Save', 'icon' => 'fa fa-save', 'linkOptions' => ['class' => 'btn btn-warning btn-sm', 'id' => 'save']]]]);
?>
    <?php 
echo ActionToolbar::widget(['items' => [['label' => 'Create', 'url' => ['create'], 'icon' => 'fa fa-plus-square'], ['label' => 'Purchase List', 'url' => ['index'], 'icon' => 'fa fa-list'], ['linkOptions' => ['class' => 'divider']], ['label' => 'Others', 'icon' => 'fa fa-check']]]);
?>
    
    <div class="box box-info">
        <div class="box-body">
            <?php 
echo Html::textInput('number', $purchase->number);
?>
            <?php 
echo Html::textInput('nmSupplier', $purchase->nmSupplier);
?>
        </div>
    </div>
    <div class="box box-info">
        <div class="box-body no-padding">
            <div id="w0" class="grid-view">
예제 #3
0
use app\components\Toolbar;
use app\components\ActionToolbar;
use app\models\master\Warehouse;
use app\models\inventory\GoodsMovement;
/* @var $this yii\web\View */
/* @var $form yii\widgets\ActiveForm */
/* @var $model app\models\purchase\Purchase */
?>

<?php 
$toolbar_items = $model->isNewRecord ? [['label' => 'Create', 'linkOptions' => ['id' => 'create', 'class' => 'btn btn-success btn-sm']]] : [];
$toolbar_items = !$model->isNewRecord && $model->status == GoodsMovement::STATUS_DRAFT && ($this->context->action->id == 'create' || $this->context->action->id == 'update') ? array_merge($toolbar_items, [['label' => 'Save Update', 'linkOptions' => ['id' => 'save', 'class' => 'btn btn-success btn-sm']]]) : array_merge($toolbar_items, [['label' => 'Save Update', 'linkOptions' => ['id' => 'save', 'class' => 'btn btn-primary btn-sm disabled']]]);
$toolbar_items = !$model->isNewRecord && $model->status == GoodsMovement::STATUS_DRAFT && $this->context->action->id == 'view' ? array_merge($toolbar_items, [['label' => 'Apply', 'url' => ['apply', 'id' => $model->id], 'linkOptions' => ['id' => 'apply', 'class' => 'btn btn-success btn-sm', 'data' => ['confirm' => 'Are you sure you want to apply this item..?', 'method' => 'post']]]]) : array_merge($toolbar_items, [['label' => 'Apply', 'linkOptions' => ['id' => 'apply', 'class' => 'btn btn-primary btn-sm disabled']]]);
echo Toolbar::widget(['items' => $toolbar_items]) . '&nbsp;&nbsp;';
echo Toolbar::widget(['items' => [['label' => '', 'url' => ['print-html'], 'icon' => 'fa fa-print', 'linkOptions' => ['class' => 'btn btn-default btn-sm disabled', 'target' => '_blank', 'title' => 'Html Print']], ['label' => '', 'url' => ['print-pdf'], 'icon' => 'fa fa-file', 'linkOptions' => ['class' => 'btn btn-default btn-sm disabled', 'target' => '_blank', 'title' => 'Export to Pdf']], ['label' => '', 'url' => ['print-xsl'], 'icon' => 'fa fa-table', 'linkOptions' => ['class' => 'btn btn-default btn-sm disabled', 'target' => '_blank', 'title' => 'Export to Excel']]]]) . '&nbsp;&nbsp;';
echo ActionToolbar::widget(['items' => [['label' => 'Create New', 'url' => ['create'], 'icon' => 'fa fa-plus-square'], ['label' => 'Update', 'url' => ['update', 'id' => $model->id], 'icon' => 'fa fa-pencil'], ['label' => 'Delete', 'url' => ['delete', 'id' => $model->id], 'icon' => 'fa fa-trash-o', 'linkOptions' => ['data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]], ['label' => 'Goods Movement List', 'url' => ['index'], 'icon' => 'fa fa-list']]]);
?>
<div class="box box-primary" style="min-height: 160px; margin-bottom: 20px; padding-top: 20px;">
    <div class="box-body">
        <div class="col-lg-6">
            <?php 
echo $form->field($model, 'number')->textInput(['readonly' => true, 'style' => 'width:30%;']);
?>
            <?php 
if (isset($config['branch_field'])) {
    $branch_id = $model->reffDoc->{$config['branch_field']};
} else {
    $branch_id = null;
}
echo $form->field($model, 'warehouse_id')->dropDownList(Warehouse::selectOptions($branch_id));
?>