Add a club legal address, used for invoices/referee forms ahead of the home ground

New Club.legal_address/legal_zip_code/legal_city, editable from the
identity page (management:club_settings). Official document headers
(the dues invoice, the referee payment form) previously borrowed the
club's home Location for this -- conflating "where we play" with "our
registered address", which aren't always the same place. New
club.services.invoicing.resolve_document_address(club) picks the club's
own legal address when set, falling back to the home Location exactly as
before when it isn't, so nothing breaks for a club that hasn't set one
yet. Location.is_home now means only what it always should have: telling
a home game from an away one.

Renamed the shared "home_location" template/context variable to
"document_address" on both PDFs to match -- it was never accurate once a
legal address could win instead.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ECGMEwrc2k4D8VQuwjstj9
This commit is contained in:
2026-08-21 17:50:08 +02:00
parent 80fda6a4a4
commit c7887637ff
12 changed files with 159 additions and 27 deletions

View File

@@ -64,9 +64,13 @@
<div class="grid grid-cols-1 gap-4 md:grid-cols-2">
{% form_field form.name %}
{% form_field form.legal_name %}
<div class="md:col-span-2">{% form_field form.legal_address %}</div>
{% form_field form.legal_zip_code %}
{% form_field form.legal_city %}
{% form_field form.contact_email %}
{% form_field form.website %}
</div>
<p class="mt-1 text-xs text-dim">{% trans "Used on official documents (invoices, the referee payment form). Leave blank to use the club's home location instead." %}</p>
</div>
</div>

View File

@@ -69,9 +69,9 @@
<div class="header">
<div>
<div class="club-name">{{ club.official_name }}</div>
{% if home_location %}
<div class="club-address">{{ home_location.address }}</div>
<div class="club-address">{{ home_location.zip_code }} {{ home_location.city }}</div>
{% if document_address %}
<div class="club-address">{{ document_address.address }}</div>
<div class="club-address">{{ document_address.zip_code }} {{ document_address.city }}</div>
{% endif %}
</div>
<div class="doc-title">