2022-11-12 21:16:35 -03:00
|
|
|
<template>
|
2023-10-05 12:58:03 -03:00
|
|
|
<div>
|
|
|
|
<table class="table is-fullwidth is-striped is-bordered">
|
2022-11-12 21:16:35 -03:00
|
|
|
<thead>
|
2023-10-05 12:58:03 -03:00
|
|
|
<tr>
|
|
|
|
<th>Núcleo</th>
|
2024-07-17 16:46:31 -03:00
|
|
|
<th v-if="$root.devoluciones"><abbr title="Total sin tomar en cuenta las devoluciones">Total parcial $</abbr></th>
|
|
|
|
<th v-if="$root.devoluciones"><abbr title="Devoluciones correspondientes al núcleo">Devoluciones $</abbr></th>
|
|
|
|
<th><abbr title="Total a Pagar por el núleo">{{ $root.devoluciones ? 'Total real' : 'Total' }} $</abbr></th>
|
2024-07-11 19:55:14 -03:00
|
|
|
<th class="is-1"><abbr title="Pagado">Pagado</abbr></th>
|
2023-10-05 12:58:03 -03:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-07-11 19:55:14 -03:00
|
|
|
<pedidos-admin-fila-pedido
|
|
|
|
v-for="pedido in this.pedidos"
|
|
|
|
:pedido="pedido" :key="pedido.id">
|
|
|
|
</pedidos-admin-fila-pedido>
|
2023-10-05 12:58:03 -03:00
|
|
|
</tbody>
|
2022-11-12 21:16:35 -03:00
|
|
|
</table>
|
2024-07-17 16:46:31 -03:00
|
|
|
<table class="table is-striped is-bordered">
|
2023-10-05 12:58:03 -03:00
|
|
|
<tr>
|
|
|
|
<th colspan="2" class="has-background-black has-text-white has-text-centered">TOTALES</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<th>Total a recaudar:</th>
|
2024-07-17 16:46:31 -03:00
|
|
|
<td class="has-text-right">$ {{ totalARecaudar }}</td>
|
2023-10-05 12:58:03 -03:00
|
|
|
</tr>
|
2024-07-17 16:46:31 -03:00
|
|
|
<tr>
|
2023-10-05 12:58:03 -03:00
|
|
|
<th>Total bonos barriales:</th>
|
|
|
|
<td class="has-text-right">$ {{ totalBonosBarriales }}</td>
|
|
|
|
</tr>
|
2024-07-17 16:46:31 -03:00
|
|
|
<tr v-if="$root.devoluciones">
|
2023-10-05 12:58:03 -03:00
|
|
|
<th>Total devoluciones:</th>
|
|
|
|
<td class="has-text-right">- $ {{ totalDevoluciones() }}</td>
|
|
|
|
</tr>
|
2024-07-11 19:55:14 -03:00
|
|
|
<tr>
|
|
|
|
<th>Total bonos de transporte:</th>
|
|
|
|
<td class="has-text-right">$ {{ bonosDeTransporte * 15 }}</td>
|
|
|
|
</tr>
|
2023-10-05 12:58:03 -03:00
|
|
|
<tr>
|
|
|
|
<th>Total a depositar:</th>
|
2024-07-17 16:46:31 -03:00
|
|
|
<td class="has-text-right">$ {{ totalAprobadosConTransporteRecalculado() - totalBonosBarriales }}</td>
|
2023-10-05 12:58:03 -03:00
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</div>
|
2022-11-12 21:16:35 -03:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-11-13 17:00:24 -03:00
|
|
|
import PedidosAdminFilaPedidoVue from './PedidosAdminFilaPedido.vue';
|
2022-11-12 21:16:35 -03:00
|
|
|
export default {
|
|
|
|
name: "PedidosAdminTablaPedidos",
|
2022-11-13 17:00:24 -03:00
|
|
|
components: {
|
|
|
|
PedidosAdminFilaPedidoVue
|
|
|
|
},
|
2022-11-12 21:16:35 -03:00
|
|
|
props: {
|
|
|
|
pedidos: {
|
|
|
|
type: Array,
|
|
|
|
required: true
|
2023-05-24 15:01:31 -03:00
|
|
|
},
|
|
|
|
bonosDeTransporte: {
|
|
|
|
type: Number,
|
|
|
|
required: true
|
|
|
|
},
|
2023-10-04 22:37:59 -03:00
|
|
|
totalBonosBarriales: {
|
|
|
|
type: Number,
|
|
|
|
required: true
|
|
|
|
},
|
2022-11-12 21:16:35 -03:00
|
|
|
},
|
2024-07-17 16:46:31 -03:00
|
|
|
computed: {
|
|
|
|
totalARecaudar: function() {
|
|
|
|
return this.$root.devoluciones ? this.totalAprobadosMenosDevoluciones() : this.totalAprobados();
|
|
|
|
},
|
|
|
|
},
|
2022-11-12 21:16:35 -03:00
|
|
|
methods: {
|
2023-10-05 12:58:03 -03:00
|
|
|
totalDevoluciones() {
|
|
|
|
let suma = 0
|
|
|
|
let aprobados = this.pedidos.filter(p => p.aprobado);
|
|
|
|
for (let i = 0; i < aprobados.length; i++) {
|
2024-07-11 19:55:14 -03:00
|
|
|
suma += aprobados[i].devoluciones_total
|
2023-10-05 12:58:03 -03:00
|
|
|
}
|
|
|
|
return suma;
|
|
|
|
},
|
2024-07-17 16:46:31 -03:00
|
|
|
totalAprobados() {
|
|
|
|
let suma = 0
|
|
|
|
let aprobados = this.pedidos.filter(p => p.aprobado);
|
|
|
|
for (let i = 0; i < aprobados.length; i++) {
|
|
|
|
suma += this.$limpiarFloat(aprobados[i].total)
|
|
|
|
}
|
|
|
|
return suma;
|
|
|
|
},
|
2023-10-05 12:58:03 -03:00
|
|
|
totalAprobadosMenosDevoluciones() {
|
|
|
|
let suma = 0
|
|
|
|
let aprobados = this.pedidos.filter(p => p.aprobado);
|
|
|
|
for (let i = 0; i < aprobados.length; i++) {
|
2024-07-11 19:55:14 -03:00
|
|
|
suma += this.$limpiarFloat(aprobados[i].total_menos_devoluciones)
|
2023-10-05 12:58:03 -03:00
|
|
|
}
|
|
|
|
return suma;
|
|
|
|
},
|
2024-07-17 16:46:31 -03:00
|
|
|
totalAprobadosConTransporteRecalculado() {
|
2023-10-04 22:37:59 -03:00
|
|
|
let suma = 0
|
|
|
|
let aprobados = this.pedidos.filter(p => p.aprobado);
|
2022-11-12 21:16:35 -03:00
|
|
|
for (let i = 0; i < aprobados.length; i++) {
|
2024-07-11 19:55:14 -03:00
|
|
|
suma += this.$limpiarFloat(aprobados[i].total)
|
|
|
|
suma -= this.$limpiarFloat(aprobados[i].subtotal_bonos_de_transporte)
|
2022-11-12 21:16:35 -03:00
|
|
|
}
|
2023-05-24 15:01:31 -03:00
|
|
|
suma += parseInt(this.bonosDeTransporte)*15
|
2022-11-12 21:16:35 -03:00
|
|
|
return suma;
|
|
|
|
}
|
2023-05-24 15:01:31 -03:00
|
|
|
},
|
2022-11-12 21:16:35 -03:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
2024-07-11 18:34:20 -03:00
|
|
|
</style>
|