forked from PolyLAN/polybanking
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
388 additions
and
13 deletions.
There are no files selected for viewing
85 changes: 85 additions & 0 deletions
85
server/configs/migrations/0004_auto__add_field_config_group.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
# -*- coding: utf-8 -*- | ||
import datetime | ||
from south.db import db | ||
from south.v2 import SchemaMigration | ||
from django.db import models | ||
|
||
|
||
class Migration(SchemaMigration): | ||
|
||
def forwards(self, orm): | ||
# Adding field 'Config.group' | ||
db.add_column(u'configs_config', 'group', | ||
self.gf('django.db.models.fields.CharField')(max_length=255, null=True, blank=True), | ||
keep_default=False) | ||
|
||
|
||
def backwards(self, orm): | ||
# Deleting field 'Config.group' | ||
db.delete_column(u'configs_config', 'group') | ||
|
||
|
||
models = { | ||
u'auth.group': { | ||
'Meta': {'object_name': 'Group'}, | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), | ||
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) | ||
}, | ||
u'auth.permission': { | ||
'Meta': {'ordering': "(u'content_type__app_label', u'content_type__model', u'codename')", 'unique_together': "((u'content_type', u'codename'),)", 'object_name': 'Permission'}, | ||
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['contenttypes.ContentType']"}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) | ||
}, | ||
u'auth.user': { | ||
'Meta': {'object_name': 'User'}, | ||
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), | ||
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), | ||
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), | ||
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), | ||
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), | ||
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) | ||
}, | ||
u'configs.config': { | ||
'Meta': {'object_name': 'Config'}, | ||
'active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'admin_enable': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'allowed_users': ('django.db.models.fields.related.ManyToManyField', [], {'to': u"orm['auth.User']", 'symmetrical': 'False', 'blank': 'True'}), | ||
'group': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'key_api': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'key_ipn': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'key_request': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}), | ||
'test_mode': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), | ||
'url_back_err': ('django.db.models.fields.URLField', [], {'max_length': '200'}), | ||
'url_back_ok': ('django.db.models.fields.URLField', [], {'max_length': '200'}), | ||
'url_ipn': ('django.db.models.fields.URLField', [], {'max_length': '200'}) | ||
}, | ||
u'configs.configlogs': { | ||
'Meta': {'object_name': 'ConfigLogs'}, | ||
'config': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['configs.Config']"}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'text': ('django.db.models.fields.TextField', [], {}), | ||
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['auth.User']"}), | ||
'when': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}) | ||
}, | ||
u'contenttypes.contenttype': { | ||
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, | ||
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), | ||
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), | ||
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) | ||
} | ||
} | ||
|
||
complete_apps = ['configs'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ celery | |
django-celery | ||
python-dateutil | ||
PicklingTools | ||
reportlab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{% extends "base.html" %} | ||
{% load i18n %} | ||
{% load bootstrap3 %} | ||
|
||
{% block title %}{{block.super}} :: {% trans "Summary" %}{% endblock %} | ||
|
||
{% block content %} | ||
|
||
<script type="text/javascript">$('#nav-summary').addClass('active');</script> | ||
|
||
<h2>{% trans "Export of data" %}</h2> | ||
|
||
<ol class="breadcrumb"> | ||
<li><a href="{% url 'main.views.home' %}"><i class="fa fa-home"></i> {% trans "Home" %}</a></li> | ||
|
||
<li class="active"><i class="fa fa-ticket"></i> {% trans "Summary form" %}</li> | ||
|
||
</ol> | ||
|
||
<div class="row-fluid"> | ||
<div class="panel panel-primary"> | ||
<div class="panel-heading"> | ||
<h3 class="panel-title">{% trans "Summary parameters" %}</h3> | ||
</div> | ||
<div class="panel-body"> | ||
|
||
<form action="" method="POST"> | ||
{% csrf_token %} | ||
|
||
{% bootstrap_form form %} | ||
|
||
<div class="row-fluid box-section" style="text-align: right;"> | ||
<input type="submit" class="btn btn-primary" value="{% trans "Save" %}"> | ||
</div> | ||
|
||
</form> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
|
||
<script type="text/javascript"> | ||
$('#id_range').select2(); | ||
</script> | ||
|
||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
{% load i18n %}<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
<html> | ||
<head> | ||
<title>PolyBanking - {% blocktrans with start_date=start_date|date:"r" end_date=end_date|date:"r" %}Summary from {{start_date}} to {{end_date}}{% endblocktrans %}</title> | ||
<style type="text/css"> | ||
@page { | ||
size: {{ pagesize }}; | ||
margin: 1cm; | ||
@frame footer { | ||
-pdf-frame-content: footerContent; | ||
bottom: 0cm; | ||
margin-left: 9cm; | ||
margin-right: 9cm; | ||
height: 1cm; | ||
} | ||
} | ||
|
||
table tr { | ||
border: 1px black solid; | ||
padding: 3px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>PolyBanking - {% blocktrans with start_date=start_date|date:"r" end_date=end_date|date:"r" %}Summary from {{start_date}} to {{end_date}}{% endblocktrans %}</h1> | ||
<div> | ||
{% for group_name, group_data in data.items %} | ||
<h2>{{group_name}}</h2> | ||
|
||
<table> | ||
<thead> | ||
<tr> | ||
<th>{% trans "Config" %}</th> | ||
<th>{% trans "From" %}</th> | ||
<th>{% trans "To" %}</th> | ||
<th>{% trans "Total" %}</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
|
||
{% for configs_data in group_data.0 %} | ||
|
||
{% for config_data in configs_data %} | ||
|
||
{% if forloop.first %} | ||
<tr> | ||
<td>{{config_data.3.name}} {% if config_data.3.test_mode %}{% trans "(Test mode !)" %}{% endif %}</td> | ||
<td>{{config_data.0|date:"r"}}</td> | ||
<td>{{config_data.1|date:"r"}}</td> | ||
<td>{{config_data.2|floatformat:"2"}} CHF</td> | ||
</tr> | ||
{% else %} | ||
|
||
|
||
{% if forloop.last %} | ||
<tr> | ||
<td></td> | ||
<td></td> | ||
<td></td> | ||
<td><b>{{config_data|floatformat:"2"}} CHF</b></td> | ||
</tr> | ||
{% else %} | ||
|
||
|
||
<tr> | ||
<td></td> | ||
<td>{{config_data.0|date:"r"}}</td> | ||
<td>{{config_data.1|date:"r"}}</td> | ||
<td>{{config_data.2|floatformat:"2"}} CHF</td> | ||
</tr> | ||
|
||
{% endif %} | ||
|
||
|
||
{% endif %} | ||
|
||
{% endfor %} | ||
|
||
|
||
{% endfor %} | ||
|
||
<tr style="border: none;"><td></td><td></td><td></td><td> </td></tr> | ||
|
||
<tr><td><b>{% trans "Total" %}</b></td><td>{{start_date|date:"r"}}</td><td>{{end_date|date:"r"}}</td><td><b><u>{{group_data.1|floatformat:"2"}} CHF</u></b></td></tr> | ||
|
||
|
||
</tbody> | ||
</table> | ||
|
||
{% endfor %} | ||
</div> | ||
<div id="footerContent"> | ||
{%block page_foot%} | ||
Page <pdf:pagenumber> - PolyBanking - {% blocktrans with start_date=start_date|date:"r" end_date=end_date|date:"r" %}Summary from {{start_date}} to {{end_date}}{% endblocktrans %} | ||
{%endblock%} | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,7 @@ | |
|
||
url(r'^$', 'home'), | ||
|
||
url(r'^summary$', 'summary'), | ||
|
||
|
||
) |
Oops, something went wrong.