Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix encoding error in payment description #12

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions billservice/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ class Account(DynamicModel):
deleted = models.DateTimeField(blank=True, null=True, db_index=True)
promise_summ = models.IntegerField(_(u'Максимальный обещанный платёж'), blank=True, default=0)
promise_min_ballance = models.IntegerField(_(u'Минимальный баланс для обещанного платежа'), blank=True, default=0)
promise_days = models.IntegerField(_(u'Длительность обещанного платежа, дней'), blank=True, default=1)
promise_days = models.IntegerField(_(u'Длительность обещанного платежа, дней'), blank=True, default=0)
#allow_block_after_summ = models.BooleanField(_(u'Разрешить блокировку списаний'), blank=True, default=False, help_text= _(u"Разрешить приостановку списаний по периодическим и подключаемым услугам при достижении указанного баланса"))
#block_after_summ = models.IntegerField(_(u'Блокировка списаний после суммы'), blank=True, default=0)
account_group = models.ForeignKey(AccountGroup, verbose_name=_(u'Группа'), blank=True, null=True,
Expand Down Expand Up @@ -2644,4 +2644,4 @@ class Meta:

def get_remove_url(self):
return "%s?id=%s" % (reverse('registrationrequest_delete'), self.id)

14 changes: 8 additions & 6 deletions billservice/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def get_promise(request):
user = request.user.account
promise_summ = user.promise_summ if user.promise_summ not in [None, 0, ''] else settings.MAX_PROMISE_SUM
promise_min_ballance = user.promise_min_ballance if user.promise_min_ballance not in [None, 0, ''] else settings.MIN_BALLANCE_FOR_PROMISE
allow_transfer_summ= "%.2f" % (0 if user.ballance<=0 else user.ballance)
allow_transfer_summ= "%.2f" % (0 if user.ballance<=0 or Transaction.objects.filter(account=user, type=TransactionType.objects.get(internal_name='PROMISE_PAYMENT'), promise_expired=False).count() >= 1 else user.ballance)
LEFT_PROMISE_DATE = datetime.datetime.now()+datetime.timedelta(days = user.promise_days or settings.LEFT_PROMISE_DAYS)
if settings.ALLOW_PROMISE==True and Transaction.objects.filter(account=user, type=TransactionType.objects.get(internal_name='PROMISE_PAYMENT'), promise_expired=False).count() >= 1:
last_promises = Transaction.objects.filter(account=user, type=TransactionType.objects.get(internal_name='PROMISE_PAYMENT')).order_by('-created')[0:10]
Expand Down Expand Up @@ -504,10 +504,10 @@ def transaction(request):
summ_on_page = 0
transactions = paginator.get_page_items()
if is_range:
for trnsaction in qs:
summ += trnsaction.summ
for transactio in transactions:
summ_on_page += trnsaction.summ
for transaction in qs:
summ += transaction.summ
for transaction in transactions:
summ_on_page += transaction.summ
summ = summ
summ_on_page = summ_on_page
rec_count = len(transactions)+1
Expand Down Expand Up @@ -1003,6 +1003,7 @@ def traffic_limit(request):
@login_required
def statistics(request):
user = request.user.account
last_promises = Transaction.objects.filter(account=user, type=TransactionType.objects.get(internal_name='PROMISE_PAYMENT')).order_by('-created')[0:8]
transaction = Transaction.objects.filter(account=user).order_by('-created')[:8]
active_session = ActiveSession.objects.filter(account=user).order_by('-date_start')[:8]
periodical_service_history = PeriodicalServiceHistory.objects.filter(account=user).order_by('-created')[:8]
Expand All @@ -1028,6 +1029,7 @@ def statistics(request):
return {
#'net_flow_stream':net_flow_streams,
'transactions':transaction,
'last_promises':last_promises,
'active_session':active_session,
#'services':services,
'periodical_service_history':periodical_service_history,
Expand Down Expand Up @@ -1385,4 +1387,4 @@ def get_context_data(self, **kwargs):
context = super(SelectPaymentView, self).get_context_data(**kwargs)
context['payment_form'] = SelectPaymentMethodForm()
return context

10 changes: 4 additions & 6 deletions media/css/new_design.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


.clear {
clear:both;
}
Expand Down Expand Up @@ -581,9 +579,9 @@ a.helpdesk-img:hover, a.helpdesk-img-active {

.statistics_link a.open, .open {
background:url('../img/open.gif') no-repeat;
width:12px;
height:13px;
margin-right:16px;
width:13px;
height:12px;
margin-right:10px;
float:right;
padding:0;
}
Expand All @@ -601,7 +599,7 @@ a.helpdesk-img:hover, a.helpdesk-img-active {
background:url('../img/more.gif') no-repeat;
width:13px;
height:12px;
margin-right:14px;
margin-right:10px;
float:right;
padding:0;

Expand Down
1 change: 1 addition & 0 deletions paymentgateways/webmoney/templates/wm_sample/redirect.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<script type="text/javascript">
function load()
{
document.charset='windows-1251';
window.document.pay.submit();
return;
}
Expand Down
13 changes: 7 additions & 6 deletions templates/accounts/get_promise.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,24 +68,24 @@
<input type="hidden" name='operation' value="promise">
</form>
{% endif %}
{% if last_promises %}
{% if disable_promise and last_promises %}
<table class="wide statistic_table" cellpadding="0" cellspacing="0">
<tr>
<th class="white bold s-11 blue_caption a-left">{% blocktrans %}ИСТОРИЯ ОБЕЩАННЫХ ПЛАТЕЖЕЙ{% endblocktrans %}</th>
<th class="white bold s-11 blue_caption a-left">{% blocktrans %}НЕЗАКРЫТЫЕ ОБЕЩАННЫЕ ПЛАТЕЖИ{% endblocktrans %}</th>
</tr>
<tr>
<td>
<table class="wide extra_table" cellpadding="0" cellspacing="0">
<tr>
<th>{% blocktrans %}Дата{% endblocktrans %}</th>
<th>{% blocktrans %}Сумма{% endblocktrans %}</th>
<th>{% blocktrans %}Взята до{% endblocktrans %}</th>
<th>{% blocktrans %}Взят до{% endblocktrans %}</th>
<th>{% blocktrans %}Комментарий{% endblocktrans %}</th>
<th>{% blocktrans %}Платёж закрыт{% endblocktrans %}</th>

</tr>
{% for promise in last_promises %}

{% if not promise.promise_expired %}
<tr>
<td class="{{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{{ promise.created|date:"d.m.Y H:i" }}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{{ promise.human_sum|floatformat:2 }}&nbsp;{{ CURRENCY }}</td>
Expand All @@ -94,6 +94,7 @@
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %} bold">{% if promise.promise_expired %}Да{% else %} Нет{% endif %}&nbsp;</td>

</tr>
{% endif %}
{% endfor %}
</table>

Expand All @@ -105,5 +106,5 @@


{% block title %}
{% blocktrans %}ИСТОРИЯ ПОДКЛЮЧАЕМЫХ УСЛУГ{% endblocktrans %}
{% endblock %}
{% blocktrans %}ОПЕРАЦИИ С БАЛАНСОМ{% endblocktrans %}
{% endblock %}
4 changes: 2 additions & 2 deletions templates/accounts/periodical_service_history.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<tr>
<td class="{{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ service.service.name }}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ service.created|date:"d.m.Y H:i" }}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ service.summ }}&nbsp;{{ CURRENCY }}</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ service.summ|floatformat:2 }}&nbsp;{{ CURRENCY }}</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ service.type.name }}&nbsp;</td>
</tr>
{% endfor %}
Expand All @@ -46,4 +46,4 @@ <h2 align="center">{% blocktrans %}Данных нет{% endblocktrans %}</h2>

{% block title %}
{% blocktrans %}Биллинговая информация{% endblocktrans %}
{% endblock %}
{% endblock %}
39 changes: 38 additions & 1 deletion templates/accounts/statistics.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,44 @@
</td>
</tr>
{% endif %}


{% if last_promises %}
<tr>
<th class="white bold s-11 blue_caption">
<div class="f-right statistics_link white">
<a id="promises_data_a" class="close" href="javascript:return 0;" onclick="runEffect('promises_data')">&nbsp;</a>
</div>
<div class="f-left statistics_title">{% blocktrans %}ИСТОРИЯ ОБЕЩАННЫХ ПЛАТЕЖЕЙ{% endblocktrans %}</div>
</th>
</tr>
<tr>
<td id="promises_data">
<table class="wide extra_table" cellpadding="0" cellspacing="0">
<tr>
<th>{% blocktrans %}Дата{% endblocktrans %}</th>
<th>{% blocktrans %}Сумма{% endblocktrans %}</th>
<th>{% blocktrans %}Взят до{% endblocktrans %}</th>
<th>{% blocktrans %}Списан со счёта{% endblocktrans %}</th>
<th>{% blocktrans %}Комментарий{% endblocktrans %}</th>
</tr>
{% for promise in last_promises %}
<tr>
<td class="{{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{{ promise.created|date:"d.m.Y H:i" }}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{{ promise.human_sum|floatformat:2 }}&nbsp;{{ CURRENCY }}</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{{ promise.end_promise|date:"d.m.Y H:i" }}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{% if promise.promise_expired %}Да{% else %} Нет{% endif %}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last %}no_border{% endif %}">{{ promise.description }}&nbsp;</td>
</tr>
{% endfor %}
<tr>
<td colspan="7" class="no_border">&nbsp;</td>
</tr>
</table>

</td>
</tr>
{% endif %}

{% if active_session %}
<tr>
<th class="white bold s-11 blue_caption">
Expand Down
2 changes: 1 addition & 1 deletion templates/accounts/transaction.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{% for transaction in transactions %}
<tr>
<td width="100px" class="{{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ transaction.created|date:"d.m.Y H:i"}}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}" align="right">{{ transaction.summ}}&nbsp;{{ CURRENCY }}</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}" align="right">{{ transaction.summ|floatformat:2 }}&nbsp;{{ CURRENCY }}</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}" align="center">{% if transaction.promise %}да{% else %}нет{% endif %}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{{ transaction.end_promise|date:"d.m.Y" }}&nbsp;</td>
<td class="left_border {{ forloop.counter|coll_bg }} {% if forloop.last and not is_range %}no_border{% endif %}">{% ifequal transaction.description None %}&nbsp;{% else %} {{ transaction.description }} &nbsp;{% endifequal %}&nbsp;</td>
Expand Down