Add refund action to booking list/detail with full-refund toggle
- 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.
This commit is contained in:
@@ -7,6 +7,7 @@ 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
|
||||
{
|
||||
@@ -18,6 +19,7 @@ class ViewBooking extends ViewRecord
|
||||
AssignDriverTableAction::make(),
|
||||
SetRemarkTableAction::make(),
|
||||
CancelBookingTableAction::make(),
|
||||
RefundBookingTableAction::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user