1. 16 Jul, 2026 12 commits
    • Mahmoud Aglan's avatar
      Add per-slot explicit installment amounts to product plans · fe016b49
      Mahmoud Aglan authored
      - Migration: add installment_amounts JSONB (nullable) to product_installment_plans
      - ProductInstallmentPlan: new buildSchedule() method — uses explicit piaster amounts per slot where set, auto-calculates remainder evenly for blank slots; downPaymentAmount/regularInstallmentAmount respect slot[0] override
      - ProductForm: syncInstallmentSlots() keeps slot array in sync when count changes; plan rows load/save installment_amounts (stored as piasters, shown as pounds); slot inputs appear under collapsible "تحديد مبلغ كل قسط" toggle per plan row
      - Wizard confirm(): uses buildSchedule() so each Installment row gets its correct explicit or auto-calculated amount
      - Wizard blade breakdown preview: renders individual amounts when slots differ, uniform "N × amount" when all regular slots match
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      fe016b49
    • Mahmoud Aglan's avatar
      Add annual products with dual pricing and installment plans · 7f4dbddd
      Mahmoud Aglan authored
      - New migration: billing_cycle (one_time/annual), member_price, non_member_price on products; product_installment_plans table (per-product, per-tier plan templates)
      - ProductInstallmentPlan model with scopeActive/forTier, downPaymentAmount/regularInstallmentAmount helpers
      - Product model: priceForTier(), isAnnual(), installmentPlans() relationship
      - ProductForm: annual billing section with member/non-member dual prices and installment plan builder (add/remove rows, upsert on save)
      - Registration wizard: essentialProducts() and hotbuyResults() now return billing_cycle and plans[]; addHotbuyItem() carries plans into cart; setHotbuyPlan() selects a plan per cart item; confirm() generates PaymentPlan + Installment rows for annual items with a selected plan
      - Wizard blade: annual cart items show purple "سنوي" badge, plan pills (full payment + per-plan buttons), and installment breakdown preview on selection
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      7f4dbddd
    • Mahmoud Aglan's avatar
      Fix proration settings never saving or taking effect · b9239f68
      Mahmoud Aglan authored
      Two bugs:
      1. save() wrote bare key "allow_proration" but ProrationService reads
         dotted "enrollment.allow_proration" — now always writes "{group}.{key}"
      2. loadAllSettings() tried to read bare keys but DB had dotted keys from
         seeder — now strips group prefix on read so UI always sees bare keys
      
      Result: toggle saves correctly, ProrationService reads the live value,
      mid-month enrollment now shows prorated fee (e.g. day 16 = 15/30 × fee).
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      b9239f68
    • Mahmoud Aglan's avatar
      Fix null metadata crash on invoice_items insert · 160e9785
      Mahmoud Aglan authored
      JSONB column has NOT NULL constraint — pass empty array instead of null
      when no price override metadata exists.
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      160e9785
    • Mahmoud Aglan's avatar
      Add guardian profession and workplace to registration wizard and participant view · a979f30b
      Mahmoud Aglan authored
      Fields already existed on the guardians table (occupation, workplace) but
      had no UI. Now:
      - Registration wizard step 2 shows المهنة + جهة العمل fields (optional)
      - Saved to Guardian on create; updates existing guardian if already found
      - Pre-populated when selecting an existing guardian via search
      - Participant show → أولياء الأمور tab adds المهنة / جهة العمل column
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      a979f30b
    • Mahmoud Aglan's avatar
      Expose proration settings in /settings/system → التسجيل tab · 85319db6
      Mahmoud Aglan authored
      Add allow_proration (boolean) and renewal_day (number, 1-28) to the
      enrollment settings schema with descriptive hints so admins can find and
      toggle partial monthly payment from the UI.
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      85319db6
    • Mahmoud Aglan's avatar
      Add essential products: quick-buttons in wizard, delivery tracking, admin price override on invoice · 9df1341d
      Mahmoud Aglan authored
      - Add is_essential boolean to products (migration + model + form toggle)
      - Essential products appear as quick-add buttons in registration wizard step 5 (no search needed), highlighted when added to cart
      - New EssentialDeliveries page (/inventory/essential-deliveries): lists all players who bought essential products, mark استلم/لم يستلم per item with who delivered and when
      - Delivery tracking: add is_delivered, delivered_at, delivered_by to invoice_items; hotbuy cart items now store itemable_type/id for proper morph link
      - Admin price override now stored in invoice item metadata (original_price, overridden_price, override_reason) and displayed on invoice print with crossed-out original price
      - "أساسي" badge on product list; "تسليم الأساسيات" button on product list header and sidebar
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      9df1341d
    • Mahmoud Aglan's avatar
      Expand wizard payment step: all 7 methods, partial, split, transaction refs · c6327cf7
      Mahmoud Aglan authored
      Payment modes:
      - Full (default): pays entire invoice amount
      - Partial: enter amount paid now, remainder stays as balance due on invoice
      - Split: two methods, amount1 + calculated remainder, both recorded as payments
      
      All 7 PaymentMethod values now available:
      - cash: no extra fields
      - card: transaction_reference (required)
      - bank_transfer: transaction_reference (required), bank_name (optional)
      - online (Instapay/digital wallets): transaction_reference (required)
      - wallet (club wallet): deducts from member balance
      - cheque: cheque_number (required), bank_name (optional)
      - other: notes field
      
      Each payment recorded with gateway_data JSON (ref, cheque_number, bank_name)
      Enrollment payment_status only set to 'paid' when full amount covered
      Validation rules built dynamically from active mode + method combination
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      c6327cf7
    • Mahmoud Aglan's avatar
      Unify receipt/invoice settings: 3-tab template system + fix seeder · 2be39175
      Mahmoud Aglan authored
      - EnrollmentSettingsSeeder: fix Organization → Academy class name
      - ReceiptTemplate: add defaultInvoiceFields/Settings + defaultPaymentFields/Settings
      - ReceiptSettings: rewritten with pos/invoice/payment tabs; each tab loads
        its own ReceiptTemplate (type='invoice'|'payment') and saves independently
      - receipt-settings.blade.php: 3-tab UI with field toggles + appearance settings
        per document type; link to branding page for logo/colors
      - print/invoice.blade.php: all 15 fields now gated by invoice template flags
        (logo, academy name, branch, tax number, client details, items table,
        subtotal, discount, tax, service fee, paid amount, payments history,
        signature, terms & conditions, footer text)
      - print/payment-receipt.blade.php: all 11 fields gated by payment template;
        footer text pulled from template settings instead of hardcoded string
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      2be39175
    • Mahmoud Aglan's avatar
      Fix log permission: touch and chown laravel.log in entrypoint · 20284ee2
      Mahmoud Aglan authored
      CapRover volume remounts can override build-time chown, leaving
      storage/logs owned by root. Explicitly touch + chown the log file
      at container start before php-fpm runs.
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      20284ee2
    • Mahmoud Aglan's avatar
    • Mahmoud Aglan's avatar
      Add phone-or-email login, Egyptian NID decoder, proration engine, and receptionist wizard overhaul · 0504e7d1
      Mahmoud Aglan authored
      - AuthService: accepts email or phone for login (identifier-based lookup)
      - Login UI: updated to text input with Arabic labels
      - EgyptianNidDecoder: decodes 14-digit NID → birth date, gender, governorate
      - ProrationResult DTO + ProrationService: mid-month enrollment fee proration (x/30 of remaining days based on configurable renewal day)
      - EnrollmentSettingsSeeder: seeds enrollment.allow_proration and enrollment.renewal_day per academy
      - NewRegistrationWizard: rewritten — player-first flow, NID auto-decode locks birth/gender/governorate, foreign player toggle, guardian name deduced from player name, phone-only guardian, super admin price override, proration display
      - EnrollmentService: applies proration to invoice creation
      - EnrollExistingWizard: adds proratedProgramFee computed property, review step shows original vs prorated fee
      - Migration: adds governorate column to people table
      Co-Authored-By: 's avatarClaude Sonnet 4.6 <noreply@anthropic.com>
      0504e7d1
  2. 11 Jul, 2026 6 commits
  3. 10 Jul, 2026 10 commits
  4. 09 Jul, 2026 12 commits