Add Bookings & Revenue reporting module
PHP Tests / php-tests (push) Has been cancelled

New modules/reporting Filament page: filterable bookings table (travel
date range, status, route, channel) with CSV/Excel export. Report
columns include booking ref, route, passenger name/count, price,
best-payment status/amount, and driver info, plus a TOTAL row summing
passenger count, price, and payment amount in both export formats.

- BookingsRevenueExport backs both CSV and XLSX via maatwebsite/excel
  ^4.0 (the only version compatible with PHP 8.5; 3.1.x caps
  phpoffice/phpspreadsheet below 8.5).
- CSV export writes a UTF-8 BOM so non-Latin passenger names (Burmese)
  open correctly in Excel.
- New view_reports permission (super_admin/admin/support) gates the
  page; new indexes on bookings.travel_date/status/created_by_channel
  and payments.completed_at support the report's filters.
This commit is contained in:
Nyan Lin Paing
2026-08-23 22:32:49 +07:00
parent da9cd9bbe0
commit 0e55e36cea
12 changed files with 956 additions and 1 deletions
@@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Supports the Bookings & Revenue report's filters travel_date/status/
* created_by_channel on bookings and completed_at on payments had no
* standalone index before this (only openid and the composite
* [ev_route_id, travel_date, departure_time_slot_id] existed).
*/
public function up(): void
{
Schema::table('bookings', function (Blueprint $table) {
$table->index('travel_date');
$table->index('status');
$table->index('created_by_channel');
});
Schema::table('payments', function (Blueprint $table) {
$table->index('completed_at');
});
}
public function down(): void
{
Schema::table('bookings', function (Blueprint $table) {
$table->dropIndex(['travel_date']);
$table->dropIndex(['status']);
$table->dropIndex(['created_by_channel']);
});
Schema::table('payments', function (Blueprint $table) {
$table->dropIndex(['completed_at']);
});
}
};