Mejora en look de depositos y vencidos
This commit is contained in:
@ -3,47 +3,72 @@
|
|||||||
@section('page_content')
|
@section('page_content')
|
||||||
<div class="ui container">
|
<div class="ui container">
|
||||||
<h1 class="ui header">Depósitos a Plazo</h1>
|
<h1 class="ui header">Depósitos a Plazo</h1>
|
||||||
|
</div>
|
||||||
<table class="ui table" id="depositos">
|
<div class="ui grid">
|
||||||
<thead>
|
<div class="two wide column"></div>
|
||||||
<tr>
|
<div class="twelve wide column">
|
||||||
<th>Inmobiliaria</th>
|
<table class="ui table" id="depositos">
|
||||||
<th>Banco</th>
|
<thead>
|
||||||
<th>N° Depósito</th>
|
|
||||||
<th>Capital</th>
|
|
||||||
<th>Inicio</th>
|
|
||||||
<th>Plazo</th>
|
|
||||||
<th>Vencimiento</th>
|
|
||||||
<th>Monto al Vencimiento</th>
|
|
||||||
<th>Tasa</th>
|
|
||||||
<th>
|
|
||||||
<button class="ui green icon button" id="add_button">
|
|
||||||
<i class="plus icon"></i>
|
|
||||||
</button>
|
|
||||||
</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
@foreach ($depositos as $deposito)
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{$deposito->cuenta->inmobiliaria->razon}}</td>
|
<th>Inmobiliaria</th>
|
||||||
<td>{{$deposito->cuenta->banco->nombre}}</td>
|
<th>Banco</th>
|
||||||
<td>{{$deposito->id}}</td>
|
<th>N° Depósito</th>
|
||||||
<td>{{$format->pesos($deposito->capital)}}</td>
|
<th>Capital</th>
|
||||||
<td>{{$deposito->inicio->format('d-m-Y')}}</td>
|
<th>Inicio</th>
|
||||||
<td>{{$deposito->plazo()}}</td>
|
<th>Plazo</th>
|
||||||
<td>{{$deposito->termino->format('d-m-Y')}}</td>
|
<th>Vencimiento</th>
|
||||||
<td>{{$format->pesos($deposito->futuro)}}</td>
|
<th>Vencimiento ISO</th>
|
||||||
<td>{{$format->percent($deposito->tasa() * 100, 4)}}</td>
|
<th>Monto al Vencimiento</th>
|
||||||
<td>
|
<th>Tasa</th>
|
||||||
<button class="ui red icon button remove_button" data-deposito="{{$deposito->id}}">
|
<th>
|
||||||
<i class="remove icon"></i>
|
<button class="ui green icon button" id="add_button">
|
||||||
|
<i class="plus icon"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
</thead>
|
||||||
</tbody>
|
<tbody>
|
||||||
</table>
|
@foreach ($activos as $deposito)
|
||||||
|
<tr>
|
||||||
|
<td>{{$deposito->cuenta->inmobiliaria->razon}}</td>
|
||||||
|
<td>{{$deposito->cuenta->banco->nombre}}</td>
|
||||||
|
<td>{{$deposito->id}}</td>
|
||||||
|
<td>{{$format->pesos($deposito->capital)}}</td>
|
||||||
|
<td>{{$deposito->inicio->format('d-m-Y')}}</td>
|
||||||
|
<td>{{$deposito->plazo()}}</td>
|
||||||
|
<td>{{$deposito->termino->format('d-m-Y')}}</td>
|
||||||
|
<td>{{$deposito->termino->format('Y-m-d')}}</td>
|
||||||
|
<td>{{$format->pesos($deposito->futuro)}}</td>
|
||||||
|
<td>{{$format->percent($deposito->tasa() * 100, 4)}}</td>
|
||||||
|
<td>
|
||||||
|
<button class="ui red icon button remove_button" data-deposito="{{$deposito->id}}">
|
||||||
|
<i class="remove icon"></i>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
@foreach ($vencidos as $deposito)
|
||||||
|
<tr class="yellow">
|
||||||
|
<td>{{$deposito->cuenta->inmobiliaria->razon}}</td>
|
||||||
|
<td>{{$deposito->cuenta->banco->nombre}}</td>
|
||||||
|
<td>{{$deposito->id}}</td>
|
||||||
|
<td>{{$format->pesos($deposito->capital)}}</td>
|
||||||
|
<td>{{$deposito->inicio->format('d-m-Y')}}</td>
|
||||||
|
<td>{{$deposito->plazo()}}</td>
|
||||||
|
<td>{{$deposito->termino->format('d-m-Y')}}</td>
|
||||||
|
<td>{{$deposito->termino->format('Y-m-d')}}</td>
|
||||||
|
<td>{{$format->pesos($deposito->futuro)}}</td>
|
||||||
|
<td>{{$format->percent($deposito->tasa() * 100, 4)}}</td>
|
||||||
|
<td>
|
||||||
|
<button class="ui red icon button remove_button" data-deposito="{{$deposito->id}}">
|
||||||
|
<i class="remove icon"></i>
|
||||||
|
</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="ui modal" id="add_modal">
|
<div class="ui modal" id="add_modal">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -208,7 +233,10 @@
|
|||||||
$(this.ids.forms.add.inicio).calendar(calendar_date_options)
|
$(this.ids.forms.add.inicio).calendar(calendar_date_options)
|
||||||
$(this.ids.forms.add.termino).calendar(calendar_date_options)
|
$(this.ids.forms.add.termino).calendar(calendar_date_options)
|
||||||
|
|
||||||
$(this.ids.table).dataTable()
|
$(this.ids.table).dataTable({
|
||||||
|
columnDefs: [{target: 7, visible: false, searchable: false}],
|
||||||
|
order: [[7, 'desc'], [0, 'asc']]
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$(document).ready(() => {
|
$(document).ready(() => {
|
||||||
|
@ -8,6 +8,7 @@ use Psr\Http\Message\ResponseInterface;
|
|||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Incoviba\Common\Alias\View;
|
use Incoviba\Common\Alias\View;
|
||||||
use Incoviba\Common\Implement\Exception\{EmptyResult, EmptyRedis};
|
use Incoviba\Common\Implement\Exception\{EmptyResult, EmptyRedis};
|
||||||
|
use Incoviba\Model;
|
||||||
use Incoviba\Repository;
|
use Incoviba\Repository;
|
||||||
use Incoviba\Service;
|
use Incoviba\Service;
|
||||||
|
|
||||||
@ -50,7 +51,15 @@ class Contabilidad extends Controller
|
|||||||
try {
|
try {
|
||||||
$depositos = $dapRepository->fetchAll();
|
$depositos = $dapRepository->fetchAll();
|
||||||
} catch (EmptyResult) {}
|
} catch (EmptyResult) {}
|
||||||
return $view->render($response, 'contabilidad.depositos', compact('inmobiliarias', 'depositos'));
|
$fecha = new DateTimeImmutable('today');
|
||||||
|
$activos = array_filter($depositos, function(Model\Deposito $deposito) use ($fecha) {
|
||||||
|
return $deposito->termino >= $fecha;
|
||||||
|
});
|
||||||
|
$mes = $fecha->sub(new DateInterval('P1M'));
|
||||||
|
$vencidos = array_filter($depositos, function(Model\Deposito $deposito) use ($fecha, $mes) {
|
||||||
|
return $deposito->termino < $fecha and $deposito->termino >= $mes;
|
||||||
|
});
|
||||||
|
return $view->render($response, 'contabilidad.depositos', compact('inmobiliarias', 'activos', 'vencidos'));
|
||||||
}
|
}
|
||||||
public function tesoreria(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
public function tesoreria(ServerRequestInterface $request, ResponseInterface $response, View $view,
|
||||||
Service\Contabilidad\Informe\Tesoreria $contabilidadService,
|
Service\Contabilidad\Informe\Tesoreria $contabilidadService,
|
||||||
|
Reference in New Issue
Block a user