EVOLUTION-MANAGER
Edit File: resultado_deuda.blade.php
@if(!is_null($resultado->contribuyente)) <style type="text/css"> .nav-tabs .nav-item { margin-bottom: -1px; } li { display: list-item; text-align: -webkit-match-parent; } .btn_verde{ background-color: #47d04c !important; color: #ffff !important; } .btn_verde:hover{ background-color: #0f8c2c !important; } </style> <div class="row" style="margin-top: 5%;"> <div class="col-lg-4 col-md-12 col-sm-12"> <div class="row clearfix"> <div class="col-lg-12 col-md-12"> <div class="card" style="margin: 0.2%;"> <div class="card-header" style="background: #47d04c;color: white;"> <h5>Deuda General Total:</h5> </div> <div class="card-body"> <div class="front p-3 px-4"> <div class="py-4 m-0 text-center h1" style="color: #0f8c2c;"> {{-- ${{ number_format($resultado->total,2,'.','') }} --}} ${{ number_format($total_pagar,2,'.','') }} {{-- @if(floatval($resultado->total)>0) --}} @if(floatval($total_pagar)>0) <!--<a href="http://online.sucre.gob.ec/"> <img src="{{asset('/public/consultar_deuda.png') }}" alt="" class="col-lg-4" style="margin-bottom: 0%; width: 80%;"> </a> --> <br> <a class="btn btn_verde bnt-lg" href="https://enlinea.sucre.gob.ec/pago/externo?dni={{$resultado->contribuyente->idn}}" target="_blank" rel="nofollow"> <i class="fa fa-money"> Realizar pago</i> </a> @endif </div> <div class="d-flex"> <small class="text-muted">Incluye Intereses,recargos y descuentos</small> </div> </div> </div> </div> </div> <div class="col-lg-12 col-md-12"> <div class="card" style="margin: 0.2%;"> <div class="card-header" style="background: #47d04c;color: white;"> <h5>Datos de Contribuyente:</h5> </div> <div class="card-body"> <table class="table"> <tr> <td style="font-weight: bold;">Apellidos y Nombres:</td> <td> {{ $resultado->contribuyente->nombres }}</td> </tr> <tr> <td style="font-weight: bold;">Cédula/Ruc</td> <td> {{ $resultado->contribuyente->idn }}</td> </tr> <tr> <td style="font-weight: bold;">Dirección</td> <td> {{ $resultado->contribuyente->direccion }}</td> </tr> </table> </div> </div> </div> </div> </div> <div class="col-md-8"> @if(count($resultado->titulo)) @foreach($resultado->titulo as $clave) @php $clave_catastral=(string) $clave->clave; $detalles=collect($clave->detalles); $actual=$detalles->where('anio',intval(date('Y')))->whereNotIn('tipo_impuesto_id', [1,2])->where('emi01esta','E')->sum('total')+$detalles->where('anio',intval(date('Y')))->whereIn('tipo_impuesto_id', [1,2])->where('saldo','>',0)->sum('saldo'); $anterior=$detalles->where('anio','<',intval(date('Y')))->whereNotIn('tipo_impuesto_id', [1,2])->where('emi01esta','E')->sum('total')+$detalles->where('anio','<',intval(date('Y')))->whereIn('tipo_impuesto_id', [1,2])->where('saldo','>',0)->sum('saldo'); $detalles=$detalles->groupBy('tipo_impuesto_id'); @endphp <div class="card" style="margin: 0.2%;"> <div class="card-header" style="background: #47d04c;color: white;"> <h2 style="color: white;">CLAVE: {{$clave->detalles[0]->clave}}</h2> </div> <div class="card-body row"> <div class="col-md-6"> <center><h2>Información</h2></center> <table class="table"> <tr> @if($clave->detalles[0]->tipo_impuesto_id==1||$clave->detalles[0]->tipo_impuesto_id==2) <td style="font-weight: bold;">Número de Suministro:</td> @else <td style="font-weight: bold;">Clave Catastral:</td> @endif <td>{{$clave->detalles[0]->clave }}</td> </tr> <tr> <td style="font-weight: bold;">Dirección:</td> <td> {{ $clave->direccion }}</td> </tr> <tr> <td style="font-weight: bold;">Calle Principal:</td> <td> {{ $clave->calle_principal }}</td> </tr> <tr> <td style="font-weight: bold;">Calle Secundaria:</td> <td> {{ $clave->calle_principal }}</td> </tr> <tr> <td style="font-weight: bold;">Avaluo:</td> <td> {{ $clave->avaluo }}</td> </tr> </table> <div class="row"> <div class="col-md-12" align="center"> <div class="ibox"> <div class="card" style="margin: 0.2%;"> <div class="card-header" style="background: #47d04c;color: white;"> <h5>Deuda Actual:</h5> </div> <div class="card-body"> <h2 class="no-margins">$ {{ number_format($actual,2,'.','') }}</h2> </div> </div> <div class="card" style="margin: 0.2%;"> <div class="card-header" style="background: #47d04c;color: white;"> <h5>Deuda Años Anteriores:</h5> </div> <div class="card-body"> <h2 class="no-margins">$ {{ number_format($anterior,2,'.','') }}</h2> </div> </div> <div class="card" style="margin: 0.2%;"> <div class="card-header" style="background: #47d04c;color: white;"> <h5>Deuda Total:</h5> </div> <div class="card-body"> <h2 class="no-margins">$ {{ number_format($anterior+$actual,2,'.','') }}</h2> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <center><h2>Deudas</h2></center> <ul class="nav nav-tabs"> @php $activo=false; @endphp @foreach($detalles as $emisiones) <li class="nav-item"> @if($activo==false) <a class="nav-link active show" data-toggle="tab" href="#imp{{ $emisiones[0]->tipo_impuesto_id }}">{{ $emisiones[0]->tipo_impuesto }}</a> @php $activo=true; @endphp @else <a class="nav-link" data-toggle="tab" href="#imp{{ $emisiones[0]->tipo_impuesto_id }}">{{ $emisiones[0]->tipo_impuesto }}</a> @endif </li> @endforeach </ul> <div class="tab-content"> @php $activo=false; @endphp @foreach($detalles as $emisiones) @if($activo==false) @php $activo=true; @endphp <div class="tab-pane show active" id="imp{{ $emisiones[0]->tipo_impuesto_id }}"> @else <div class="tab-pane" id="imp{{ $emisiones[0]->tipo_impuesto_id }}"> @endif <div class="table-responsive" style="height:500px; overflow:auto;"> <table class="table table-bordered table-hover"> <thead> <tr> @if($emisiones[0]->tipo_impuesto_id==1||$emisiones[0]->tipo_impuesto_id==2) <th>AÑO/MES</th> @else <th>AÑO</th> @endif <th>VALOR</th> <th>VALOR PAGADO</th> <th>SALDO</th> </tr> </thead> <tbody> @php $tot=0; @endphp @foreach($emisiones as $emi) @php if(isset($emi->abono)&&($emisiones[0]->tipo_impuesto_id==1||$emisiones[0]->tipo_impuesto_id==2)){ //dd($emi); $pagado=$emi->abono; $saldo=$emi->saldo; }else{ $pagado=($emi->emi01esta=='E') ? 0 : $emi->total; $saldo=$emi->total-$pagado; } $colorx=($saldo>0) ? '#0f8c2c' : 'black'; @endphp @if(intval($emi->anio)==intval(date('Y'))) <tr style="font-weight: bolder;color: #0f8c2c;"> @else <tr> @endif @if($emisiones[0]->tipo_impuesto_id==1||$emisiones[0]->tipo_impuesto_id==2) <td>{{ $emi->anio."/".obtener_mes($emi->mes) }}</td> @else <td>{{ $emi->anio }}</td> @endif <td style="text-align: right;">{{ number_format($emi->total,2,'.','') }}</td> <td style="text-align: right;">{{ number_format($pagado,2,'.','') }}</td> <td style="text-align: right;color: {{ $colorx }}">{{ number_format($saldo,2,'.','') }}</td> </tr> @php $tot+=$saldo; @endphp @endforeach @php $color=($tot>0) ? '#0f8c2c' : 'black'; @endphp </tbody> </table> </div> </div> @endforeach </div> </div> </div> </div> @endforeach @else <center><h3>NO SE ENCONTRARON DEUDAS AL MUNICIPIO DEL DATO INGRESADO</h3></center> @endif </div> </div> @else <center><h1>NO SE ENCONTRÓ RESULTADOS</h1></center> @endif