diff --git a/.gitignore b/.gitignore index af528155..ba89ba36 100755 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,8 @@ *.jrxml *.jasper vouchers_oxxo/ -comprobantes/ +comprobantes/* +!comprobantes/.gitkeep pack-plugin-versioned.php *.txt Callbell Public API.postman_collection.json diff --git a/comprobantes/.gitkeep b/comprobantes/.gitkeep new file mode 100644 index 00000000..35636d60 --- /dev/null +++ b/comprobantes/.gitkeep @@ -0,0 +1 @@ +# Keep directory in git diff --git a/public.php b/public.php index 10d3cf42..46281208 100755 --- a/public.php +++ b/public.php @@ -394,6 +394,15 @@ if (isset($_GET['action'])) { 'description' => mb_substr($job['description'] ?? '', 0, 80) ]; } + // Ordenar por fecha descendente (de más reciente a más antiguo) + usort($result, function ($a, $b) { + $dateA = $a['date'] ?? ''; + $dateB = $b['date'] ?? ''; + if ($dateA === $dateB) { + return 0; + } + return ($dateA > $dateB) ? -1 : 1; + }); echo json_encode($result); } catch (\Exception $e) { echo json_encode([]); @@ -477,7 +486,67 @@ $installersData = json_decode($config['installersDataWhatsApp'] ?? '{"instalador SIIP - Notificaciones y Pagos +