mirror of
https://github.com/pretix/pretix.git
synced 2025-12-22 16:52:27 +00:00
Compare commits
4 Commits
mail-setti
...
hide-invis
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49b1c61dd1 | ||
|
|
db47f5638e | ||
|
|
a2dc467d0b | ||
|
|
dc1a115863 |
@@ -3526,11 +3526,30 @@ class InvoiceAddress(models.Model):
|
|||||||
})
|
})
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def describe_transmission(self):
|
def describe_transmission(self, event=None):
|
||||||
|
# we only need an explicit event if the order is not yet created and we do not want to show unnecessary data to customers
|
||||||
from pretix.base.invoicing.transmission import transmission_types
|
from pretix.base.invoicing.transmission import transmission_types
|
||||||
data = []
|
data = []
|
||||||
|
|
||||||
t, __ = transmission_types.get(identifier=self.transmission_type)
|
t, m = transmission_types.get(identifier=self.transmission_type)
|
||||||
|
|
||||||
|
d_event = self.order.event if self.order else event
|
||||||
|
# reusing hack from questions.py for default transmission -- this should at least be fast
|
||||||
|
if d_event:
|
||||||
|
if (
|
||||||
|
t.identifier == "email" and
|
||||||
|
m in ("transmission_email_other", "transmission_email_address") and
|
||||||
|
(
|
||||||
|
d_event.settings.invoice_generate == "False" or
|
||||||
|
not d_event.settings.invoice_email_attachment
|
||||||
|
)
|
||||||
|
):
|
||||||
|
return data
|
||||||
|
|
||||||
|
# we also don't show transmission data if we never showed the corresponding form fields
|
||||||
|
if not t.invoice_address_form_fields_visible(country=self.country, is_business=self.is_business):
|
||||||
|
return data
|
||||||
|
|
||||||
data.append((_("Transmission type"), t.public_name))
|
data.append((_("Transmission type"), t.public_name))
|
||||||
form_data = t.transmission_info_to_form_data(self.transmission_info or {})
|
form_data = t.transmission_info_to_form_data(self.transmission_info or {})
|
||||||
for k, f in t.invoice_address_form_fields.items():
|
for k, f in t.invoice_address_form_fields.items():
|
||||||
|
|||||||
@@ -1545,6 +1545,8 @@ class ConfirmStep(CartMixin, AsyncAction, TemplateFlowStep):
|
|||||||
ctx['invoice_address_asked'] = self.address_asked
|
ctx['invoice_address_asked'] = self.address_asked
|
||||||
ctx['customer'] = self.cart_customer
|
ctx['customer'] = self.cart_customer
|
||||||
|
|
||||||
|
ctx['transmission_fields'] = self.invoice_address.describe_transmission(self.event)
|
||||||
|
|
||||||
self.cart_session['shown_total'] = str(ctx['cart']['total'])
|
self.cart_session['shown_total'] = str(ctx['cart']['total'])
|
||||||
|
|
||||||
email = self.cart_session.get('contact_form_data', {}).get('email')
|
email = self.cart_session.get('contact_form_data', {}).get('email')
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
<dt>{% trans "Internal reference" %}</dt>
|
<dt>{% trans "Internal reference" %}</dt>
|
||||||
<dd>{{ addr.internal_reference }}</dd>
|
<dd>{{ addr.internal_reference }}</dd>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for k, v in addr.describe_transmission %}
|
{% for k, v in transmission_fields %}
|
||||||
<dt>{{ k }}</dt>
|
<dt>{{ k }}</dt>
|
||||||
<dd>{{ v }}</dd>
|
<dd>{{ v }}</dd>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
Reference in New Issue
Block a user