<commit_before>{% load zenaida %}
<p>Hello! Thanks for registering for {{ event.name }}. The details of your registration are below!</p>

{% if unconfirmed_check_payments %}
	<p>Note: Your passes are reserved, but the organizer has not yet received your payment by mail.</p>
	{% include "brambling/event/order/_check_payment_info.html" %}
	<p>If you believe this is in error, please contact the event organizer directly.</p>
{% endif %}

<p>You can also view your order information on <a href="{{ protocol }}://{{ site.domain }}{% if order.person %}{% url 'brambling_event_order_summary' event_slug=event.slug %}{% else %}{% url 'brambling_event_order_summary' event_slug=event.slug code=order.code %}{% endif %}">Dancerfly</a>.</p>

{% for attendee in attendees %}
	{% if attendee.attendee %}
		<h3><a href="{{ protocol }}://{{ site.domain }}{% if order.person %}{% url 'brambling_event_attendee_edit' event_slug=event.slug pk=attendee.attendee.event_pass.pk %}{% else %}{% url 'brambling_event_attendee_edit' event_slug=event.slug pk=attendee.attendee.event_pass.pk code=order.code %}{% endif %}">{{ attendee.attendee.get_full_name }}</a></h3>
	{% else %}
		<h3>Unattached items</h3>
	{% endif %}
	<table>
		<thead>
			<tr>
				<th style="text-align: left;">Items</th>
				<th style="text-align: left;">Type</th>
				<th style="text-align: left;">Timestamp</th>
				<th style="text-align: left;">Status</th>
				<th style="text-align: left;">Amount ({{ event.currency }})</th>
			</tr>
		</thead>
		<tbody>
			{% for item in attendee.bought_items %}
				{% cycle 0 1 as is_active silent %}
				<tr{% if is_active %} style="background-color: whitesmoke;"{% endif %}>
					{% with bought_item=item.bought_item %}
						<th>{{ bought_item.item_option.item.name }} ({{ bought_item.item_option.name }})</th>
						<td>{{ bought_item.item_option.item.get_category_display }}</td>
						<td style="color: whitesmoke;">{{ bought_item.added|date:"n/j/Y H:i:s" }}</td>
						<td>{{ bought_item.get_status_display }}</td>
						<td style="text-align: right">{{ bought_item.item_option.price|format_money:event.currency }}</td>
					{% endwith %}
				</tr>
				{% for discount in item.discounts %}
					<tr{% if is_active %} style="background-color: whitesmoke;"{% endif %}>
						<td>{{ discount.discount.name }} <em style="color: whitesmoke;">{{ discount.discount.code }}</em></td>
						<td>Discount</td>
						<td style="color: whitesmoke;">{{ discount.timestamp|date:"n/j/Y H:i:s" }}</td>
						<td></td>
						<td style="text-align: right;">({{ discount.savings|format_money:event.currency }})</td>
					</tr>
				{% endfor %}
				{% for refund in item.refunds %}
					<tr{% if is_active %} style="background-color: whitesmoke;"{% endif %}>
						<td></td>
						<td>Refund</td>
						<td style="color: whitesmoke;">{{ refund.timestamp|date:"n/j/Y H:i:s" }}</td>
						<td></td>
						<td style="text-align: right;">({{ refund.amount|format_money:event.currency }})</td>
					</tr>
				{% endfor %}
			{% endfor %}
		</tbody>
	</table>
	<table>
		<thead>
			<tr>
				<th></th>
				<th></th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th>Net cost</th>
				<th>{{ attendee.net_cost|format_money:event.currency }}</th>
			</tr>
		</tbody>
	</table>
{% endfor %}
<table>
	<thead>
		<tr>
			<th>Payments</th>
			<th>Type</th>
			<th>Received</th>
			<th>Timestamp</th>
			<th></th>
			<th style="text-align: right">Amount ({{ event.currency }})</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<th colspan="5">Net payments</th>
			<th style="text-align: right">({{ net_payments|format_money:event.currency }})</th>
		</tr>
	</tfoot>
	<tbody>
		{% for payment in payments %}
			<tr>
				<td>{{ payment.card|default:"" }}</td>
				<td>{{ payment.get_method_display }}</td>
				<td>{% block payment_is_confirmed %}{% if payment.is_confirmed %}Yes{% else %}No{% endif %}{% endblock %}</td>
				<td style="color: whitesmoke;">{{ payment.timestamp|date:"n/j/Y H:i:s" }}</td>
				<td>{% block payment_actions %}{% endblock %}</td>
				<td style="text-align: right">({{ payment.amount|format_money:event.currency }})</td>
			</tr>
		{% endfor %}
		{% for refund in refunds %}
			<tr>
				<td></td>
				<td>Refund</td>
				<td></td>
				<td style="color: whitesmoke;">{{ refund.timestamp|date:"n/j/Y H:i:s" }}</td>
				<td></td>
				<td style="text-align: right">{{ refund.amount|format_money:event.currency }}</td>
			</tr>
		{% endfor %}
	</tbody>
</table>

<table>
	<thead>
		<tr>
			<th colspan="2">Summary</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<th>Net balance</th>
			<td style="text-align: right;">{% if net_balance < 0 %}Owed {% elif net_balance > 0 %}Owe {% endif %}<strong>{{ net_balance|absolute_value|format_money:event.currency }}</strong></td>
		</tr>
	</tfoot>
	<tbody>
		<tr>
			<th>Net cost</th>
			<th style="text-align: right;">{{ net_cost|format_money:event.currency }}</th>
		</tr>
		<tr>
			<th>Net payments</th>
			<th style="text-align: right;">{% if net_payments > 0 %}({% endif %}{{ net_payments|format_money:event.currency }}{% if net_payments > 0 %}){% endif %}</th>
		</tr>
	</tbody>
