예제 #1
0
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'user_id', 'width' => '140px', 'value' => function ($model, $key, $index, $widget) {
    return $model->user->username;
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => \yii\helpers\ArrayHelper::map(\common\models\User::find()->asArray()->orderBy('username')->all(), 'id', 'username'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Gerente'], 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Gerente de la Cuenta', 'size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'options' => ['data' => \yii\helpers\ArrayHelper::map(\common\models\User::find()->all(), 'id', 'username')]];
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'estado_id', 'label' => 'Estatus', 'width' => '100px', 'value' => function ($model, $key, $index, $widget) {
    return $model->estado->estado;
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => \yii\helpers\ArrayHelper::map(\backend\models\Estado::find()->asArray()->orderBy('estado')->all(), 'estadoid', 'estado'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Status'], 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Status', 'size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'options' => ['data' => \yii\helpers\ArrayHelper::map(\backend\models\Estado::find()->all(), 'estadoid', 'estado')]];
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'cuenta', 'label' => 'Dependencia / Entidad', 'width' => '140px', 'group' => true, 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Nombre de la Cuenta', 'size' => 'md'];
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'siglas', 'width' => '140px', 'group' => true, 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Siglas de la Cuenta', 'size' => 'md'];
}], ['class' => 'kartik\\grid\\EditableColumn', 'label' => 'Cabeza de Sector', 'attribute' => 'sector_id', 'width' => '100px', 'value' => function ($model, $key, $index, $widget) {
    return $model->sector->sector;
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => \yii\helpers\ArrayHelper::map(\backend\models\Sector::find()->asArray()->orderBy('sector')->all(), 'sectorid', 'sector'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Sector'], 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Sector', 'size' => 'md', 'inputType' => \kartik\editable\Editable::INPUT_SELECT2, 'options' => ['data' => \yii\helpers\ArrayHelper::map(\backend\models\Sector::find()->all(), 'sectorid', 'sector')]];
}], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'i2010', 'width' => '80px', 'format' => ['decimal'], 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Monto de Inversión', 'size' => 'md'];
}, 'pageSummary' => true], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'i2011', 'format' => ['decimal'], 'width' => '80px', 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Monto de Inversión', 'size' => 'md'];
}, 'pageSummary' => true], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'i2012', 'format' => ['decimal'], 'width' => '80px', 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Monto de Inversión', 'size' => 'md'];
}, 'pageSummary' => true], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'i2013', 'format' => ['decimal'], 'width' => '80px', 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Monto de Inversión', 'size' => 'md'];
}, 'pageSummary' => true], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'i2014', 'format' => ['decimal'], 'width' => '80px', 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Monto de Inversión', 'size' => 'md'];
}, 'pageSummary' => true], ['class' => 'kartik\\grid\\EditableColumn', 'attribute' => 'i2015', 'format' => ['decimal'], 'width' => '80px', 'editableOptions' => function ($model, $key, $index, $widget) {
    return ['inputType' => \kartik\editable\Editable::INPUT_TEXT, 'formOptions' => ['action' => Url::to(['cuentas/change', 'id' => $model->cuentasid])], 'header' => 'Monto de Inversión', 'size' => 'md'];
}, 'pageSummary' => true], ['class' => '\\kartik\\grid\\FormulaColumn', 'header' => 'Monto Total de Inversión', 'width' => '100px', 'value' => function ($model, $key, $index, $widget) {
    $p = compact('model', 'key', 'index');
    // Write your formula below
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getSector()
 {
     return $this->hasOne(Sector::className(), ['sectorid' => 'sector_id']);
 }
예제 #3
0
echo $form->field($model, 'subcuenta')->textInput(['maxlength' => true]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-4">
            <?php 
$lista = ArrayHelper::map(\backend\models\Tipocuenta::find()->asArray()->all(), 'tipocuentaid', 'tipocuenta');
echo $form->field($model, 'tipocuenta_id')->dropDownList($lista)->label('Tipo de Cuenta');
?>
        </div>

        <div class="col-xs-4">
            <?php 
$lista = ArrayHelper::map(\backend\models\Sector::find()->asArray()->all(), 'sectorid', 'sector');
echo $form->field($model, 'sector_id')->dropDownList($lista);
?>
        </div>

        <div class="col-xs-4">
            <?php 
$lista = ArrayHelper::map(\backend\models\Categoria::find()->asArray()->all(), 'categoriaid', 'categoria');
echo $form->field($model, 'categoria_id')->dropDownList($lista);
?>
        </div>

    </div>

    <div class="row">
        <div class="col-xs-4">
예제 #4
0
        <?php 
$form = ActiveForm::begin();
?>

        <div class="row">
            <div class="col-xs-4">

                <?php 
echo $form->field($model, 'cuenta_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\backend\models\Cuentas::find()->orderBy('cuenta')->all(), 'cuentasid', 'cuentalarga'), 'options' => ['placeholder' => 'Selecciona la cuenta'], 'pluginOptions' => ['allowClear' => true]]);
?>
            </div>

            <div class="col-xs-4">

                <?php 
echo $form->field($model, 'sectorcontacto_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(\backend\models\Sector::find()->orderBy('sector')->all(), 'sectorid', 'sector'), 'options' => ['placeholder' => 'Selecciona el sector'], 'pluginOptions' => ['allowClear' => true]]);
?>
            </div>



            <div class="row">
                <div class="col-xs-3">
                    <?php 
//Prellenando los datos de las cuentas;
$cuentas = $model->cuentasManagers;
$valores = array();
if ($cuentas !== null) {
    if (!empty($cuentas)) {
        foreach ($cuentas as $cuenta) {
            $valores[] = $cuenta->cuenta_id;