• Mahmoud Aglan's avatar
    feat(billing): let the desk date a subscription invoice to the month it settles · a8cb5217
    Mahmoud Aglan authored
    A branch going onto the system mid-season has players who have been training —
    and paying — since before anyone typed them in. Registration could only ever
    raise an invoice dated today, so the first invoice for those players said
    September when the money it settled was August, and nothing reconciled.
    
    Both reception wizards now ask, on the payment step, whether the invoice is for
    today or for an earlier month, and offer the last twelve. The month is bounded
    at both ends: a future month is refused outright, in validation and again in the
    service, because an invoice dated ahead of today is one the renewal run raises a
    second time when that month arrives and one no "what did we bill this month"
    report shows. Inside the current month the invoice still reads as raised today —
    backdating it to the 1st only makes it look overdue the day it is created.
    
    The dating is the smaller half. GenerateRenewalInvoices skips a month only when
    it finds BOTH metadata->month and metadata->renewal_enrollment_id on a
    non-cancelled invoice, and neither wizard wrote either — so every invoice they
    raised was invisible to that check and the nightly run billed the same month
    again. Two invoices, one player, one month, nothing on either saying so. Both
    now stamp both keys, and both advance next_billing_date past the month just
    billed — forward only, so a backdated invoice can never drag the anchor back
    behind where it already sits and have the run bill the months in between.
    
    The guard resolving the month runs before the auto-invoice branch, so a bad
    month is refused identically whether or not an academy has
    auto_invoice_on_enrollment switched on.
    Co-Authored-By: 's avatarClaude Opus 5 (1M context) <noreply@anthropic.com>
    a8cb5217
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...