</table><commit_msg>Improvements to receipt email.<commit_after>{% load zenaida %}
<p>Hello! Thanks for registering for {{ event.name }}. The details of your registration are below!</p>

{% if unconfirmed_check_payments %}
	<p>Note: Your passes are reserved, but the organizer has not yet received your payment by mail.</p>
	{% include "brambling/event/order/_check_payment_info.html" %}
	<p>If you believe this is in error, please contact the event organizer directly.</p>
{% endif %}

<p>You can also view and edit your order information on <a href="{{ protocol }}://{{ site.domain }}{% if order.person %}{% url 'brambling_event_order_summary' event_slug=event.slug %}{% else %}{% url 'brambling_event_order_summary' event_slug=event.slug code=order.code %}{% endif %}">Dancerfly</a>.</p>

<h2>Summary</h2>

<dl>
	<dt>Paid</dt>
	<dd>{{ net_payments|format_money:event.currency }}</dd>

	<dt>Order Code</dt>
	<dd>{{ order.code }}</dd>
</dl>

<h2>Details</h2>

{% for attendee in attendees %}
	{% if attendee.attendee %}
		<h3>{{ attendee.attendee.get_full_name }}</h3>
	{% else %}
		<h3>Unattached items</h3>
	{% endif %}

	{% for item in attendee.bought_items %}
		{% cycle 0 1 as is_active silent %}
		<tr{% if is_active %} style="background-color: whitesmoke;"{% endif %}>
			{% with bought_item=item.bought_item %}
				<th style="text-align: left;">{{ bought_item.item_option.item.name }} ({{ bought_item.item_option.name }})</th>
				<td style="text-align: left;">{{ bought_item.item_option.item.get_category_display }}</td>
				<td style="text-align: left; color: whitesmoke;">{{ bought_item.added|date:"n/j/Y H:i:s" }}</td>
				<td style="text-align: left;">{{ bought_item.get_status_display }}</td>
				<td style="text-align: right">{{ bought_item.item_option.price|format_money:event.currency }}</td>
			{% endwith %}
		</tr>
		{% for discount in item.discounts %}
			<tr{% if is_active %} style="background-color: whitesmoke;"{% endif %}>
				<td>{{ discount.discount.name }} <em style="color: whitesmoke;">{{ discount.discount.code }}</em></td>
				<td>Discount</td>
				<td style="color: whitesmoke;">{{ discount.timestamp|date:"n/j/Y H:i:s" }}</td>
				<td></td>
				<td style="text-align: right;">({{ discount.savings|format_money:event.currency }})</td>
			</tr>
		{% endfor %}
		{% for refund in item.refunds %}
			<tr{% if is_active %} style="background-color: whitesmoke;"{% endif %}>
				<td></td>
				<td>Refund</td>
				<td style="color: whitesmoke;">{{ refund.timestamp|date:"n/j/Y H:i:s" }}</td>
				<td></td>
				<td style="text-align: right;">({{ refund.amount|format_money:event.currency }})</td>
			</tr>
		{% endfor %}
	{% endfor %}
				<th>Net cost</th>
				<th>{{ attendee.net_cost|format_money:event.currency }}</th>
			</tr>
		</tbody>
	</table>
{% endfor %}
<table>
	<thead>
		<tr>
			<th>Payments</th>
			<th>Type</th>
			<th>Received</th>
			<th>Timestamp</th>
			<th></th>
			<th style="text-align: right">Amount ({{ event.currency }})</th>
		</tr>
	</thead>
	<tfoot>
		<tr>
			<th colspan="5">Net payments</th>
			<th style="text-align: right">({{ net_payments|format_money:event.currency }})</th>
		</tr>
	</tfoot>
	<tbody>
		{% for payment in payments %}
			<tr>
				<td>{{ payment.card|default:"" }}</td>
				<td>{{ payment.get_method_display }}</td>
				<td>{% block payment_is_confirmed %}{% if payment.is_confirmed %}Yes{% else %}No{% endif %}{% endblock %}</td>
				<td style="color: whitesmoke;">{{ payment.timestamp|date:"n/j/Y H:i:s" }}</td>
				<td>{% block payment_actions %}{% endblock %}</td>
				<td style="text-align: right">({{ payment.amount|format_money:event.currency }})</td>
			</tr>
		{% endfor %}
		{% for refund in refunds %}
			<tr>
				<td></td>
				<td>Refund</td>
				<td></td>
				<td style="color: whitesmoke;">{{ refund.timestamp|date:"n/j/Y H:i:s" }}</td>
				<td></td>
				<td style="text-align: right">{{ refund.amount|format_money:event.currency }}</td>
			</tr>
		{% endfor %}
	</tbody>
</table>

{'fraction_non_alphanumeric': 0.21728095343191348, 'fraction_numerical': 0.0025380710659898475, 'mean_word_length': 3.960591133004926, 'pattern_counts': {'":': 0, '<': 311, '<?xml version=': 0, '>': 313, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4667357', 'n_tokens_mistral': 4007, 'n_tokens_neox': 3357, 'n_words': 708}