{% extends "admin/change_form.html" %}
{% load i18n admin_urls static admin_modify %}

{% block content %}
{{ block.super }}
<script>

(function($) {
    function populate(data) {
        $('#id_amount').val(-data.amount);
        $('#id_transaction_type').val('RETURN_BANK');
    }
    $('#id_bankreader_transaction').change(function () {
        $.getJSON(
            '{% url 'admin:leprikon_payment_populate' %}',
            {bankreader_transaction: this.value},
            populate,
        );
    });
})(django.jQuery);
</script>
{% endblock %}
