From 45757f0ae1da319c21b2a60672f7d0a3c5d21d63 Mon Sep 17 00:00:00 2001 From: ale Date: Tue, 18 Mar 2025 23:01:03 -0300 Subject: [PATCH] Agregado redondeo --- app/Http/Resources/GrupoDeCompraResource.php | 10 +++++----- app/Http/Resources/SubpedidoResource.php | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/Http/Resources/GrupoDeCompraResource.php b/app/Http/Resources/GrupoDeCompraResource.php index f7440e2..3ff9cce 100644 --- a/app/Http/Resources/GrupoDeCompraResource.php +++ b/app/Http/Resources/GrupoDeCompraResource.php @@ -19,11 +19,11 @@ class GrupoDeCompraResource extends JsonResource 'nombre' => $this->nombre, 'devoluciones_habilitadas' => $this->devoluciones_habilitadas, 'pedidos' => SubpedidoResource::collection($this->subpedidos), - 'total_a_recaudar' => $this->totalARecaudar(), - 'total_barrial' => $this->totalBarrial(), - 'total_devoluciones' => $this->totalDevoluciones(), - 'total_a_transferir' => $this->totalATransferir(), - 'total_transporte' => $this->totalTransporte(), + 'total_a_recaudar' => number_format($this->totalARecaudar(),2), + 'total_barrial' => number_format($this->totalBarrial(),2), + 'total_devoluciones' => number_format($this->totalDevoluciones(),2), + 'total_a_transferir' => number_format($this->totalATransferir(),2), + 'total_transporte' => number_format($this->totalTransporte(),0), 'cantidad_transporte' => number_format($this->cantidadTransporte(),0), ]; } diff --git a/app/Http/Resources/SubpedidoResource.php b/app/Http/Resources/SubpedidoResource.php index 484cc33..d0da61f 100644 --- a/app/Http/Resources/SubpedidoResource.php +++ b/app/Http/Resources/SubpedidoResource.php @@ -20,11 +20,11 @@ class SubpedidoResource extends JsonResource 'grupo_de_compra' => $this->grupoDeCompra, 'productos' => $this->productos, 'aprobado' => (bool) $this->aprobado, - 'total' => $this->total(), - 'total_transporte' => $this->totalTransporte(), + 'total' => number_format($this->total(),2), + 'total_transporte' => number_format($this->totalTransporte(),0), 'cantidad_transporte' => number_format($this->cantidadTransporte(),0), - 'total_sin_devoluciones' => $this->totalSinDevoluciones(), - 'devoluciones_total' => $this->devoluciones_total, + 'total_sin_devoluciones' => number_format($this->totalSinDevoluciones(),2), + 'devoluciones_total' => number_format($this->devoluciones_total,2), 'devoluciones_notas' => $this->devoluciones_notas ]; }