2023-07-24 20:55:26 -04:00
|
|
|
@extends('layout.base')
|
|
|
|
|
|
|
|
@section('page_content')
|
|
|
|
<div class="ui container">
|
|
|
|
<h4 class="ui header">Bienvenid@ {{$user->name}}</h4>
|
|
|
|
<div class="ui basic fitted segment">
|
2023-10-11 09:03:44 -03:00
|
|
|
<span id="cuotas_hoy"></span>
|
|
|
|
<span id="cuotas_pendientes"></span>
|
2023-07-24 20:55:26 -04:00
|
|
|
</div>
|
|
|
|
<div class="ui two column grid">
|
|
|
|
<div class="column">
|
|
|
|
@include('home.cuotas_por_vencer')
|
2024-06-11 13:21:50 -04:00
|
|
|
@include('home.cierres_vigentes')
|
2023-07-24 20:55:26 -04:00
|
|
|
</div>
|
2023-10-11 09:03:44 -03:00
|
|
|
<div class="column">
|
2023-10-19 18:20:37 -03:00
|
|
|
@include('home.alertas')
|
2023-10-11 09:03:44 -03:00
|
|
|
</div>
|
2023-07-24 20:55:26 -04:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
@endsection
|
2023-10-11 09:03:44 -03:00
|
|
|
|
|
|
|
@push('page_scripts')
|
2025-07-22 13:18:00 +00:00
|
|
|
<script>
|
2023-10-11 09:03:44 -03:00
|
|
|
const cuotas = {
|
|
|
|
get: function() {
|
|
|
|
return {
|
|
|
|
hoy: () => {
|
|
|
|
const span = $('#cuotas_hoy')
|
2023-11-25 00:55:31 -03:00
|
|
|
return fetchAPI('{{$urls->api}}/ventas/cuotas/hoy').then(response => {
|
2023-10-11 09:03:44 -03:00
|
|
|
span.html('')
|
|
|
|
if (response.ok) {
|
|
|
|
return response.json()
|
|
|
|
}
|
|
|
|
}).then(data => {
|
|
|
|
let output = 'Existe'
|
|
|
|
if (data.cuotas > 1) {
|
|
|
|
output += 'n'
|
|
|
|
}
|
|
|
|
output += ' ' + data.cuotas + ' deposito'
|
|
|
|
if (data.cuotas > 1) {
|
|
|
|
output += 's'
|
|
|
|
}
|
|
|
|
output += ' para hoy.<br />'
|
|
|
|
span.html(output)
|
|
|
|
})
|
|
|
|
},
|
|
|
|
pendiente: () => {
|
|
|
|
const span = $('#cuotas_pendientes')
|
2023-11-25 00:55:31 -03:00
|
|
|
return fetchAPI('{{$urls->api}}/ventas/cuotas/pendiente').then(response => {
|
2023-10-11 09:03:44 -03:00
|
|
|
span.html('')
|
|
|
|
if (response.ok) {
|
|
|
|
return response.json()
|
|
|
|
}
|
|
|
|
}).then(data => {
|
|
|
|
const link = $('<a></a>').attr('href', '{{$urls->base}}/ventas/cuotas/pendientes')
|
|
|
|
let output = 'Existe'
|
|
|
|
if (data.cuotas > 1) {
|
|
|
|
output += 'n'
|
|
|
|
}
|
|
|
|
output += ' ' + data.cuotas + ' cuota'
|
|
|
|
if (data.cuotas > 1) {
|
|
|
|
output += 's'
|
|
|
|
}
|
|
|
|
output += ' pendiente'
|
|
|
|
if (data.cuotas > 1) {
|
|
|
|
output += 's'
|
|
|
|
}
|
|
|
|
output += ' por cobrar. <i class="right arrow icon"></i>'
|
|
|
|
link.html(output)
|
|
|
|
span.html(link)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
run: function() {
|
|
|
|
this.get().hoy()
|
|
|
|
this.get().pendiente()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$(document).ready(() => {
|
|
|
|
cuotas.run()
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
@endpush
|