Big Update
This commit is contained in:
parent
bb88a18336
commit
db0a7a47e7
9 changed files with 41 additions and 72 deletions
|
@ -61,5 +61,5 @@ class ControllerBilling:
|
|||
).count()
|
||||
transactions['items'] = models.UsersBalanceTransactions.select().where(
|
||||
models.UsersBalanceTransactions.user == user_id
|
||||
)
|
||||
).order_by(models.UsersBalanceTransactions.created.desc())
|
||||
return transactions
|
||||
|
|
|
@ -13,9 +13,9 @@ class ControllerPayments:
|
|||
balance.balance += float(amount)
|
||||
balance.save()
|
||||
|
||||
def transaction_create(self, user_id, amount, status='process'):
|
||||
def transaction_create(self, user_id, amount, method, status='process'):
|
||||
# create transaction data to database
|
||||
transaction = models.UsersBalanceTransactions(user=user_id, amount=amount, status=status)
|
||||
transaction = models.UsersBalanceTransactions(user=user_id, amount=amount, status=status, method=method)
|
||||
transaction.save()
|
||||
return transaction.id
|
||||
|
||||
|
|
|
@ -175,6 +175,7 @@ class UsersBalanceTransactions(PgSQLModel):
|
|||
notified = IntegerField(null=False, default=0)
|
||||
# success, process, fail
|
||||
status = TextField(null=False)
|
||||
paid = DateTimeField()
|
||||
# robokassa, webmoney, yandex_money, rbk_money, alfaclick, sberbank_online, paypal, invoice
|
||||
method = CharField(null=False, default=0)
|
||||
details = JSONField(default='{}')
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<footer>
|
||||
<div class="row">
|
||||
<div class="large-4 medium-4 columns">
|
||||
<div class="large-6 medium-6 columns">
|
||||
<b>{{ _('Поддержка') }}</b>
|
||||
<ul>
|
||||
{% if g.settings.get('SUPPORT_TEL', None) %}
|
||||
|
@ -12,18 +12,8 @@
|
|||
<li><a href="{{ url_for('support.index') }}">{{ _('Форма обратной связи') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="large-4 medium-4 columns"><b>{{ _('Сообщество') }}</b>
|
||||
<ul>
|
||||
<li><a href="/blog">{{ _('Блог') }}</a></li>
|
||||
<li><a href="/blog">{{ _('Facebook') }}</a></li>
|
||||
<li><a href="/blog">{{ _('Twitter') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="large-4 medium-4 columns">
|
||||
<div class="large-6 medium-6 columns">
|
||||
<p>2009−2016 © GoCloud.ru</p>
|
||||
<script type="text/javascript" src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="//yastatic.net/share2/share.js" charset="utf-8"></script>
|
||||
<div class="ya-share2" data-services="vkontakte,facebook,gplus,twitter,blogger,linkedin" data-counter=""></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-6 columns">
|
||||
<div class="large-12 columns">
|
||||
<h4>История платежей</h4>
|
||||
<table width="100%">
|
||||
<thead>
|
||||
|
@ -32,55 +32,16 @@
|
|||
{% else %}
|
||||
{% for record in history['items'] %}
|
||||
<tr>
|
||||
<td>{{ record['amount'] }}</td>
|
||||
<td>{{ record['created'] }}</td>
|
||||
<td>
|
||||
{% if record['status'] == "process" %}
|
||||
<span class="label attention">{{ record['status'] }}</span>
|
||||
{% elif record['status'] == "fail" %}
|
||||
<span class="label error">{{ record['status'] }}</span>
|
||||
{% elif record['status'] == "success" %}
|
||||
<span class="label success">{{ record['status'] }}</span>
|
||||
{% else %}
|
||||
{{ record['status'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="large-6 columns">
|
||||
<h4>Выставленные счета</h4>
|
||||
<table width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Сумма</th>
|
||||
<th>Дата</th>
|
||||
<th>Статус</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="border-left: 3px orange solid">590.0 рублей</td>
|
||||
<td><a href="">2016-03-21</a></td>
|
||||
<td>Неоплачен</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border-left: 3px green solid">590.0 рублей</td>
|
||||
<td><a href="">2016-03-21</a></td>
|
||||
<td>Оплачен</td>
|
||||
</tr>
|
||||
{% if history['total'] == 0 %}
|
||||
<!-- tr>
|
||||
<td colspan="3">Нет записей.</td>
|
||||
</tr-->
|
||||
{% else %}
|
||||
{% for record in history['items'] %}
|
||||
<tr>
|
||||
<td>{{ record['amount'] }}</td>
|
||||
<td>{{ record['id'] }}</td>
|
||||
<td>{{ record['created'] }}</td>
|
||||
<td>{{ record['amount'] }}руб.</td>
|
||||
<td>
|
||||
{% if record['details']['description'] %}
|
||||
{{ record['details']['description'] }}
|
||||
{% else %}
|
||||
Засчисление на лицевой счёт
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if record['status'] == "process" %}
|
||||
<span class="label attention">{{ record['status'] }}</span>
|
||||
|
@ -92,6 +53,7 @@
|
|||
{{ record['status'] }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>{{record['method']}}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<h2>Спасибо!</h2>
|
||||
</div>
|
||||
<div class="large-12 columns">
|
||||
<p>Спасибо за обращение в поддержку. Мы ответим вам в кротчайшее время.</p>
|
||||
<p>Спасибо за обращение в техническую поддержку. Мы ответим вам в кратчайшее время.</p>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
|
@ -80,8 +80,11 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns text-center">
|
||||
<p class="copyright">2009-2016 © GoCloud.ru</p>
|
||||
<script type="text/javascript" src="//yastatic.net/es5-shims/0.0.2/es5-shims.min.js" charset="utf-8"></script>
|
||||
<script type="text/javascript" src="//yastatic.net/share2/share.js" charset="utf-8"></script>
|
||||
<div class="ya-share2" data-services="vkontakte,facebook,gplus,twitter,blogger,linkedin" data-counter=""></div>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
|
|
|
@ -48,7 +48,7 @@ def robokassa(action):
|
|||
amount = request.form['amount']
|
||||
|
||||
# create transaction data to database
|
||||
transaction_id = controller_robokassa.transaction_create(user_id, amount, 'process')
|
||||
transaction_id = controller_robokassa.transaction_create(user_id, amount, 'robokassa', 'process')
|
||||
|
||||
payment_details = {
|
||||
"payment_id": transaction_id,
|
||||
|
|
23
setup.py
23
setup.py
|
@ -4,7 +4,7 @@ from setuptools import setup
|
|||
|
||||
setup(
|
||||
name='SWSCloudCore',
|
||||
version='2.6.0',
|
||||
version='2.7.0',
|
||||
author='Vyacheslav Anzhiganov',
|
||||
author_email='hello@anzhiganov.com',
|
||||
packages=[
|
||||
|
@ -36,17 +36,20 @@ setup(
|
|||
'SWSCloudWeb',
|
||||
'SWSCloudWeb.views',
|
||||
'SWSCloudWeb.views.account',
|
||||
'SWSCloudWeb.views.containers',
|
||||
'SWSCloudWeb.views.bills',
|
||||
'SWSCloudWeb.views.compute.containers',
|
||||
'SWSCloudWeb.views.compute.vms',
|
||||
'SWSCloudWeb.views.documents',
|
||||
'SWSCloudWeb.views.kb',
|
||||
'SWSCloudWeb.views.payments',
|
||||
'SWSCloudWeb.views.settings',
|
||||
'SWSCloudWeb.views.support',
|
||||
'SWSCloudWeb.views.tasks',
|
||||
'SWSCloudWeb.views.vms',
|
||||
# Administrator
|
||||
'SWSCloudAdministrator',
|
||||
'SWSCloudAdministrator.Administrator',
|
||||
# StatisticsClient
|
||||
'SWSStatisticsClient',
|
||||
],
|
||||
package_data={
|
||||
'SWSCloudWeb': [
|
||||
|
@ -61,10 +64,17 @@ setup(
|
|||
'static/js/*.js',
|
||||
'static/js/foundation/*.js',
|
||||
'static/js/vendor/*.js',
|
||||
# New homepage
|
||||
'static/assets/css/*.css',
|
||||
'static/assets/img/*.png',
|
||||
'static/assets/img/testimonials*.png',
|
||||
'static/assets/js/*.js',
|
||||
# Templates
|
||||
'templates/*.html',
|
||||
'templates/default/*.html',
|
||||
'templates/default/containers/*.html',
|
||||
'templates/default/billing/*.html',
|
||||
'templates/default/compute/containers/*.html',
|
||||
'templates/default/compute/vms/*.html',
|
||||
'templates/default/documents/*.html',
|
||||
'templates/default/homepage/*.html',
|
||||
'templates/default/id/*.html',
|
||||
|
@ -73,9 +83,12 @@ setup(
|
|||
'templates/default/payment/robokassa/*.html',
|
||||
'templates/default/support/*.html',
|
||||
'templates/default/tasks/*.html',
|
||||
'templates/default/vms/*.html',
|
||||
'templates/email/simple/*.html',
|
||||
'templates/email/simple/*.css',
|
||||
# GoCloud2016
|
||||
'templates/gocloud2016/layouts/*.html',
|
||||
'templates/gocloud2016/macros/*.html',
|
||||
'templates/gocloud2016/pages/*.html',
|
||||
# Errors
|
||||
'templates/errors/*.html',
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue