From d4b1a66a9ea9e10b636a3d95a914251456e61be9 Mon Sep 17 00:00:00 2001 From: Juan Pablo Vial Date: Tue, 3 Jun 2025 16:02:04 -0400 Subject: [PATCH] FIX: ventas_ids vacios --- cli/src/Command/Ventas/MedioPagos/Toku/Reset.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cli/src/Command/Ventas/MedioPagos/Toku/Reset.php b/cli/src/Command/Ventas/MedioPagos/Toku/Reset.php index dc17d61..d27358f 100644 --- a/cli/src/Command/Ventas/MedioPagos/Toku/Reset.php +++ b/cli/src/Command/Ventas/MedioPagos/Toku/Reset.php @@ -9,7 +9,7 @@ class Reset extends Command { protected function configure(): void { - $this->addOption('venta_ids', 'vid', Console\Input\InputOption::VALUE_OPTIONAL, 'Venta IDs separated by |', ''); + $this->addOption('venta_ids', 'vid', Console\Input\InputOption::VALUE_REQUIRED, 'Venta IDs separated by |', ''); } protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int @@ -17,7 +17,11 @@ class Reset extends Command $this->logger->debug("Running {$this->getName()}"); $uri = '/api/external/toku/reset'; $output->writeln("DELETE {$uri}"); - $body = ['venta_ids' => explode('|', $input->getArgument('venta_ids'))]; + $venta_ids = $input->getOption('venta_ids'); + $body = []; + if (!empty($venta_ids)) { + $body = ['venta_ids' => explode('|', $input->getOption('venta_ids'))]; + } $options = count($body) > 0 ? ['json' => $body] : []; $response = $this->client->delete($uri, $options); $output->writeln("Response Code: {$response->getStatusCode()}");