• Mahmoud Aglan's avatar
    fix(roster): count the registration money however the receptionist typed it · fa06830c
    Mahmoud Aglan authored
    The قيد column asked the database one question — is there an invoice line
    carrying this product's itemable morph? That is how the POS writes a sale
    and not how most of this money was collected. A receptionist taking the
    first instalment types "القسط الاول من القيد" into a free-text line; the
    player has paid, and the roster called him a non-buyer. On OC-Sport that
    is fourteen lines across nine players, every one of whom had paid.
    
    BundledProductLine reads those lines the way SubscriptionLine reads
    subscription ones: over whole normalised words, matched against the words
    that identify the product and nothing else. "قيد اشتراك فريق اتحاد الكرة"
    is identified by قيد and اتحاد — اشتراك heads half the subscription lines
    in the same ledger and فريق is how the programmes are named, so any word
    appearing in a programme name is dropped as unable to tell the two apart.
    A line that names nothing at all ("القسط الاول") is attributed only where
    it can be: the programme requires exactly one product and the invoice pays
    for no training, so there is one thing here paid in instalments and that
    is what it is paying off.
    
    The column now shows the money rather than a yes/no: paid so far against
    what is owed, "أقساط" while it is being paid off, "مدفوع بالكامل" once it
    is settled. What is owed comes from the product line when there is one —
    that price was agreed and frozen at the sale. Money typed by hand is only
    the instalments taken so far, so 2,500 of 2,500 would call a third of a
    card paid in full; there the total is the product's price for this
    member's tier, marked ≈ and explained in the cell's title.
    
    Two matching consequences: instalment wording no longer counts as
    subscription (training is billed by the month here, so a bare "القسط
    الاول" made a player who had paid 2,500 toward his card read as having
    paid for July's training), and free players no longer inflate the header's
    "بدون" count — they are exempt from the bundle, and the cell already says
    so with a dash.
    
    Verified against a restored OC-Sport tenant: all six فريق rosters render,
    the reported player (عبدالله أحمد صلاح سيد) now reads 2,500 / 8,000 ≈
    (31%) أقساط instead of "لم يشترِ", and every hand-typed payer is counted.
    271 tests pass.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    fa06830c