From 0ce766a9ebd56220262d17b02804624b937cf2fa Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Tue, 30 Jun 2026 19:35:12 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20kilos=20por=20lotes=20con=20selecci?= =?UTF-8?q?=C3=B3n=20de=20per=C3=ADodo=20(mes=20actual/anterior/personaliz?= =?UTF-8?q?ado)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add last_month date_mode to executeApiReport - prod_kilos_lotes now shows period menu instead of immediately asking dates - lotes_mes_actual / lotes_mes_anterior use api_report with date_mode - lotes_personalizado collects fecha_desde + fecha_hasta (2 messages only when needed) Co-Authored-By: Claude Sonnet 4.6 --- services/NormalBot.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/NormalBot.php b/services/NormalBot.php index 9d2ca4c..fd0f821 100644 --- a/services/NormalBot.php +++ b/services/NormalBot.php @@ -783,6 +783,9 @@ class NormalBot } elseif ($dateMode === 'current_month') { $extraQuery['fecha_desde'] = date('Y-m-01'); $extraQuery['fecha_hasta'] = date('Y-m-d'); + } elseif ($dateMode === 'last_month') { + $extraQuery['fecha_desde'] = date('Y-m-01', strtotime('first day of last month')); + $extraQuery['fecha_hasta'] = date('Y-m-t', strtotime('last day of last month')); } $extraQuery['telefono'] = $context['from']; $extraQuery['nombre'] = $context['name'] ?? '';