• Mahmoud Aglan's avatar
    feat(settlements): give the desk the tool that removes a demand billed twice · 579a3a8b
    Mahmoud Aglan authored
    The last commit taught the settlement screen to SEE money billed twice. It
    still could not do anything about it: the panel described the problem and
    then offered "تسجيل باقي القيمة", which bills MORE. The only way to
    actually fix the reported account was an admin editing the invoice by
    hand, which is how it broke in the first place.
    
    So the screen gets the missing action. `void_duplicate` takes a demand off
    the books — reduce an invoice, or cancel it outright — and it is
    deliberately not a waiver. A waiver forgives a debt that was real and is
    revenue given away; this removes a demand that should never have existed,
    so the club is not out of pocket by a piaster and it reports as negative
    billing. The cart's third tile flips to "سيُحذف من المطلوب" rather than
    showing a minus sign under "سيُفوتَر".
    
    Detecting is only half a tool. An operator standing in front of a parent
    needs to know WHICH of six invoices carries the duplicate, and the second
    spent working that out is the second the wrong one gets cancelled. So the
    wizard matches the excess back to the invoices that could be carrying it,
    newest first, and pre-fills the amount: on the reported account it offers
    "INV-000593: 5,500 -> 3,000" as one button. The worklist states the
    figure on the row, so the excess is visible before anything is opened, and
    severity now colours the chips — a double-billing and a missing month read
    identically before, which is why the list got worked top-to-bottom.
    
    The guard is the whole value of the thing: an invoice with money collected
    against it is never touched. Reducing one below what was paid strands real
    money — the payment row saying one thing, its immutable ledger entry
    another, which is exactly the damage the old correction wizard used to do.
    That money has somewhere to go (move_payment, or credit_wallet) and which
    is right is a person's decision, so the action refuses and the panel says
    so instead of offering a button. Same refusal for an invoice belonging to
    another participant, for raising an amount through a tool named for
    lowering it, and for an invoice with more than one line, where reducing
    the header cannot say which of two lines was the duplicate.
    
    Verified end to end against the restored tenant, which still carries the
    account in its broken state: scanner flags one, screen proposes
    INV-000593 5,500 -> 3,000, applying it leaves billed 8,000 of an 8,000
    card with 3,000 still owed, and the re-scan comes back clean — the same
    correction that had to be made by hand on production, now one click.
    364 tests green on SQLite and Postgres.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    579a3a8b
Name
Last commit
Last update
Screenshots Loading commit data...
app Loading commit data...
bootstrap Loading commit data...
config Loading commit data...
database Loading commit data...
docker Loading commit data...
docs Loading commit data...
docs-site Loading commit data...
flutter_shell Loading commit data...
gap-filling-plans Loading commit data...
lang Loading commit data...
marketing-site Loading commit data...
plans Loading commit data...
public Loading commit data...
reference/oc-sport Loading commit data...
resources Loading commit data...
routes Loading commit data...
scripts Loading commit data...
storage Loading commit data...
tests Loading commit data...
.dockerignore Loading commit data...
.editorconfig Loading commit data...
.env.example Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.npmrc Loading commit data...
Beanding Guide.txt Loading commit data...
CLAUDE.md Loading commit data...
Dockerfile Loading commit data...
README.md Loading commit data...
artisan Loading commit data...
captain-definition Loading commit data...
composer.json Loading commit data...
composer.lock Loading commit data...
deploy.sh Loading commit data...
elcaptain-sportsonly-db.md Loading commit data...
one-click-app.yml Loading commit data...
package-lock.json Loading commit data...
package.json Loading commit data...
phpunit.xml Loading commit data...
system info.txt Loading commit data...
vite.config.js Loading commit data...
نادى الشيخ زايد كشف بيانات اللاعبين (2).html Loading commit data...