Ejemplo n.º 1
0
 public function actionTitularidad($id_uf)
 {
     $UfModel = Uf::findOne($id_uf);
     if (!empty($UfModel->ultUfTitularidad->id)) {
         $query = UfTitularidadPersonas::find()->joinWith('persona')->where(['uf_titularidad_id' => $UfModel->ultUfTitularidad->id]);
         $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['tipo' => SORT_DESC], 'enableMultiSort' => true]]);
         $response = GridView::widget(['dataProvider' => $dataProvider, 'condensed' => true, 'layout' => '{items}', 'panel' => ['type' => GridView::TYPE_INFO, 'heading' => 'Titularidad actual sobre U.F.' . $id_uf, 'footer' => false, 'before' => false, 'after' => false], 'panelHeadingTemplate' => '{heading}', 'resizableColumns' => false, 'columns' => [['attribute' => 'tipo', 'value' => function ($model) {
             return UfTitularidadPersonas::getTipos($model->tipo);
         }], 'id_persona', 'persona.apellido', 'persona.nombre', 'persona.nombre2', 'persona.tipoDoc.desc_tipo_doc_abr', 'persona.nro_doc']]);
     } else {
         $response = '';
     }
     \Yii::$app->response->format = 'json';
     return $response;
 }
Ejemplo n.º 2
0
?>

<div class="uf-titularidad-form">
    <?php 
$UfModel = Uf::findOne($model->id_uf);
if (!empty($UfModel->ultUfTitularidad->id)) {
    $puedeCambiarTipoMovim = true;
    $query = UfTitularidadPersonas::find()->joinWith('persona')->where(['uf_titularidad_id' => $UfModel->ultUfTitularidad->id]);
    $dataProvider = new ActiveDataProvider(['query' => $query, 'sort' => ['defaultOrder' => ['tipo' => SORT_DESC], 'enableMultiSort' => true]]);
    $xDefecto = UfTitularidad::findOne($UfModel->ultUfTitularidad->id);
    $model->exp_telefono = $xDefecto->exp_telefono;
    $model->exp_direccion = $xDefecto->exp_direccion;
    $model->exp_localidad = $xDefecto->exp_localidad;
    $model->exp_email = $xDefecto->exp_email;
    echo GridView::widget(['dataProvider' => $dataProvider, 'condensed' => true, 'layout' => '{items}', 'panel' => ['type' => GridView::TYPE_INFO, 'heading' => 'Titularidad actual sobre U.F.' . $model->id_uf, 'footer' => false, 'before' => false, 'after' => false], 'panelHeadingTemplate' => '{heading}', 'resizableColumns' => false, 'columns' => [['attribute' => 'tipo', 'value' => function ($model) {
        return UfTitularidadPersonas::getTipos($model->tipo);
    }], 'id_persona', 'persona.apellido', 'persona.nombre', 'persona.nombre2', 'persona.tipoDoc.desc_tipo_doc_abr', 'persona.nro_doc', 'observaciones']]);
} else {
    $puedeCambiarTipoMovim = false;
}
?>

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

			<?php 
//$form->field($model, 'id_uf')->textInput()
?>

			<div class='row'>
Ejemplo n.º 3
0
	
    <?php 
$lbl2 = '';
$pdfHeader = ['L' => ['content' => \Yii::$app->params['lblName']], 'C' => ['content' => $this->title . $lbl2, 'font-style' => 'B'], 'R' => ['content' => '']];
$pdfFooter = ['L' => ['content' => \Yii::$app->params['lblName2']], 'C' => ['content' => 'página {PAGENO} de {nb}'], 'R' => ['content' => 'Fecha:{DATE d/m/Y}']];
$columns = [['attribute' => 'id_uf', 'group' => true], ['attribute' => 'superficie', 'format' => ['decimal', 2], 'hAlign' => 'right', 'group' => true, 'subGroupOf' => 0], ['class' => '\\kartik\\grid\\FormulaColumn', 'value' => function ($model, $key, $index, $widget) {
    if ($model->unidad_estado == 0) {
        return null;
    }
    $p = compact('model', 'key', 'index');
    // Write your formula below
    global $totSup;
    return $widget->col(1, $p) / $totSup * 100;
}, 'format' => ['decimal', 3], 'label' => 'Coeficiente', 'hAlign' => 'right', 'group' => true, 'subGroupOf' => 0], ['attribute' => 'exp_telefono', 'group' => true, 'subGroupOf' => 0], ['attribute' => 'exp_direccion', 'group' => true, 'subGroupOf' => 0], ['attribute' => 'exp_localidad', 'group' => true, 'subGroupOf' => 0], ['attribute' => 'exp_email', 'format' => 'email', 'group' => true, 'subGroupOf' => 0], ['attribute' => 'tipo', 'value' => function ($model) {
    return UfTitularidadPersonas::getTipos($model->tipo);
}, 'filter' => UfTitularidadPersonas::getTipos()], 'apellido', 'nombre', 'nombre2', 'desc_tipo_doc_abr', 'nro_doc', 'observaciones'];
if (\Yii::$app->user->can('exportarListaUf')) {
    // contiene la selección inicial de columnas, es decir, todas
    // por ejemplo [0,1,2,3]
    $poSel = [];
    // contiene las descripciones de las columnas
    // por ejemplo [0=>'Portón', 1=>'Usuario',2=>'Fecha',3=>'Texto']
    $poItems = [];
    $i = -1;
    foreach ($columns as $c) {
        $i++;
        // si es un array busca la clave "attribute"
        if (is_array($c)) {
            foreach ($c as $key => $value) {
                if ($key == 'attribute') {
                    $poSel[] = $i;