Commit 1173eb1b authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix(sports): rename wizard button + skip form fee for returning players

The registration form fee (استمارة) is a one-time payment per human.
When a player who already paid it starts a new registration, the wizard
now skips directly to the photo step instead of showing a 0-fee payment.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent 2156ed43
......@@ -106,6 +106,11 @@ final class RegistrationWizardService
$fees = self::calculateFees($playerType);
$registrationNumber = self::generateRegistrationNumber();
$formAlreadyPaid = false;
if ($existingPlayer && (int) ($existingPlayer['registration_fee_paid'] ?? 0) === 1) {
$formAlreadyPaid = true;
}
$registrationId = $db->insert('sa_registrations', [
'registration_number' => $registrationNumber,
'player_id' => $playerId,
......@@ -113,10 +118,11 @@ final class RegistrationWizardService
'member_id' => $memberId > 0 ? $memberId : null,
'national_id' => $nationalId ?: null,
'status' => 'in_progress',
'registration_fee' => $fees['registration_fee'],
'registration_fee' => $formAlreadyPaid ? 0 : $fees['registration_fee'],
'card_fee' => $fees['card_fee'],
'form_fee' => $fees['form_fee'],
'total_fees' => $fees['total_fees'],
'total_fees' => ($formAlreadyPaid ? 0 : $fees['registration_fee']) + $fees['card_fee'] + $fees['form_fee'],
'form_payment_status' => $formAlreadyPaid ? 'paid' : 'unpaid',
'branch_id' => $branch ? (int) $branch['id'] : null,
'created_by' => $employee ? (int) $employee->id : null,
'created_at' => date('Y-m-d H:i:s'),
......@@ -129,6 +135,7 @@ final class RegistrationWizardService
'registration_number' => $registrationNumber,
'player_id' => $playerId,
'fees' => $fees,
'form_already_paid' => $formAlreadyPaid,
];
}
......
......@@ -24,9 +24,9 @@
<div class="desk-panel active" id="panel-registration">
<div class="card" style="padding:30px;text-align:center;">
<p style="color:#6B7280;margin:0 0 15px;">لبدء تسجيل لاعب جديد أو إضافة لاعب لمجموعة:</p>
<a href="/sa/registration" class="btn btn-primary" style="padding:10px 24px;">فتح معالج التسجيل</a>
<a href="/sa/registration" class="btn btn-primary" style="padding:10px 24px;">تسجيل لاعب جديد</a>
<span style="margin:0 10px;color:#9CA3AF;">أو</span>
<a href="/sa/players/create" class="btn btn-outline" style="padding:10px 24px;">إضافة لاعب جديد</a>
<a href="/sa/players/create" class="btn btn-outline" style="padding:10px 24px;">إضافة لاعب بدون اشتراك</a>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment