From 3770d728c31b41d34b8d4a3608e0cbe5b00443c4 Mon Sep 17 00:00:00 2001 From: ale Date: Thu, 5 Sep 2024 13:52:31 -0300 Subject: [PATCH] =?UTF-8?q?Mejoras=20en=20c=C3=A1lculo=20de=20cantidad=20d?= =?UTF-8?q?e=20bonos=20de=20transporte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/GrupoDeCompra.php | 2 +- app/Subpedido.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/GrupoDeCompra.php b/app/GrupoDeCompra.php index 8ab1f9c..1e6a60b 100644 --- a/app/GrupoDeCompra.php +++ b/app/GrupoDeCompra.php @@ -97,7 +97,7 @@ class GrupoDeCompra extends Model foreach ($this->pedidosAprobados() as $pedido) { $total += $pedido->totalParaTransporte(); } - return ceil($total / 500); + return $total ? floor($total / 500) + 1 : 0; } public function totalBonosBarriales() { diff --git a/app/Subpedido.php b/app/Subpedido.php index 136716f..bc3d7bf 100644 --- a/app/Subpedido.php +++ b/app/Subpedido.php @@ -53,7 +53,7 @@ class Subpedido extends Model $total += $producto->precio * $producto->pivot->cantidad; } } - return ceil($total); + return $total ? floor($total) + 1 : 0; } //Cantidad de bonos de transporte