Added journal
This commit is contained in:
parent
df0dd6cedc
commit
db9be39f76
8 changed files with 79 additions and 6 deletions
|
@ -75,6 +75,7 @@ INSTALLED_APPS = [
|
|||
"django.contrib.admindocs",
|
||||
"bda",
|
||||
"petitscours",
|
||||
"journaldecaisse.apps.JournaldecaisseConfig",
|
||||
"captcha",
|
||||
"django_cas_ng",
|
||||
"bootstrapform",
|
||||
|
|
|
@ -16,6 +16,8 @@ from wagtail.admin import urls as wagtailadmin_urls
|
|||
from wagtail.core import urls as wagtail_urls
|
||||
from wagtail.documents import urls as wagtaildocs_urls
|
||||
|
||||
|
||||
|
||||
from gestioncof import csv_views, views as gestioncof_views
|
||||
from gestioncof.autocomplete import autocomplete
|
||||
from gestioncof.urls import (
|
||||
|
@ -43,6 +45,8 @@ urlpatterns = [
|
|||
path("event/", include(events_patterns)),
|
||||
# Calendrier
|
||||
path("calendar/", include(calendar_patterns)),
|
||||
#Journal de Caisse
|
||||
path('journaldecaisse/', include('journaldecaisse.urls', namespace="journaldecaisse")),
|
||||
# Clubs
|
||||
path("clubs/", include(clubs_patterns)),
|
||||
# Authentification
|
||||
|
|
|
@ -91,6 +91,24 @@
|
|||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<h3 class="block-title">Journal de Caisse<span class="pull-right glyphicon glyphicon-cog"></span></h3>
|
||||
<div class="hm-block">
|
||||
<ul>
|
||||
<h4>Journaux</h4>
|
||||
<li><a href="{% url "journaldecaisse:index" %}">Journal de Kaisse</a></li>
|
||||
<li><a href="{% url "petits-cours-demandes-list" %}">Journal d'Emprunts</a></li>
|
||||
</ul>
|
||||
<ul>
|
||||
<h4>Vente</h4>
|
||||
{% for event in events %}
|
||||
<li><a href="{% url "event.details.status" event.id %}">Événement : {{ event.title }}</a></li>
|
||||
{% endfor %}
|
||||
{% for survey in surveys %}
|
||||
<li><a href="{% url "survey.details.status" survey.id %}">Sondage : {{ survey.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<h3 class="block-title">Gestion tirages BdA<span class="pull-right glyphicon glyphicon-list"></span></h3>
|
||||
<div class="hm-block">
|
||||
{% if active_tirages %}
|
||||
|
|
|
@ -2,4 +2,5 @@ from django.apps import AppConfig
|
|||
|
||||
|
||||
class JournaldecaisseConfig(AppConfig):
|
||||
name = 'journaldecaisse'
|
||||
|
||||
name = "journaldecaisse"
|
||||
|
|
|
@ -2,9 +2,9 @@ from django.db import models
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
|
||||
PAYMENTS_CHOICES = (
|
||||
("cash", _("Espèces")),
|
||||
("cb", _("CB")),
|
||||
("check", _("Chèque")),
|
||||
("Espèces", _("Espèces")),
|
||||
("CB", _("CB")),
|
||||
("Chèque", _("Chèque")),
|
||||
)
|
||||
|
||||
class JournalEntry(models.Model):
|
||||
|
|
45
journaldecaisse/templates/journaldecaisse/index.html
Normal file
45
journaldecaisse/templates/journaldecaisse/index.html
Normal file
|
@ -0,0 +1,45 @@
|
|||
{% extends "petitscours/base_title.html" %}
|
||||
{% load staticfiles %}
|
||||
|
||||
{% block realcontent %}
|
||||
<h2>Journal de Kaisse</h2>
|
||||
{% if entry_list %}
|
||||
<table class="table table-stripped">
|
||||
<thead>
|
||||
<th>Date</th>
|
||||
<th>Cofeux.se</th>
|
||||
<th>Objet</th>
|
||||
<th>Moyen de Paiement</th>
|
||||
<th>Montant</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for entry in entry_list %}
|
||||
<tr>
|
||||
<td>{{ entry.entry_date|date:"M d, Y" }}</td>
|
||||
<td>{{ entry.cofeux_id }}</td>
|
||||
<td>{{ entry.entry_text }}</td>
|
||||
<td> {{ entry.payment_type}}</td>
|
||||
<td> {{ entry.entry_amount }}€</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% if is_paginated %}
|
||||
<div class="pagination">
|
||||
<span class="page-links">
|
||||
{% if page_obj.has_previous %}
|
||||
<a href="{% url "petits-cours-demandes-list" %}?page={{ page_obj.previous_page_number }}"><</a>
|
||||
{% endif %}
|
||||
<span class="page-current">
|
||||
Page {{ page_obj.number }} sur {{ page_obj.paginator.num_pages }}
|
||||
</span>
|
||||
{% if page_obj.has_next %}
|
||||
<a href="{% url "petits-cours-demandes-list" %}?page={{ page_obj.next_page_number }}">></a>
|
||||
{% endif %}
|
||||
</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>Aucune demande :(</p>
|
||||
{% endif %}
|
||||
{% endblock %}
|
|
@ -2,6 +2,7 @@ from django.urls import path
|
|||
|
||||
from . import views
|
||||
|
||||
app_name = 'journaldecaisse'
|
||||
urlpatterns = [
|
||||
path('', views.index, name='index'),
|
||||
]
|
|
@ -1,5 +1,8 @@
|
|||
from django.http import HttpResponse
|
||||
|
||||
from .models import JournalEntry
|
||||
from django.shortcuts import render
|
||||
|
||||
def index(request):
|
||||
return HttpResponse("Hello, world. You're at the polls index.")
|
||||
entry_list = JournalEntry.objects.order_by('entry_date')
|
||||
context = {'entry_list': entry_list}
|
||||
return render(request, 'journaldecaisse/index.html', context)
|
Loading…
Reference in a new issue