231f5679ef
- New RefundBookingTableAction on the booking list row and detail page, refunding a Confirmed booking directly via RefundBookingAction — no need to hunt up its Payment on the Refunds resource first. - Payment::refundableBalance() extracted from RefundBookingAction's private balance check so both refund forms can display and cap against it. - RefundBookingAction::resolveRefundablePayment() made public for the same reason (round-trip leg resolution reused by the UI). - Both refund forms (ProcessRefundAction and the new booking action) gain a "Full refund" toggle, on by default, which refunds the payment's whole remaining balance without requiring a manually typed amount. Turning it off reveals an amount field capped at the refundable balance.
26 lines
854 B
PHP
26 lines
854 B
PHP
<?php
|
|
|
|
namespace Modules\Booking\Filament\Resources\Bookings\Pages;
|
|
|
|
use Filament\Resources\Pages\ViewRecord;
|
|
use Modules\Booking\Filament\Resources\Bookings\Actions\AssignDriverTableAction;
|
|
use Modules\Booking\Filament\Resources\Bookings\Actions\CancelBookingTableAction;
|
|
use Modules\Booking\Filament\Resources\Bookings\Actions\SetRemarkTableAction;
|
|
use Modules\Booking\Filament\Resources\Bookings\BookingResource;
|
|
use Modules\Payment\Filament\Actions\RefundBookingTableAction;
|
|
|
|
class ViewBooking extends ViewRecord
|
|
{
|
|
protected static string $resource = BookingResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
AssignDriverTableAction::make(),
|
|
SetRemarkTableAction::make(),
|
|
CancelBookingTableAction::make(),
|
|
RefundBookingTableAction::make(),
|
|
];
|
|
}
|
|
}
|