{% extends "cms/admin_home.html" %}
{% load sekizai_tags i18n %}

{% block content %}

	<h2>{% trans "Process Refund: Confirmation" %}</h2>

	<p>{% trans "Please confirm the following before sending" %}:</p>

	<table class="table my-2">
		<tr>
			<th>{% trans "Refund This Amount" %}:</th>
			<th>{{ currencySymbol }}{{ amount_to_refund|floatformat:"2" }}</th>
		</tr>
		{% if initial_refund_amount %}
			<tr>
				<td>{% trans "Prior Refunds to Invoice" %}:</td>
				<td>{{ currencySymbol }}{{ initial_refund_amount|floatformat:"2" }}</td>
			</tr>
			<tr>
				<td>{% trans "Total Refunds to Invoice" %}:</td>
				<td>{{ currencySymbol }}{{ total_refund_amount|floatformat:"2" }}</td>
			</tr>
		{% endif %}
	</table>

	{% if payments %}
		<div class="card my-2">
			<h6 class="card-header">{% trans "Payment Details" %}</h6>
			<div class="card-body">
				{% for payment in payments %}
					{{ payment.methodName }}: #{{ payment.recordId }}<br />
					{% if not payment.refundable %}
						<strong>{% trans "Note" context "alert" %}:</strong> {% trans "This payment does not appear to be automatically refundable.  Please manually refund the money to this student after filling out this form." %}<br />
					{% endif %}
				{% endfor %}
			</div>
		</div>
	{% endif %}

	<div class="my-4">
		<a class="btn btn-success" href="?confirmed=True">{% trans "Process Refund" %}</a>
		<a class="btn btn-secondary" href="{% url 'refundProcessing' form_data.id %}">{% trans "Return To Form" %}</a>
	</div>

{% endblock %}
