From 64288baf540cb1a012521ee4c07b5e02d1a9af78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Jim=C3=A9nez?= Date: Wed, 18 Sep 2024 14:59:06 +0200 Subject: [PATCH] =?UTF-8?q?solucionado=20el=20problema=20del=20precio=20m?= =?UTF-8?q?=C3=ADnimo=20en=20los=20presupuestosencuadernacion.=20Falta=20e?= =?UTF-8?q?l=20resto=20de=20presupuestos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Presupuestos/PresupuestoEncuadernacionesModel.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php b/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php index 3958b2ec..f8af0109 100755 --- a/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php +++ b/ci4/app/Models/Presupuestos/PresupuestoEncuadernacionesModel.php @@ -324,6 +324,13 @@ class PresupuestoEncuadernacionesModel extends \App\Models\BaseModel $total = $precio_unidad * $ejemplares; $margen = floatval($tarifa->margen); + if($tarifa->tarifa_precio_min > $total){ + $total = $total-($total * $margen/100.0); + $margen = round(100.0 * (floatval($tarifa->tarifa_precio_min) - $total) / floatval($tarifa->tarifa_precio_min), 0); + $total = floatval($tarifa->tarifa_precio_min); + $precio_unidad = round(floatval($total / $ejemplares), 2); + } + if (!$is_POD){ $total += floatval($tarifa->tarifa_importe_fijo); }