1
0
mirror of https://gitlab.crans.org/bde/nk20 synced 2024-11-27 10:53:02 +00:00
nk20/templates/note/transaction_form.html

195 lines
7.9 KiB
HTML
Raw Normal View History

2019-08-10 17:00:16 +00:00
{% extends "base.html" %}
2019-07-17 11:53:58 +00:00
{% comment %}
SPDX-License-Identifier: GPL-2.0-or-later
{% endcomment %}
{% load i18n static django_tables2 perms %}
2019-07-17 11:53:58 +00:00
{% block content %}
<div class="row">
<div class="col-xl-12">
<div class="btn-group btn-group-toggle" style="width: 100%; padding: 0 0 2em 0" data-toggle="buttons">
2020-03-16 12:06:02 +00:00
<label for="type_gift" class="btn btn-sm btn-outline-primary active">
2020-03-14 14:13:58 +00:00
<input type="radio" name="transaction_type" id="type_gift" checked>
2020-03-14 16:40:31 +00:00
{% trans "Gift" %}
2020-03-14 14:13:58 +00:00
</label>
2020-03-16 12:06:02 +00:00
<label for="type_transfer" class="btn btn-sm btn-outline-primary">
2020-03-14 14:13:58 +00:00
<input type="radio" name="transaction_type" id="type_transfer">
2020-03-14 16:40:31 +00:00
{% trans "Transfer" %}
2020-03-14 14:13:58 +00:00
</label>
{% if "note.notespecial"|not_empty_model_list %}
<label for="type_credit" class="btn btn-sm btn-outline-primary">
<input type="radio" name="transaction_type" id="type_credit">
{% trans "Credit" %}
</label>
<label type="type_debit" class="btn btn-sm btn-outline-primary">
<input type="radio" name="transaction_type" id="type_debit">
{% trans "Debit" %}
</label>
{% endif %}
2020-03-14 14:13:58 +00:00
</div>
</div>
</div>
2020-03-12 22:12:49 +00:00
<div class="row">
2020-03-22 21:35:07 +00:00
<div class="col-xl-4" id="note_infos_div">
<div class="card border-success shadow mb-4">
<img src="/media/pic/default.png"
id="profile_pic" alt="" class="img-fluid rounded mx-auto d-block">
<div class="card-body text-center">
<span id="user_note"></span>
</div>
</div>
</div>
<div class="col-md-4" id="emitters_div" style="display: none;">
2020-03-12 22:12:49 +00:00
<div class="card border-success shadow mb-4">
<div class="card-header">
<p class="card-text font-weight-bold">
2020-03-14 16:40:31 +00:00
{% trans "Select emitters" %}
2020-03-12 22:12:49 +00:00
</p>
2019-07-17 11:53:58 +00:00
</div>
2020-03-12 22:12:49 +00:00
<ul class="list-group list-group-flush" id="source_note_list">
</ul>
<div class="card-body">
<input class="form-control mx-auto d-block" type="text" id="source_note" />
<ul class="list-group list-group-flush" id="source_alias_matched">
</ul>
</div>
</div>
</div>
{% if "note.notespecial"|not_empty_model_list %}
<div class="col-md-4" id="external_div" style="display: none;">
<div class="card border-success shadow mb-4">
<div class="card-header">
<p class="card-text font-weight-bold">
{% trans "External payment" %}
</p>
2020-03-14 14:13:58 +00:00
</div>
<ul class="list-group list-group-flush" id="source_note_list">
</ul>
<div class="card-body">
<div class="form-row">
<div class="col-md-12">
<label for="credit_type">{% trans "Transfer type" %} :</label>
<select id="credit_type" class="custom-select">
{% for special_type in special_types %}
<option value="{{ special_type.id }}">{{ special_type.special_type }}</option>
{% endfor %}
</select>
</div>
2020-03-14 14:13:58 +00:00
</div>
<div class="form-row">
<div class="col-md-12">
<label for="last_name">{% trans "Name" %} :</label>
<input type="text" id="last_name" class="form-control" />
</div>
2020-03-14 14:13:58 +00:00
</div>
<div class="form-row">
<div class="col-md-12">
<label for="first_name">{% trans "First name" %} :</label>
<input type="text" id="first_name" class="form-control" />
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<label for="bank">{% trans "Bank" %} :</label>
<input type="text" id="bank" class="form-control" />
</div>
2020-03-14 14:13:58 +00:00
</div>
</div>
</div>
</div>
{% endif %}
2020-03-14 14:13:58 +00:00
<div class="col-md-8" id="dests_div">
2020-03-12 22:12:49 +00:00
<div class="card border-info shadow mb-4">
<div class="card-header">
<p class="card-text font-weight-bold" id="dest_title">
2020-03-14 16:40:31 +00:00
{% trans "Select receivers" %}
2020-03-12 22:12:49 +00:00
</p>
</div>
<ul class="list-group list-group-flush" id="dest_note_list">
</ul>
<div class="card-body">
<input class="form-control mx-auto d-block" type="text" id="dest_note" />
<ul class="list-group list-group-flush" id="dest_alias_matched">
</ul>
</div>
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="amount">{% trans "Amount" %} :</label>
2020-03-17 17:31:26 +00:00
<div class="input-group">
<input class="form-control mx-auto d-block" type="number" min="0" step="0.01" id="amount" />
<div class="input-group-append">
<span class="input-group-text"></span>
</div>
</div>
2020-03-12 22:12:49 +00:00
</div>
<div class="form-group col-md-6">
<label for="reason">{% trans "Reason" %} :</label>
<input class="form-control mx-auto d-block" type="text" id="reason" required />
2020-03-12 22:12:49 +00:00
</div>
</div>
<div class="form-row">
<div class="col-md-12">
<button id="transfer" class="form-control btn btn-primary">{% trans 'Transfer' %}</button>
</div>
</div>
2020-03-16 11:11:16 +00:00
<div class="card shadow mb-4" id="history">
<div class="card-header">
<p class="card-text font-weight-bold">
{% trans "Recent transactions history" %}
</p>
</div>
{% render_table table %}
</div>
2020-03-12 22:12:49 +00:00
{% endblock %}
{% block extrajavascript %}
<script>
TRANSFER_POLYMORPHIC_CTYPE = {{ polymorphic_ctype }};
SPECIAL_TRANSFER_POLYMORPHIC_CTYPE = {{ special_polymorphic_ctype }};
user_id = {{ user.note.pk }};
2020-03-12 22:12:49 +00:00
2020-03-14 14:13:58 +00:00
$("#type_gift").click(function() {
$("#emitters_div").hide();
$("#external_div").hide();
$("#dests_div").attr('class', 'col-md-8');
2020-03-14 16:40:31 +00:00
$("#dest_title").text("{% trans "Select receivers" %}");
2020-03-14 14:13:58 +00:00
});
$("#type_transfer").click(function() {
$("#external_div").hide();
2020-03-22 21:35:07 +00:00
$("#emitters_div").show();
$("#dests_div").attr('class', 'col-md-4');
2020-03-14 16:40:31 +00:00
$("#dest_title").text("{% trans "Select receivers" %}");
2020-03-14 14:13:58 +00:00
});
$("#type_credit").click(function() {
$("#emitters_div").hide();
$("#external_div").show();
$("#dests_div").attr('class', 'col-md-4');
2020-03-14 16:40:31 +00:00
$("#dest_title").text("{% trans "Credit note" %}");
2020-03-14 14:13:58 +00:00
});
$("#type_debit").click(function() {
$("#emitters_div").hide();
$("#external_div").show();
$("#dests_div").attr('class', 'col-md-4');
2020-03-14 16:40:31 +00:00
$("#dest_title").text("{% trans "Debit note" %}");
});
2020-03-12 22:12:49 +00:00
</script>
<script src="/static/js/transfer.js"></script>
2019-08-10 17:00:16 +00:00
{% endblock %}