Auth, Login, Home, Venta->Listados->Precios
This commit is contained in:
108
app/resources/views/ventas/cuotas/pendientes.blade.php
Normal file
108
app/resources/views/ventas/cuotas/pendientes.blade.php
Normal file
@ -0,0 +1,108 @@
|
||||
@extends('layout.base')
|
||||
|
||||
@section('page_content')
|
||||
<div class="ui container">
|
||||
<h3 class="ui header">Cuotas Pendientes</h3>
|
||||
<div class="ui grid">
|
||||
<div class="two wide column">Total</div>
|
||||
<div class="column">{{count($cuotas_pendientes)}}</div>
|
||||
<div class="column">{{$format->pesos(array_reduce($cuotas_pendientes, function($sum, $cuota) {return $sum + $cuota['Valor'];}, 0))}}</div>
|
||||
</div>
|
||||
<table class="ui striped table" id="cuotas">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="two wide column">Proyecto</th>
|
||||
<th class="column">Departamento</th>
|
||||
<th>Departamento Sort</th>
|
||||
<th class="column">Valor</th>
|
||||
<th class="column">Día</th>
|
||||
<th class="column">Cuota</th>
|
||||
<th class="two wide column">Propietario</th>
|
||||
<th class="column">Banco</th>
|
||||
<th class="two wide column">Fecha Cheque (Días)</th>
|
||||
<th>Fecha ISO</th>
|
||||
<th class="column">Depositar</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($cuotas_pendientes as $cuota)
|
||||
<tr>
|
||||
<td>{{$cuota['Proyecto']}}</td>
|
||||
<td>
|
||||
<a href="{{$urls->base}}/venta/{{$cuota['venta_id']}}">
|
||||
{{$cuota['Departamento']}}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{str_pad($cuota['Departamento'], 4, '0', STR_PAD_LEFT)}}</td>
|
||||
<td>{{$format->pesos($cuota['Valor'])}}</td>
|
||||
<td>{{$cuota['Dia']}}</td>
|
||||
<td>{{$cuota['Numero']}}</td>
|
||||
<td>{{$cuota['Propietario']}}</td>
|
||||
<td>{{$cuota['Banco']}}</td>
|
||||
<td>{{$cuota['Fecha Cheque']}} ({{$cuota['Vencida']}})</td>
|
||||
<td>{{$cuota['Fecha ISO']}}</td>
|
||||
<td>
|
||||
<button class="ui icon button depositar" data-cuota="{{$cuota['id']}}">
|
||||
<i class="currency icon"></i>
|
||||
</button>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('layout.head.styles.datatables')
|
||||
@include('layout.body.scripts.datatables')
|
||||
|
||||
@push('page_scripts')
|
||||
<script type="text/javascript">
|
||||
$(document).ready(() => {
|
||||
const cuotas_tables = new DataTable('#cuotas', {
|
||||
language: {
|
||||
info: 'Mostrando página _PAGE_ de _PAGES_',
|
||||
infoEmpty: 'No hay cuotas pendientes',
|
||||
infoFiltered: '(filtrado de _MAX_ cuotas)',
|
||||
lengthMenu: 'Mostrando de a _MENU_ cuotas',
|
||||
zeroRecords: 'No se encotró cuotas con ese criterio',
|
||||
search: 'Buscar: '
|
||||
},
|
||||
columnDefs: [
|
||||
{
|
||||
target: 9,
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
target: 2,
|
||||
visible: false,
|
||||
searchable: false
|
||||
}
|
||||
],
|
||||
order: [
|
||||
[9, 'desc'],
|
||||
[0, 'asc'],
|
||||
[2, 'asc']
|
||||
]
|
||||
})
|
||||
$('.depositar.button').click(event => {
|
||||
const button = $(event.currentTarget)
|
||||
const cuota_id = button.data('cuota')
|
||||
fetch('{{$urls->base}}/ventas/cuota/depositar', {
|
||||
method: 'post', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({cuota_id})
|
||||
}).then(response => {
|
||||
if (response.ok) {
|
||||
return response.json()
|
||||
}
|
||||
}).then(data => {
|
||||
if (data.depositada) {
|
||||
const button = $(".depositar.button[data-cuota='" + data.cuota_id + "']")
|
||||
const cell = button.parent()
|
||||
const row = cell.parent()
|
||||
cuotas_tables.row(row).remove().draw()
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
Reference in New Issue
Block a user