forked from data.coop/membersystem
Compare commits
4 commits
fix-migrat
...
main
Author | SHA1 | Date | |
---|---|---|---|
Benjamin Bach | 43d5dcbd52 | ||
Benjamin Bach | f5feda3414 | ||
Benjamin Bach | 3659cf40df | ||
Benjamin Bach | 8f3e8f06f0 |
|
@ -80,8 +80,8 @@ class Order(CreatedModifiedAbstract):
|
||||||
is_paid = models.BooleanField(default=False, verbose_name=_("is paid"))
|
is_paid = models.BooleanField(default=False, verbose_name=_("is paid"))
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
verbose_name = pgettext_lazy("accounting term", "Order")
|
verbose_name = pgettext_lazy("accounting", "Order")
|
||||||
verbose_name_plural = pgettext_lazy("accounting term", "Orders")
|
verbose_name_plural = pgettext_lazy("accounting", "Orders")
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return f"Order ID {self.display_id}"
|
return f"Order ID {self.display_id}"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
{% load i18n %}
|
{% load i18n %}
|
||||||
|
|
||||||
{% block head_title %}
|
{% block head_title %}
|
||||||
{% trans "Order" %}
|
{% trans "Order" context "accounting" %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
@ -11,14 +11,14 @@
|
||||||
<h2>Order: {{ order.id }}</h2>
|
<h2>Order: {{ order.id }}</h2>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% trans "Ordered" %}: {{ order.created }}<br>
|
{% trans "Ordered" context "accounting" %}: {{ order.created }}<br>
|
||||||
{% trans "Status" %}: {{ order.is_paid|yesno:_("paid,unpaid") }}
|
{% trans "Status" context "accounting" %}: {{ order.is_paid|yesno:_("paid,unpaid") }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<table class="table">
|
<table class="table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Item" %}</th>
|
<th>{% trans "Item" context "accounting" %}</th>
|
||||||
<th>{% trans "Quantity" %}</th>
|
<th>{% trans "Quantity" %}</th>
|
||||||
<th>{% trans "Price" %}</th>
|
<th>{% trans "Price" %}</th>
|
||||||
<th>{% trans "VAT" %}</th>
|
<th>{% trans "VAT" %}</th>
|
||||||
|
|
|
@ -56,7 +56,7 @@ class BaseEmail(EmailMessage):
|
||||||
c["request"] = self.request
|
c["request"] = self.request
|
||||||
c["domain"] = site.domain
|
c["domain"] = site.domain
|
||||||
c["site_name"] = site.name
|
c["site_name"] = site.name
|
||||||
c["protocol"] = "http" if self.request and not self.request.is_secure() else "https"
|
c["protocol"] = "https" # if self.request and not self.request.is_secure() else "https"
|
||||||
return c
|
return c
|
||||||
|
|
||||||
def get_body(self) -> str:
|
def get_body(self) -> str:
|
||||||
|
@ -101,6 +101,7 @@ class InviteEmail(BaseEmail):
|
||||||
def __init__(self, membership: Membership, request: HttpRequest, *args, **kwargs) -> None:
|
def __init__(self, membership: Membership, request: HttpRequest, *args, **kwargs) -> None:
|
||||||
self.membership = membership
|
self.membership = membership
|
||||||
kwargs["user"] = membership.user
|
kwargs["user"] = membership.user
|
||||||
|
kwargs["from_email"] = "kasserer@data.coop"
|
||||||
super().__init__(request, *args, **kwargs)
|
super().__init__(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_context_data(self) -> dict:
|
def get_context_data(self) -> dict:
|
||||||
|
@ -118,6 +119,7 @@ class OrderEmail(BaseEmail):
|
||||||
def __init__(self, order: Order, request: HttpRequest, *args, **kwargs) -> None:
|
def __init__(self, order: Order, request: HttpRequest, *args, **kwargs) -> None:
|
||||||
self.order = order
|
self.order = order
|
||||||
kwargs["user"] = order.member
|
kwargs["user"] = order.member
|
||||||
|
kwargs["from_email"] = "kasserer@data.coop"
|
||||||
super().__init__(request, *args, **kwargs)
|
super().__init__(request, *args, **kwargs)
|
||||||
|
|
||||||
def get_context_data(self) -> dict:
|
def get_context_data(self) -> dict:
|
||||||
|
|
|
@ -21,7 +21,7 @@ class Migration(migrations.Migration):
|
||||||
migrations.AddField(
|
migrations.AddField(
|
||||||
model_name='membership',
|
model_name='membership',
|
||||||
name='referral_code',
|
name='referral_code',
|
||||||
field=models.UUIDField(blank=True, null=True, unique=True, default=uuid.uuid4, editable=False),
|
field=models.UUIDField(blank=True, null=True, default=uuid.uuid4, editable=False),
|
||||||
),
|
),
|
||||||
migrations.RunPython(create_uuid),
|
migrations.RunPython(create_uuid),
|
||||||
migrations.AlterField(
|
migrations.AlterField(
|
||||||
|
|
|
@ -1,6 +1,17 @@
|
||||||
{% extends "membership/emails/base.txt" %}{% load i18n %}
|
{% extends "membership/emails/base.txt" %}{% load i18n %}
|
||||||
|
|
||||||
{% block content %}{% url 'order:detail' order_id=order.id as order_url %}{% blocktrans %}You have an order in our system, you can pay it here:
|
{% block content %}{% url 'order:detail' order_id=order.id as order_url %}{% blocktrans %}You have an order in our system, which you can pay here:
|
||||||
|
|
||||||
{{ protocol }}://{{ domain }}{{ order_url }}
|
{{ protocol }}://{{ domain }}{{ order_url }}
|
||||||
|
|
||||||
|
We used to handle membership stuff in a spreadsheet and via bank transfers. This is now all handled with our custom-made membership system. We hope you like it.
|
||||||
|
|
||||||
|
If you received this email and no longer want a membership, you can ignore it. But please let us know by writing board@data.coop, so we can erase any personal data we have about your previous membership.
|
||||||
|
|
||||||
|
Dansk:
|
||||||
|
|
||||||
|
Hej! Så kører medlemsystemet endeligt! Det er mega-fedt, fordi vi længe har haft besvær med manuelle procedurer. Nu har vi flyttet medlemsdata over på member.data.coop, og betalingen fungerer. Vi kan dermed fremover arbejde stille og roligt på at integrere systemet, så man kan styre sine services via medlemssystemet.
|
||||||
|
|
||||||
|
Hvis du ikke længere vil være medlem, kan du ignorere mailen her; men du må meget gerne informere os via board@data.coop, så vi kan slette evt. personlige data og services, du har kørende på dit tidligere medlemskab.
|
||||||
|
|
||||||
{% endblocktrans %}{% endblock %}
|
{% endblocktrans %}{% endblock %}
|
||||||
|
|
Loading…
Reference in a new issue