You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
148 lines
7.4 KiB
148 lines
7.4 KiB
{% extends request.is_ajax|yesno:'nullcont.htm,abonapp/ext.htm' %}
|
|
{% load i18n %}
|
|
{% block content %}
|
|
|
|
<div class="row">
|
|
<div class="col-sm-6">
|
|
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">{% trans "Subscriber's service" %}</h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
{% if abon_tariff %}
|
|
|
|
<dl class="dl-horizontal">
|
|
<dt>{% trans 'Service' %}</dt>
|
|
<dd>
|
|
{% if abon_tariff.tariff %}
|
|
{% if perms.tariff_app.change_tariff %}
|
|
<a href="{% url 'tarifs:edit' abon_tariff.tariff.pk %}" title="{{ abon_tariff.time_start|default:'' }}">
|
|
{{ abon_tariff.tariff.title }}
|
|
</a>
|
|
{% else %}
|
|
{{ abon_tariff.tariff.title }}
|
|
{% endif %}
|
|
{% else %}
|
|
<b class="text-danger">{% trans 'We have a problem in DB: AbonTariff instance has no related to service' %}</b>
|
|
{% endif %}
|
|
</dd>
|
|
<dt>{% trans 'Sum' %}</dt>
|
|
<dd>{{ abon_tariff.tariff.amount }} {% trans 'currency' %}.</dd>
|
|
|
|
<dt>{% trans 'Input speed' %}</dt>
|
|
<dd>{{ abon_tariff.tariff.speedIn }}</dd>
|
|
|
|
<dt>{% trans 'Output speed' %}</dt>
|
|
<dd>{{ abon_tariff.tariff.speedOut }}</dd>
|
|
|
|
<dt>{% trans 'Date of start' %}</dt>
|
|
<dd>{{ abon_tariff.time_start|date:"d E Y, l H:i" }}</dd>
|
|
|
|
<dt>{% trans 'Works until' %}</dt>
|
|
<dd>{{ abon_tariff.deadline|date:"d E Y, l H:i" }}</dd>
|
|
</dl>
|
|
|
|
<blockquote>
|
|
<p>{{ abon_tariff.tariff.descr }}</p>
|
|
</blockquote>
|
|
|
|
{% else %}
|
|
{% trans 'Subscriber has no service' %}.
|
|
<a href="{% url 'abonapp:pick_tariff' group.pk abon.pk %}">
|
|
{% trans 'Buy service' %}
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if abon_tariff %}
|
|
<a href="{% url 'abonapp:unsubscribe_service' group.pk abon.pk abon_tariff.pk %}" class="btn btn-sm btn-danger">
|
|
<span class="glyphicon glyphicon-remove-circle"></span> {% trans 'Finish service' %}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">{% trans 'Services for buy' %}</h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
<table class="table table-condensed">
|
|
<thead>
|
|
<tr>
|
|
<th>{% trans 'Pick a service' %}</th>
|
|
<th>{% trans 'Service' %}</th>
|
|
<th>{% trans 'Price' %}</th>
|
|
<th>{% trans 'Speed In' %}</th>
|
|
<th>{% trans 'Speed Out' %}</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% with can_ch_trf=perms.tariff_app.change_tariff %}
|
|
{% for service in services %}
|
|
<tr>
|
|
<td><a href="{% url 'abonapp:pick_tariff' group.pk abon.pk %}?selected_tariff={{ service.pk }}"
|
|
class="btn btn-sm btn-default" title="{{ service.get_calc_type_display }}" data-toggle="tooltip"{% if abon_tariff %} disabled{% endif %}>
|
|
<span class="glyphicon glyphicon-shopping-cart"></span>
|
|
</a></td>
|
|
<td>
|
|
{% if can_ch_trf %}
|
|
<a href="{% url 'tarifs:edit' service.pk %}" title="{{ service.descr }}" data-toggle="tooltip"><b>{{ service.title }}</b></a>
|
|
{% else %}
|
|
{{ service.title }}
|
|
{% endif %}
|
|
</td>
|
|
<td>{{ service.amount }} {% trans 'currency' %}</td>
|
|
<td>{{ service.speedIn }}</td>
|
|
<td>{{ service.speedOut }}</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr><td colspan="5">
|
|
{% trans 'This group has no services' %}
|
|
<a href="{% url 'abonapp:ch_group_tariff' group.pk %}" class="btn btn-sm btn-default" title="{% trans 'User groups' %}">
|
|
<span class="glyphicon glyphicon-cog"></span> {% trans 'Tariffs in groups' %}
|
|
</a>
|
|
</td></tr>
|
|
{% endfor %}
|
|
{% endwith %}
|
|
</tbody>
|
|
</table>
|
|
<a href="{% url 'abonapp:ch_group_tariff' group.pk %}" class="btn btn-sm btn-primary" title="{% trans 'User groups' %}">
|
|
<span class="glyphicon glyphicon-cog"></span> {% trans 'Attach services to group' %}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if perms.tariff_app.can_view_periodic_pay %}
|
|
<div class="col-sm-6">
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h3 class="panel-title">{% trans 'Periodic pay' %}</h3>
|
|
</div>
|
|
<div class="panel-body">
|
|
{% if periodic_pay %}
|
|
<dl class="dl-horizontal">
|
|
<dt>{% trans 'Pay logic' %}</dt>
|
|
<dd>{{ periodic_pay.periodic_pay }}</dd>
|
|
<dt>{% trans 'Last pay' %}</dt>
|
|
<dd>{{ periodic_pay.last_pay|default:'Not yet paid' }}</dd>
|
|
<dt>{% trans 'Next time to pay' %}</dt>
|
|
<dd>{{ periodic_pay.next_pay|date:'d E Y' }}</dd>
|
|
</dl>
|
|
<a href="{% url 'abonapp:del_periodic_pay' group.pk abon.pk periodic_pay.pk %}" class="btn btn-sm btn-danger">
|
|
<span class="glyphicon glyphicon-remove-circle"></span> {% trans 'Remove periodic pay' %}
|
|
</a>
|
|
{% else %}
|
|
<a href="{% url 'abonapp:add_periodic_pay' group.pk abon.pk %}" class="btn btn-primary btn-sm btn-modal">
|
|
<span class="glyphicon glyphicon-plus"></span> {% trans 'Add periodic pay' %}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% endblock %}
|