Compare commits

..

No commits in common. "42f0cc11d499f62035c93671e26631055e03699d" and "592176765431fd6fa9308b1662e6cf28a9a2bfef" have entirely different histories.

3 changed files with 15 additions and 28 deletions

View file

@ -103,7 +103,7 @@ class SubpedidoController extends Controller
$valid = request()->validate([
'total' => 'required|min:0',
'notas' => 'min:1',
'notas' => 'required',
]);
$subpedido->syncDevoluciones($valid['total'], $valid['notas']);

View file

@ -1,9 +1,9 @@
<template>
<tr>
<td>{{ pedido.nombre }}</td>
<td v-if="$root.devoluciones" class="has-text-right" >{{ this.$limpiarInt(pedido.total) }}</td>
<td v-if="$root.devoluciones" class="has-text-right" ><abbr :title="pedido.devoluciones_notas">-{{ pedido.devoluciones_total }}</abbr></td>
<td class="has-text-right" >{{ $root.devoluciones ? pedido.total_menos_devoluciones : pedido.total }}</td>
<td class="has-text-right" >{{ this.$limpiarInt(pedido.total) }}</td>
<td class="has-text-right" ><abbr :title="pedido.devoluciones_notas">-{{ pedido.devoluciones_total }}</abbr></td>
<td class="has-text-right" >{{ pedido.total_menos_devoluciones }}</td>
<td>
<pedidos-admin-switch-aprobacion
:pedido="pedido">

View file

@ -4,9 +4,9 @@
<thead>
<tr>
<th>Núcleo</th>
<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>
<th><abbr title="Total sin tomar en cuenta las devoluciones">Total parcial $</abbr></th>
<th><abbr title="Devoluciones correspondientes al núcleo">Devoluciones $</abbr></th>
<th><abbr title="Total a Pagar por el núleo">Total real $</abbr></th>
<th class="is-1"><abbr title="Pagado">Pagado</abbr></th>
</tr>
</thead>
@ -17,19 +17,19 @@
</pedidos-admin-fila-pedido>
</tbody>
</table>
<table class="table is-striped is-bordered">
<table v-if="$root.devoluciones" class="table is-striped is-bordered">
<tr>
<th colspan="2" class="has-background-black has-text-white has-text-centered">TOTALES</th>
</tr>
<tr>
<th>Total a recaudar:</th>
<td class="has-text-right">$ {{ totalARecaudar }}</td>
<td class="has-text-right">$ {{ totalAprobadosMenosDevoluciones() }}</td>
</tr>
<tr>
<tr v-if="totalBonosBarriales > 0">
<th>Total bonos barriales:</th>
<td class="has-text-right">$ {{ totalBonosBarriales }}</td>
</tr>
<tr v-if="$root.devoluciones">
<tr v-if="totalDevoluciones() > 0">
<th>Total devoluciones:</th>
<td class="has-text-right">- $ {{ totalDevoluciones() }}</td>
</tr>
@ -39,7 +39,7 @@
</tr>
<tr>
<th>Total a depositar:</th>
<td class="has-text-right">$ {{ totalAprobadosConTransporteRecalculado() - totalBonosBarriales }}</td>
<td class="has-text-right">$ {{ totalAprobados() - totalBonosBarriales }}</td>
</tr>
</table>
</div>
@ -66,11 +66,6 @@ export default {
required: true
},
},
computed: {
totalARecaudar: function() {
return this.$root.devoluciones ? this.totalAprobadosMenosDevoluciones() : this.totalAprobados();
},
},
methods: {
totalDevoluciones() {
let suma = 0
@ -80,14 +75,6 @@ export default {
}
return suma;
},
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;
},
totalAprobadosMenosDevoluciones() {
let suma = 0
let aprobados = this.pedidos.filter(p => p.aprobado);
@ -96,7 +83,7 @@ export default {
}
return suma;
},
totalAprobadosConTransporteRecalculado() {
totalAprobados() {
let suma = 0
let aprobados = this.pedidos.filter(p => p.aprobado);
for (let i = 0; i < aprobados.length; i++) {