- 22 Aug, 2026 3 commits
-
-
Mahmoud Aglan authored
- ParticipantList: default sort by name_ar ASC, added sort headers for activity and membership columns - EnrollmentList: added sort by participant name (join), group name, and payment_status columns - GroupList: default sort by name_ar ASC instead of created_at Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
UserForm was setting role_id on the users table but not syncing to the role_user pivot table. Permission checks use the pivot (roles() relation), so users appeared to have the correct role in the UI but had zero permissions in practice. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
The group view was marking players as "unpaid" if they had ANY unpaid invoice (products, etc.), even if their program subscription was fully paid. Now the logic only checks: 1. Enrollment payment_status (paid/waived = done) 2. Enrollment's linked invoice status 3. Recent subscription invoice with matching program name Also fixed ActivateEnrollmentOnPayment listener to properly set payment_status='paid' on enrollments when subscription invoice is paid (was only activating status, not updating payment_status). Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 20 Aug, 2026 1 commit
-
-
Mahmoud Aglan authored
- Group view: added KPI cards for paid/unpaid/free player counts - Group view: added essential product purchase stats with progress bars - Group view: added installment info column per player in enrollments tab - Fixed PHP 8.2+ trait property conflict: removed $sortBy/$sortDir redeclarations from 13 Livewire components that use WithSorting trait, moved custom defaults to mount() instead Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 19 Aug, 2026 3 commits
-
-
Mahmoud Aglan authored
- Sort header component: blue active arrow, hover-to-reveal for inactive, cursor-pointer, group-hover animation - Participant list: name column now sortable (joins people table) - Trainer list: name column sortable (joins employees→people) Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
- Created WithSorting trait (shared across all 35 list components) - Created <x-ui.sort-header> Blade component with arrow indicators - All table lists now support click-to-sort on key columns (persisted via URL) - Trainer edit form: added salary amount + frequency fields from Employee model - Trainer edit form: person data (name, national_id, phone) already included Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
- Free player: is_free column, toggle button on participant show, badge component across all views, skip invoice on enrollment/renewal for free players - Trainer delete: full cascade (cancel compensations/advances, remove future attendance, cancel assignments, nullify trainer refs, deactivate user, archive employee/person, free national_id for reimport) - Trainer edit: person data fields (name, national_id, phone) editable from trainer form Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 16 Aug, 2026 2 commits
-
-
Mahmoud Aglan authored
This was the THIRD auto-suspend mechanism (alongside send-alerts and the real-time listener). It directly wrote status='suspended' without going through the event/listener. Now all three paths respect the same opt-in setting. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Both the scheduled command and the real-time listener now check 'auto_suspend_on_threshold' setting (default: false). Auto-suspend will only fire if explicitly enabled in system_settings. This prevents participants from being repeatedly suspended after reactivation due to old attendance records in the lookback window. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 15 Aug, 2026 1 commit
-
-
Mahmoud Aglan authored
-
- 13 Aug, 2026 6 commits
-
-
Mahmoud Aglan authored
- New migration: attachment_path + attachment_name columns on expenses - ExpenseForm uses WithFileUploads trait, accepts jpg/png/webp/pdf up to 5MB - Drag-drop upload zone in the form with preview of attached file name - Files stored in storage/app/public/expenses/ Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
When a participant goes from suspended/frozen/inactive → active, the listener now regenerates expected attendance records for all their active enrollments' future sessions. Previously, reactivated participants were invisible in attendance because records were only generated at session creation time. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Payment Collection (CollectPaymentWizard): - Remove branch filter from participant search (POS sells cross-branch) - Include Draft status in outstanding invoice query - Add invoice search mode (search by invoice number/contact name) - Allow walk-in invoices to be found and paid directly - Accept inactive/frozen/registered participants (not just active) Retroactive Enrollment Wizard: - Fix "paid outside system" to use PaymentService (creates proper Payment + Transaction records for financial reports) - Add server-side validation in confirm() before DB transaction - Add national_id duplicate check to prevent duplicate participants - Add price=0 guard (show error if no base price and no override) - Fix rounding loss: remainder goes to last month's invoice - Pass skip_auto_invoice to prevent double invoice creation POS Partial Payment: - Enable allows_partial_payment on all existing products (migration) so the deposit/partial payment UI appears at checkout Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
All financial-related pages are now reachable from the Financial Overview via quick-action buttons with proper permission gates. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Shows all POS receipts (RCP-*) containing this product with: receipt number, customer, total, payment status, method, cashier, date. Each receipt has a print link and invoice link for further actions. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
- Prominent button with colored border (amber pulse when unpinned, green when pinned) - Dropdown with branch list, selected indicator, and pin status - Pin icon shows when branch is locked - Selecting a branch auto-pins it (persists across logout/login) - Unpin button available to release the lock - Visual hint text explains pin behavior Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 10 Aug, 2026 2 commits
-
-
Mahmoud Aglan authored
Trainers section (purple header) shows first with max 2-3 records. Players section (blue header) shows below with full table. Access control: - Trainer account: can only mark their own attendance (others disabled) - Supervisor/head_trainer (role level >= 60): can mark all trainers Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Branch: saves preferred_branch_id to users table on switch, restores on next login/session so you stay on the branch you last picked. Expenses: adds status column (active/cancelled) with cancel button that creates a reversing double-entry transaction. Cancelled expenses remain visible but excluded from totals. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 09 Aug, 2026 11 commits
-
-
Mahmoud Aglan authored
Shows when the invoice was last paid instead of when it was created. List is already sorted by paid_at DESC. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Shows the method (cash/card/wallet/etc) from the invoice's most recent payment, making it easy to see how each invoice was settled at a glance. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
The print receipt was always showing only the total amount, even when the transaction was a partial payment (deposit). Now shows paid amount, remaining balance, and a "مدفوع جزئياً" badge when the linked invoice has outstanding balance. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
The payment summary panel was only counting inbound payments, ignoring outbound refunds entirely. Now shows net amounts (inbound - refunds) per method, and displays a refund line when refunds exist in the selected period. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Shows most recently paid invoices at the top so the user sees the latest actual money collected, not just the latest generated. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
CollectPaymentWizard and ReconciliationWizard were creating payments without payer_type/payer_id, making them invisible on participant profiles. Now PaymentService inherits payer from the invoice's billable when callers omit it. Also auto-generates reference if empty. Fixed 113 orphaned payments in production. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Auto-generated renewal invoices are created by the system, but collected_by records the real person who collected the money from the participant. Set on every payment collection via updatePaidAmount. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
The old code tried to find 'system@oc-sport.com' then fell back to User::first() which silently attributed 222 invoices to a random Head Trainer. Now uses enrollment.created_by as the actor — if that user no longer exists, the invoice is skipped with an error log. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Bug 1: Attendance threshold was counting 'expected' records in the denominator, causing any player with future sessions to have a low attendance rate and get auto-suspended. Fixed by excluding 'expected' status from rate calculation and requiring minimum 5 evaluated records before triggering threshold enforcement. Bug 2: Registration wizard and POS receipt always showed full amount as "paid" even for partial/deposit payments. Fixed to show actual paid_amount and due_amount from the invoice, with distinct badge for partial payment state. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Add 4 dashboard/financial features: compact renewals, retroactive wizard fix, club revenue, expense shortcuts - Compact overdue renewals alert into summary card with toggle detail list - Rewrite retroactive enrollment wizard to CREATE new participants (not search existing) - Add external revenue import form for club lump-sum payments - Add quick-action buttons to financial overview for expenses/revenue - Migration adds external_revenue to expenses category CHECK constraint Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
- Fix super admin assignment: sync is_super_admin flag when assigning role - Replace is_system block with level-based guard (edit roles below your level) - Add role deletion for non-system custom roles - Allow editing system role permissions and metadata (name_ar, description) - Add role comparison page (/roles/compare) with differences-only filter - Add permissions:sync artisan command for syncing seeder to DB - Add events permissions to seeder, make getPermissionsList() static Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 08 Aug, 2026 1 commit
-
-
Mahmoud Aglan authored
The transfer wizard was querying is_active which doesn't exist on training_programs table — the column is status with CHECK constraint. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 06 Aug, 2026 1 commit
-
-
Mahmoud Aglan authored
4-step wizard: search participant → select invoice → enter correction (new amount, description, reason) → creates remainder invoice if needed. Full audit log trace via Log::channel('audit') and invoice metadata. Accessible from SuperAdmin panel, gated by super_admin.access permission. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 05 Aug, 2026 3 commits
-
-
Mahmoud Aglan authored
Platform fees for ALL retroactive months are charged in the current month (registration date), not backdated. Individual month invoices carry service_fee_amount=0 with a metadata flag, while a single consolidated fee invoice is created dated today covering all months. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
New wizard at /receptionist/retroactive-enrollment lets staff enroll participants who started in previous months. Flow: select participant → choose program → set actual start date → mark each month as unpaid or paid-outside-system → optionally pay all outstanding now. Creates individual invoices per month with proper metadata. Supports admin price override for the total. Accessible from receptionist dashboard with enrollments.create permission. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
New /roles/matrix page shows all permissions as rows grouped by module with Arabic labels, all roles as columns, and color-coded scope badges (own/branch/academy/all). Includes module and role filtering, stats per role, and click-to-cycle scope for custom roles. System roles are read-only. Accessible from the roles list page via "المصفوفة" button. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
- 04 Aug, 2026 6 commits
-
-
Mahmoud Aglan authored
Super admins can now override the invoice amount directly from step 2 of the collect payment flow. The override updates the invoice total, stores a full audit trail in invoice metadata (who, when, original amount, new amount, reason, participant), and logs to the audit channel. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Membership is only for participants who explicitly registered with a membership_id. Non-members pay 900, members pay 650 — determined at registration time, not at enrollment. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Participants were staying as 'non_member' after enrollment, causing renewals to be priced at 900 (non-member) instead of 650 (member). EnrollmentService now sets membership_type='member' on enrollment. DB fix: updated 178 participants to 'member', corrected 124 unpaid renewal invoices from 90000 to 65000 piasters. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
New billing rule: everyone renews on the 1st, full program price. New enrollees pay pro-rata for remainder of first month, then renew normally on the 1st going forward. - advanceEnrollmentBillingDate() always sets next_billing_date to 1st of next month - calculateFirstBillingDate() same: 1st of next month - DB: set 44 un-renewed enrollments to 2026-08-01 (left 207 already- renewed at 2026-09-01 untouched) Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
The wizard only generated renewal invoices when next_billing_date had already passed. Now it generates them for any billing date within the current month, so participants can renew as soon as the month starts rather than waiting for the exact billing day. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-
Mahmoud Aglan authored
Participants stayed in 'registered' status even after being enrolled in active groups. The collect payment wizard filters by status='active', making them invisible. Now EnrollmentService transitions registered→active on enrollment. Also fixed 70 existing participants in oc_sport DB. Co-Authored-By:Claude Opus 4.6 <noreply@anthropic.com>
-