feat(tenant): add master toggle for ticket refunds
This commit is contained in:
@@ -141,12 +141,12 @@ class AdminAppTicketService
|
||||
$remainingItemAmount = max(0.0, round($itemTotal - $itemRefundedAmount, 2));
|
||||
|
||||
$total = null;
|
||||
if ($tenant->allow_ticket_total_refund && $unitPrice <= $remainingItemAmount) {
|
||||
if ($tenant->allow_refund() && $tenant->allow_ticket_total_refund && $unitPrice <= $remainingItemAmount) {
|
||||
$total = number_format($unitPrice, 2, '.', '');
|
||||
}
|
||||
|
||||
$partial = null;
|
||||
if ($tenant->allow_partial_refund()) {
|
||||
if ($tenant->allow_refund() && $tenant->allow_partial_refund()) {
|
||||
$partialAmount = $this->refundAmount($purchaseItem, $tenant, 'partial');
|
||||
if ($partialAmount <= $remainingItemAmount) {
|
||||
$partial = number_format($partialAmount, 2, '.', '');
|
||||
@@ -214,8 +214,8 @@ class AdminAppTicketService
|
||||
private function ensureRefundIsAllowed(Tenant $tenant, string $refundType): void
|
||||
{
|
||||
$isAllowed = match ($refundType) {
|
||||
'partial' => $tenant->allow_partial_refund(),
|
||||
'total' => (bool) $tenant->allow_ticket_total_refund,
|
||||
'partial' => $tenant->allow_refund() && $tenant->allow_partial_refund(),
|
||||
'total' => $tenant->allow_refund() && (bool) $tenant->allow_ticket_total_refund,
|
||||
};
|
||||
|
||||
if (! $isAllowed) {
|
||||
|
||||
Reference in New Issue
Block a user