Compare commits
	
		
			2 commits
		
	
	
		
			5921767654
			...
			42f0cc11d4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 42f0cc11d4 | |||
| 05d13008fb | 
					 3 changed files with 28 additions and 15 deletions
				
			
		|  | @ -103,7 +103,7 @@ class SubpedidoController extends Controller | ||||||
| 
 | 
 | ||||||
|         $valid = request()->validate([ |         $valid = request()->validate([ | ||||||
|             'total' => 'required|min:0', |             'total' => 'required|min:0', | ||||||
|             'notas' => 'required', |             'notas' => 'min:1', | ||||||
|         ]); |         ]); | ||||||
|         $subpedido->syncDevoluciones($valid['total'], $valid['notas']); |         $subpedido->syncDevoluciones($valid['total'], $valid['notas']); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,9 +1,9 @@ | ||||||
| <template> | <template> | ||||||
|     <tr> |     <tr> | ||||||
|         <td>{{ pedido.nombre }}</td> |         <td>{{ pedido.nombre }}</td> | ||||||
|         <td class="has-text-right" >{{ this.$limpiarInt(pedido.total) }}</td> |         <td v-if="$root.devoluciones" 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 v-if="$root.devoluciones" 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 class="has-text-right" >{{ $root.devoluciones ? pedido.total_menos_devoluciones : pedido.total }}</td> | ||||||
|         <td> |         <td> | ||||||
|             <pedidos-admin-switch-aprobacion |             <pedidos-admin-switch-aprobacion | ||||||
|                 :pedido="pedido"> |                 :pedido="pedido"> | ||||||
|  |  | ||||||
|  | @ -4,9 +4,9 @@ | ||||||
|             <thead> |             <thead> | ||||||
|             <tr> |             <tr> | ||||||
|                 <th>Núcleo</th> |                 <th>Núcleo</th> | ||||||
|                 <th><abbr title="Total sin tomar en cuenta las devoluciones">Total parcial $</abbr></th> |                 <th v-if="$root.devoluciones"><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 v-if="$root.devoluciones"><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><abbr title="Total a Pagar por el núleo">{{ $root.devoluciones ? 'Total real' : 'Total' }} $</abbr></th> | ||||||
|                 <th class="is-1"><abbr title="Pagado">Pagado</abbr></th> |                 <th class="is-1"><abbr title="Pagado">Pagado</abbr></th> | ||||||
|             </tr> |             </tr> | ||||||
|         </thead> |         </thead> | ||||||
|  | @ -17,19 +17,19 @@ | ||||||
|             </pedidos-admin-fila-pedido> |             </pedidos-admin-fila-pedido> | ||||||
|         </tbody> |         </tbody> | ||||||
|         </table> |         </table> | ||||||
|         <table v-if="$root.devoluciones" class="table is-striped is-bordered"> |         <table class="table is-striped is-bordered"> | ||||||
|             <tr> |             <tr> | ||||||
|                 <th colspan="2" class="has-background-black has-text-white has-text-centered">TOTALES</th> |                 <th colspan="2" class="has-background-black has-text-white has-text-centered">TOTALES</th> | ||||||
|             </tr> |             </tr> | ||||||
|             <tr> |             <tr> | ||||||
|                 <th>Total a recaudar:</th> |                 <th>Total a recaudar:</th> | ||||||
|                 <td class="has-text-right">$ {{ totalAprobadosMenosDevoluciones() }}</td> |                 <td class="has-text-right">$ {{ totalARecaudar }}</td> | ||||||
|             </tr> |             </tr> | ||||||
|             <tr v-if="totalBonosBarriales > 0"> |             <tr> | ||||||
|                 <th>Total bonos barriales:</th> |                 <th>Total bonos barriales:</th> | ||||||
|                 <td class="has-text-right">$ {{ totalBonosBarriales }}</td> |                 <td class="has-text-right">$ {{ totalBonosBarriales }}</td> | ||||||
|             </tr> |             </tr> | ||||||
|             <tr v-if="totalDevoluciones() > 0"> |             <tr v-if="$root.devoluciones"> | ||||||
|                 <th>Total devoluciones:</th> |                 <th>Total devoluciones:</th> | ||||||
|                 <td class="has-text-right">- $ {{ totalDevoluciones() }}</td> |                 <td class="has-text-right">- $ {{ totalDevoluciones() }}</td> | ||||||
|             </tr> |             </tr> | ||||||
|  | @ -39,7 +39,7 @@ | ||||||
|             </tr> |             </tr> | ||||||
|             <tr> |             <tr> | ||||||
|                 <th>Total a depositar:</th> |                 <th>Total a depositar:</th> | ||||||
|                 <td class="has-text-right">$ {{ totalAprobados() - totalBonosBarriales }}</td> |                 <td class="has-text-right">$ {{ totalAprobadosConTransporteRecalculado() - totalBonosBarriales }}</td> | ||||||
|             </tr> |             </tr> | ||||||
|         </table> |         </table> | ||||||
|     </div> |     </div> | ||||||
|  | @ -66,6 +66,11 @@ export default { | ||||||
|             required: true |             required: true | ||||||
|         }, |         }, | ||||||
|     }, |     }, | ||||||
|  |     computed: { | ||||||
|  |         totalARecaudar: function() { | ||||||
|  |             return this.$root.devoluciones ? this.totalAprobadosMenosDevoluciones() : this.totalAprobados(); | ||||||
|  |         }, | ||||||
|  |     }, | ||||||
|     methods: { |     methods: { | ||||||
|         totalDevoluciones() { |         totalDevoluciones() { | ||||||
|             let suma = 0 |             let suma = 0 | ||||||
|  | @ -75,6 +80,14 @@ export default { | ||||||
|             } |             } | ||||||
|             return suma; |             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() { |         totalAprobadosMenosDevoluciones() { | ||||||
|             let suma = 0 |             let suma = 0 | ||||||
|             let aprobados = this.pedidos.filter(p => p.aprobado); |             let aprobados = this.pedidos.filter(p => p.aprobado); | ||||||
|  | @ -83,7 +96,7 @@ export default { | ||||||
|             } |             } | ||||||
|             return suma; |             return suma; | ||||||
|         }, |         }, | ||||||
|         totalAprobados() { |         totalAprobadosConTransporteRecalculado() { | ||||||
|             let suma = 0 |             let suma = 0 | ||||||
|             let aprobados = this.pedidos.filter(p => p.aprobado); |             let aprobados = this.pedidos.filter(p => p.aprobado); | ||||||
|             for (let i = 0; i < aprobados.length; i++) { |             for (let i = 0; i < aprobados.length; i++) { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue