Example #1
0
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\accounting\search\PaymentMethod */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Payment Methods';
$this->params['breadcrumbs'][] = $this->title;
?>
<p class='pull-right'>
    <?php 
echo Html::a('Create Payment Method', ['create'], ['class' => 'btn btn-default']);
?>
</p>
<br>

<div class="payment-method-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'branch_id', 'label' => 'Branch', 'value' => 'branch.name', 'filter' => backend\models\master\Branch::selectOptions()], ['label' => 'Paymnt Method', 'attribute' => 'method'], ['label' => 'Target Account', 'value' => function ($model) {
    return $model->coa->code . ' - ' . $model->coa->name;
}], ['label' => 'Potongan', 'value' => function ($model) {
    return $model->potongan > 0 ? $model->potongan * 100 . '%' : '-';
}], ['label' => 'Target Account Potongan', 'value' => function ($model) {
    return $model->coaPotongan !== null ? $model->coaPotongan->code . ' - ' . $model->coaPotongan->name : '-';
}], 'created_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
Example #2
0
/* @var $this yii\web\View */
/* @var $searchModel backend\models\sales\search\Sales */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Saless';
$this->params['breadcrumbs'][] = $this->title;
?>
<p class='pull-right'>
    <?php 
echo Html::a('Create Sales', ['create'], ['class' => 'btn btn-default']);
?>
</p>
<br>

<div class="sales-index">

    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
$totaLine = 0;
foreach ($dataProvider->getModels() as $key => $val) {
    $totaLine += $val->value;
}
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-hover'], 'filterModel' => $searchModel, 'showFooter' => true, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['label' => 'Sales Num', 'format' => 'html', 'attribute' => 'number', 'value' => function ($model) {
    return Html::a($model->number, ['view', 'id' => $model->id]);
}, 'headerOptions' => ['style' => 'text-align:right; width:10%;']], ['attribute' => 'Date', 'headerOptions' => ['style' => 'text-align:right; width:10%;'], 'filter' => \yii\jui\DatePicker::widget(['model' => $searchModel, 'attribute' => 'Date', 'dateFormat' => 'dd-MM-yyyy', 'options' => ['class' => 'form-control']]), 'format' => 'html'], ['attribute' => 'branch_id', 'value' => 'branch.name', 'filter' => backend\models\master\Branch::selectAssignedOptions()], ['attribute' => 'vendor_id', 'value' => 'vendor.name', 'filter' => false], ['attribute' => 'value', 'format' => ['decimal', 0], 'headerOptions' => ['style' => 'text-align:right; width:20%;'], 'contentOptions' => ['style' => 'text-align:right;'], 'footerOptions' => ['style' => 'text-align:right;', 'class' => 'text-bold'], 'footer' => number_format($totaLine, 0), 'filter' => false]]]);
?>

</div>
Example #3
0
<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\accounting\search\GlHeader */
/* @var $form yii\widgets\ActiveForm */
?>

<?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>
<td style="width: 10%;"><?php 
echo $form->field($model, 'number')->label(false);
//Html::textInput('no', '', ['class' => 'form-control'])
?>
</td>
<td >
    <?php 
echo $form->field($model, 'branch_id')->dropDownList(backend\models\master\Branch::selectAssignedOptions())->label(false);
?>
</td>
<td >
    <?php 
echo Html::submitButton('Search', ['class' => 'btn btn-primary']);
?>
</td>

<?php 
ActiveForm::end();
Example #4
0
use yii\helpers\Html;
use yii\widgets\ActiveForm;
/* @var $this yii\web\View */
/* @var $model backend\models\accounting\PaymentMethod */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="payment-method-form col-lg-6">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, 'branch_id')->dropDownList(backend\models\master\Branch::selectOptions(), ['style' => 'width:30%;']);
?>

    <?php 
echo $form->field($model, 'method')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'coa_id')->dropDownList(backend\models\accounting\Coa::selectOptions(), ['style' => 'width:80%;']);
?>

    <?php 
echo $form->field($model, 'potongan')->textInput(['maxlength' => true, 'style' => 'width:30%;'])->label('Nilai Potongan');
?>

    <?php