Add last ops view to the bars

This commit is contained in:
Skia 2016-09-28 11:07:32 +02:00
parent fd482195f8
commit 2e7e78b8ce
8 changed files with 264 additions and 74 deletions

View File

@ -176,6 +176,9 @@ tbody>tr:hover {
background: darkgrey; background: darkgrey;
width: 100%; width: 100%;
} }
.highlight {
background: orange;
}
.tool-bar { .tool-bar {
overflow: auto; overflow: auto;
padding: 4px; padding: 4px;

View File

@ -40,9 +40,6 @@
{% endif %} {% endif %}
</div> </div>
{% if counter.type == 'BAR' %} {% if counter.type == 'BAR' %}
{% if barmen %}
<p><a href="{{ url('counter:cash_summary', counter_id=counter.id) }}">{% trans %}Make a cash register summary{% endtrans %}</a></p>
{% endif %}
<div> <div>
<h3>{% trans %}Barman: {% endtrans %}</h3> <h3>{% trans %}Barman: {% endtrans %}</h3>
{% for b in barmen %} {% for b in barmen %}

View File

@ -0,0 +1,67 @@
{% extends "core/base.jinja" %}
{% from 'core/macros.jinja' import user_profile_link %}
{% block title %}
{% trans counter_name=counter %}{{ counter_name }} last operations{% endtrans %}
{% endblock %}
{% block content %}
<h3>{% trans counter_name=counter %}{{ counter_name }} last operations{% endtrans %}</h3>
<h4>{% trans %}Refillings{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Barman{% endtrans %}</td>
<td>{% trans %}Customer{% endtrans %}</td>
<td>{% trans %}Amount{% endtrans %}</td>
<td>{% trans %}Payment method{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in last_refillings %}
<tr>
<td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
<td><a href="{{ i.operator.get_absolute_url() }}">{{ i.operator.get_display_name() }}</a></td>
<td><a href="{{ i.customer.user.get_absolute_url() }}">{{ i.customer.user.get_display_name() }}</a></td>
<td>{{ i.amount }} €</td>
<td>{{ i.get_payment_method_display() }}</td>
<td><a href="{{ url('counter:refilling_delete', refilling_id=i.id) }}">{% trans %}Delete{% endtrans %}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
<h4>{% trans %}Sellings{% endtrans %}</h4>
<table>
<thead>
<tr>
<td>{% trans %}Date{% endtrans %}</td>
<td>{% trans %}Barman{% endtrans %}</td>
<td>{% trans %}Customer{% endtrans %}</td>
<td>{% trans %}Label{% endtrans %}</td>
<td>{% trans %}Quantity{% endtrans %}</td>
<td>{% trans %}Total{% endtrans %}</td>
<td>{% trans %}Payment method{% endtrans %}</td>
</tr>
</thead>
<tbody>
{% for i in last_sellings %}
<tr>
<td>{{ i.date|localtime|date(DATETIME_FORMAT) }} - {{ i.date|localtime|time(DATETIME_FORMAT) }}</td>
<td><a href="{{ i.seller.get_absolute_url() }}">{{ i.seller.get_display_name() }}</a></td>
<td><a href="{{ i.customer.user.get_absolute_url() }}">{{ i.customer.user.get_display_name() }}</a></td>
<td>{{ i.label }}</td>
<td>{{ i.quantity }}</td>
<td>{{ i.quantity * i.unit_price }} €</td>
<td>{{ i.get_payment_method_display() }}</td>
<td><a href="{{ url('counter:selling_delete', selling_id=i.id) }}?next={{ url('counter:details',
counter_id=counter.id) }}">{% trans %}Delete{% endtrans %}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}

View File

@ -5,6 +5,7 @@ from counter.views import *
urlpatterns = [ urlpatterns = [
url(r'^(?P<counter_id>[0-9]+)$', CounterMain.as_view(), name='details'), url(r'^(?P<counter_id>[0-9]+)$', CounterMain.as_view(), name='details'),
url(r'^(?P<counter_id>[0-9]+)/click/(?P<user_id>[0-9]+)$', CounterClick.as_view(), name='click'), url(r'^(?P<counter_id>[0-9]+)/click/(?P<user_id>[0-9]+)$', CounterClick.as_view(), name='click'),
url(r'^(?P<counter_id>[0-9]+)/last_ops$', CounterLastOperationsView.as_view(), name='last_ops'),
url(r'^(?P<counter_id>[0-9]+)/cash_summary$', CounterCashSummaryView.as_view(), name='cash_summary'), url(r'^(?P<counter_id>[0-9]+)/cash_summary$', CounterCashSummaryView.as_view(), name='cash_summary'),
url(r'^(?P<counter_id>[0-9]+)/activity$', CounterActivityView.as_view(), name='activity'), url(r'^(?P<counter_id>[0-9]+)/activity$', CounterActivityView.as_view(), name='activity'),
url(r'^(?P<counter_id>[0-9]+)/stats$', CounterStatView.as_view(), name='stats'), url(r'^(?P<counter_id>[0-9]+)/stats$', CounterStatView.as_view(), name='stats'),

View File

@ -1,9 +1,10 @@
from django.shortcuts import render from django.shortcuts import render
from django.core.exceptions import PermissionDenied
from django.views.generic import ListView, DetailView, RedirectView from django.views.generic import ListView, DetailView, RedirectView
from django.views.generic.edit import UpdateView, CreateView, DeleteView, ProcessFormView, FormMixin from django.views.generic.edit import UpdateView, CreateView, DeleteView, ProcessFormView, FormMixin
from django.forms.models import modelform_factory from django.forms.models import modelform_factory
from django.forms import CheckboxSelectMultiple from django.forms import CheckboxSelectMultiple
from django.core.urlresolvers import reverse_lazy from django.core.urlresolvers import reverse_lazy, reverse
from django.core.exceptions import PermissionDenied from django.core.exceptions import PermissionDenied
from django.http import HttpResponseRedirect from django.http import HttpResponseRedirect
from django.utils import timezone from django.utils import timezone
@ -63,6 +64,29 @@ class RefillForm(forms.ModelForm):
model = Refilling model = Refilling
fields = ['amount', 'payment_method', 'bank'] fields = ['amount', 'payment_method', 'bank']
class CounterTabsMixin(TabedViewMixin):
def get_tabs_title(self):
return self.object
def get_list_of_tabs(self):
tab_list = []
tab_list.append({
'url': reverse_lazy('counter:details', kwargs={'counter_id': self.object.id}),
'slug': 'counter',
'name': _("Counter"),
})
if self.object.type == "BAR":
tab_list.append({
'url': reverse_lazy('counter:cash_summary', kwargs={'counter_id': self.object.id}),
'slug': 'cash_summary',
'name': _("Cash summary"),
})
tab_list.append({
'url': reverse_lazy('counter:last_ops', kwargs={'counter_id': self.object.id}),
'slug': 'last_ops',
'name': _("Last operations"),
})
return tab_list
class CheckTokenMixin: class CheckTokenMixin:
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
if not ('counter_token' in self.request.session.keys() and self.request.session['counter_token'] == self.object.token): if not ('counter_token' in self.request.session.keys() and self.request.session['counter_token'] == self.object.token):
@ -70,7 +94,7 @@ class CheckTokenMixin:
kwargs={'counter_id': self.object.id})+'?bad_location') kwargs={'counter_id': self.object.id})+'?bad_location')
return super(CheckTokenMixin, self).post(request, *args, **kwargs) return super(CheckTokenMixin, self).post(request, *args, **kwargs)
class CounterMain(DetailView, CheckTokenMixin, ProcessFormView, FormMixin): class CounterMain(CounterTabsMixin, DetailView, CheckTokenMixin, ProcessFormView, FormMixin):
""" """
The public (barman) view The public (barman) view
""" """
@ -78,6 +102,7 @@ class CounterMain(DetailView, CheckTokenMixin, ProcessFormView, FormMixin):
template_name = 'counter/counter_main.jinja' template_name = 'counter/counter_main.jinja'
pk_url_kwarg = "counter_id" pk_url_kwarg = "counter_id"
form_class = GetUserForm # Form to enter a client code and get the corresponding user id form_class = GetUserForm # Form to enter a client code and get the corresponding user id
current_tab = "counter"
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()
@ -127,7 +152,7 @@ class CounterMain(DetailView, CheckTokenMixin, ProcessFormView, FormMixin):
def get_success_url(self): def get_success_url(self):
return reverse_lazy('counter:click', args=self.args, kwargs=self.kwargs) return reverse_lazy('counter:click', args=self.args, kwargs=self.kwargs)
class CounterClick(DetailView, CheckTokenMixin): class CounterClick(CounterTabsMixin, DetailView, CheckTokenMixin):
""" """
The click view The click view
This is a detail view not to have to worry about loading the counter This is a detail view not to have to worry about loading the counter
@ -136,6 +161,7 @@ class CounterClick(DetailView, CheckTokenMixin):
model = Counter model = Counter
template_name = 'counter/counter_click.jinja' template_name = 'counter/counter_click.jinja'
pk_url_kwarg = "counter_id" pk_url_kwarg = "counter_id"
current_tab = "counter"
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
"""Simple get view""" """Simple get view"""
@ -412,7 +438,7 @@ class CounterLogout(RedirectView):
## Counter admin views ## Counter admin views
class CounterTabsMixin(TabedViewMixin): class CounterAdminTabsMixin(TabedViewMixin):
tabs_title = _("Counter administration") tabs_title = _("Counter administration")
list_of_tabs = [ list_of_tabs = [
{ {
@ -442,7 +468,7 @@ class CounterTabsMixin(TabedViewMixin):
}, },
] ]
class CounterListView(CounterTabsMixin, CanViewMixin, ListView): class CounterListView(CounterAdminTabsMixin, CanViewMixin, ListView):
""" """
A list view for the admins A list view for the admins
""" """
@ -457,7 +483,7 @@ class CounterEditForm(forms.ModelForm):
sellers = make_ajax_field(Counter, 'sellers', 'users', help_text="") sellers = make_ajax_field(Counter, 'sellers', 'users', help_text="")
products = make_ajax_field(Counter, 'products', 'products', help_text="") products = make_ajax_field(Counter, 'products', 'products', help_text="")
class CounterEditView(CounterTabsMixin, CanEditMixin, UpdateView): class CounterEditView(CounterAdminTabsMixin, CanEditMixin, UpdateView):
""" """
Edit a counter's main informations (for the counter's manager) Edit a counter's main informations (for the counter's manager)
""" """
@ -470,7 +496,7 @@ class CounterEditView(CounterTabsMixin, CanEditMixin, UpdateView):
def get_success_url(self): def get_success_url(self):
return reverse_lazy('counter:admin', kwargs={'counter_id': self.object.id}) return reverse_lazy('counter:admin', kwargs={'counter_id': self.object.id})
class CounterEditPropView(CounterTabsMixin, CanEditPropMixin, UpdateView): class CounterEditPropView(CounterAdminTabsMixin, CanEditPropMixin, UpdateView):
""" """
Edit a counter's main informations (for the counter's admin) Edit a counter's main informations (for the counter's admin)
""" """
@ -480,7 +506,7 @@ class CounterEditPropView(CounterTabsMixin, CanEditPropMixin, UpdateView):
template_name = 'core/edit.jinja' template_name = 'core/edit.jinja'
current_tab = "counters" current_tab = "counters"
class CounterCreateView(CounterTabsMixin, CanEditMixin, CreateView): class CounterCreateView(CounterAdminTabsMixin, CanEditMixin, CreateView):
""" """
Create a counter (for the admins) Create a counter (for the admins)
""" """
@ -490,7 +516,7 @@ class CounterCreateView(CounterTabsMixin, CanEditMixin, CreateView):
template_name = 'core/create.jinja' template_name = 'core/create.jinja'
current_tab = "counters" current_tab = "counters"
class CounterDeleteView(CounterTabsMixin, CanEditMixin, DeleteView): class CounterDeleteView(CounterAdminTabsMixin, CanEditMixin, DeleteView):
""" """
Delete a counter (for the admins) Delete a counter (for the admins)
""" """
@ -502,7 +528,7 @@ class CounterDeleteView(CounterTabsMixin, CanEditMixin, DeleteView):
# Product management # Product management
class ProductTypeListView(CounterTabsMixin, CanEditPropMixin, ListView): class ProductTypeListView(CounterAdminTabsMixin, CanEditPropMixin, ListView):
""" """
A list view for the admins A list view for the admins
""" """
@ -510,7 +536,7 @@ class ProductTypeListView(CounterTabsMixin, CanEditPropMixin, ListView):
template_name = 'counter/producttype_list.jinja' template_name = 'counter/producttype_list.jinja'
current_tab = "product_types" current_tab = "product_types"
class ProductTypeCreateView(CounterTabsMixin, CanCreateMixin, CreateView): class ProductTypeCreateView(CounterAdminTabsMixin, CanCreateMixin, CreateView):
""" """
A create view for the admins A create view for the admins
""" """
@ -519,7 +545,7 @@ class ProductTypeCreateView(CounterTabsMixin, CanCreateMixin, CreateView):
template_name = 'core/create.jinja' template_name = 'core/create.jinja'
current_tab = "products" current_tab = "products"
class ProductTypeEditView(CounterTabsMixin, CanEditPropMixin, UpdateView): class ProductTypeEditView(CounterAdminTabsMixin, CanEditPropMixin, UpdateView):
""" """
An edit view for the admins An edit view for the admins
""" """
@ -529,7 +555,7 @@ class ProductTypeEditView(CounterTabsMixin, CanEditPropMixin, UpdateView):
pk_url_kwarg = "type_id" pk_url_kwarg = "type_id"
current_tab = "products" current_tab = "products"
class ProductArchivedListView(CounterTabsMixin, CanEditPropMixin, ListView): class ProductArchivedListView(CounterAdminTabsMixin, CanEditPropMixin, ListView):
""" """
A list view for the admins A list view for the admins
""" """
@ -539,7 +565,7 @@ class ProductArchivedListView(CounterTabsMixin, CanEditPropMixin, ListView):
ordering = ['name'] ordering = ['name']
current_tab = "archive" current_tab = "archive"
class ProductListView(CounterTabsMixin, CanEditPropMixin, ListView): class ProductListView(CounterAdminTabsMixin, CanEditPropMixin, ListView):
""" """
A list view for the admins A list view for the admins
""" """
@ -577,7 +603,7 @@ class ProductEditForm(forms.ModelForm):
c.save() c.save()
return ret return ret
class ProductCreateView(CounterTabsMixin, CanCreateMixin, CreateView): class ProductCreateView(CounterAdminTabsMixin, CanCreateMixin, CreateView):
""" """
A create view for the admins A create view for the admins
""" """
@ -586,7 +612,7 @@ class ProductCreateView(CounterTabsMixin, CanCreateMixin, CreateView):
template_name = 'core/create.jinja' template_name = 'core/create.jinja'
current_tab = "products" current_tab = "products"
class ProductEditView(CounterTabsMixin, CanEditPropMixin, UpdateView): class ProductEditView(CounterAdminTabsMixin, CanEditPropMixin, UpdateView):
""" """
An edit view for the admins An edit view for the admins
""" """
@ -596,7 +622,7 @@ class ProductEditView(CounterTabsMixin, CanEditPropMixin, UpdateView):
template_name = 'core/edit.jinja' template_name = 'core/edit.jinja'
current_tab = "products" current_tab = "products"
class RefillingDeleteView(CanEditPropMixin, DeleteView): class RefillingDeleteView(DeleteView):
""" """
Delete a refilling (for the admins) Delete a refilling (for the admins)
""" """
@ -604,10 +630,23 @@ class RefillingDeleteView(CanEditPropMixin, DeleteView):
pk_url_kwarg = "refilling_id" pk_url_kwarg = "refilling_id"
template_name = 'core/delete_confirm.jinja' template_name = 'core/delete_confirm.jinja'
def get_success_url(self): def dispatch(self, request, *args, **kwargs):
return reverse_lazy('core:user_account', kwargs={'user_id': self.object.customer.user.id}) """
We have here a very particular right handling, we can't inherit from CanEditPropMixin
"""
self.object = self.get_object()
if (timezone.now() - self.object.date <= timedelta(minutes=settings.SITH_LAST_OPERATIONS_LIMIT) and
'counter_token' in request.session.keys() and
request.session['counter_token'] and # check if not null for counters that have no token set
Counter.objects.filter(token=request.session['counter_token']).exists()):
self.success_url = reverse('counter:details', kwargs={'counter_id': self.object.counter.id})
return super(RefillingDeleteView, self).dispatch(request, *args, **kwargs)
elif self.object.is_owned_by(request.user):
self.success_url = reverse('core:user_account', kwargs={'user_id': self.object.customer.user.id})
return super(RefillingDeleteView, self).dispatch(request, *args, **kwargs)
raise PermissionDenied
class SellingDeleteView(CanEditPropMixin, DeleteView): class SellingDeleteView(DeleteView):
""" """
Delete a selling (for the admins) Delete a selling (for the admins)
""" """
@ -615,8 +654,21 @@ class SellingDeleteView(CanEditPropMixin, DeleteView):
pk_url_kwarg = "selling_id" pk_url_kwarg = "selling_id"
template_name = 'core/delete_confirm.jinja' template_name = 'core/delete_confirm.jinja'
def get_success_url(self): def dispatch(self, request, *args, **kwargs):
return reverse_lazy('core:user_account', kwargs={'user_id': self.object.customer.user.id}) """
We have here a very particular right handling, we can't inherit from CanEditPropMixin
"""
self.object = self.get_object()
if (timezone.now() - self.object.date <= timedelta(minutes=settings.SITH_LAST_OPERATIONS_LIMIT) and
'counter_token' in request.session.keys() and
request.session['counter_token'] and # check if not null for counters that have no token set
Counter.objects.filter(token=request.session['counter_token']).exists()):
self.success_url = reverse('counter:details', kwargs={'counter_id': self.object.counter.id})
return super(SellingDeleteView, self).dispatch(request, *args, **kwargs)
elif self.object.is_owned_by(request.user):
self.success_url = reverse('core:user_account', kwargs={'user_id': self.object.customer.user.id})
return super(SellingDeleteView, self).dispatch(request, *args, **kwargs)
raise PermissionDenied
# Cash register summaries # Cash register summaries
@ -676,27 +728,61 @@ class CashRegisterSummaryForm(forms.Form):
if summary.items.count() < 1: if summary.items.count() < 1:
summary.delete() summary.delete()
class CounterCashSummaryView(CanViewMixin, DetailView): class CounterLastOperationsView(CounterTabsMixin, CanViewMixin, DetailView):
"""
Provide the last operations to allow barmen to delete them
"""
model = Counter
pk_url_kwarg = "counter_id"
template_name = 'counter/last_ops.jinja'
current_tab = "last_ops"
def dispatch(self, request, *args, **kwargs):
"""
We have here again a very particular right handling
"""
self.object = self.get_object()
if (self.object.get_barmen_list() and 'counter_token' in request.session.keys() and
request.session['counter_token'] and # check if not null for counters that have no token set
Counter.objects.filter(token=request.session['counter_token']).exists()):
return super(CounterLastOperationsView, self).dispatch(request, *args, **kwargs)
return HttpResponseRedirect(reverse('counter:details', kwargs={'counter_id': self.object.id})+'?bad_location')
def get_context_data(self, **kwargs):
"""Add form to the context """
kwargs = super(CounterLastOperationsView, self).get_context_data(**kwargs)
threshold = timezone.now() - timedelta(minutes=settings.SITH_LAST_OPERATIONS_LIMIT)
kwargs['last_refillings'] = self.object.refillings.filter(date__gte=threshold).all()
kwargs['last_sellings'] = self.object.sellings.filter(date__gte=threshold).all()
return kwargs
class CounterCashSummaryView(CounterTabsMixin, CanViewMixin, DetailView):
""" """
Provide the cash summary form Provide the cash summary form
""" """
model = Counter model = Counter
pk_url_kwarg = "counter_id" pk_url_kwarg = "counter_id"
template_name = 'counter/cash_register_summary.jinja' template_name = 'counter/cash_register_summary.jinja'
current_tab = "cash_summary"
def dispatch(self, request, *args, **kwargs):
"""
We have here again a very particular right handling
"""
self.object = self.get_object()
if (self.object.get_barmen_list() and 'counter_token' in request.session.keys() and
request.session['counter_token'] and # check if not null for counters that have no token set
Counter.objects.filter(token=request.session['counter_token']).exists()):
return super(CounterCashSummaryView, self).dispatch(request, *args, **kwargs)
return HttpResponseRedirect(reverse('counter:details', kwargs={'counter_id': self.object.id})+'?bad_location')
def get(self, request, *args, **kwargs): def get(self, request, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()
if len(self.object.get_barmen_list()) < 1:
return HttpResponseRedirect(reverse_lazy('counter:details', args=self.args,
kwargs={'counter_id': self.object.id}))
self.form = CashRegisterSummaryForm() self.form = CashRegisterSummaryForm()
return super(CounterCashSummaryView, self).get(request, *args, **kwargs) return super(CounterCashSummaryView, self).get(request, *args, **kwargs)
def post(self, request, *args, **kwargs): def post(self, request, *args, **kwargs):
self.object = self.get_object() self.object = self.get_object()
if len(self.object.get_barmen_list()) < 1:
return HttpResponseRedirect(reverse_lazy('counter:details', args=self.args,
kwargs={'counter_id': self.object.id}))
self.form = CashRegisterSummaryForm(request.POST) self.form = CashRegisterSummaryForm(request.POST)
if self.form.is_valid(): if self.form.is_valid():
self.form.save(self.object) self.form.save(self.object)
@ -760,7 +846,7 @@ class CounterStatView(DetailView, CanEditMixin):
raise PermissionDenied raise PermissionDenied
class CashSummaryListView(CanEditPropMixin, CounterTabsMixin, ListView): class CashSummaryListView(CanEditPropMixin, CounterAdminTabsMixin, ListView):
"""Display a list of cash summaries""" """Display a list of cash summaries"""
model = CashRegisterSummary model = CashRegisterSummary
template_name = 'counter/cash_summary_list.jinja' template_name = 'counter/cash_summary_list.jinja'

Binary file not shown.

View File

@ -6,7 +6,7 @@
msgid "" msgid ""
msgstr "" msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-09-26 11:22+0200\n" "POT-Creation-Date: 2016-09-28 10:08+0200\n"
"PO-Revision-Date: 2016-07-18\n" "PO-Revision-Date: 2016-07-18\n"
"Last-Translator: Skia <skia@libskia.so>\n" "Last-Translator: Skia <skia@libskia.so>\n"
"Language-Team: AE info <ae.info@utbm.fr>\n" "Language-Team: AE info <ae.info@utbm.fr>\n"
@ -302,6 +302,8 @@ msgstr "Compte en banque : "
#: core/templates/core/group_list.jinja:13 #: core/templates/core/group_list.jinja:13
#: core/templates/core/user_account_detail.jinja:67 #: core/templates/core/user_account_detail.jinja:67
#: core/templates/core/user_edit.jinja:18 #: core/templates/core/user_edit.jinja:18
#: counter/templates/counter/last_ops.jinja:29
#: counter/templates/counter/last_ops.jinja:59
#: launderette/templates/launderette/launderette_admin.jinja:16 #: launderette/templates/launderette/launderette_admin.jinja:16
#: launderette/views.py:146 #: launderette/views.py:146
msgid "Delete" msgid "Delete"
@ -388,6 +390,7 @@ msgstr "Fin"
#: accounting/templates/accounting/journal_details.jinja:28 #: accounting/templates/accounting/journal_details.jinja:28
#: core/templates/core/user_account_detail.jinja:20 #: core/templates/core/user_account_detail.jinja:20
#: core/templates/core/user_account_detail.jinja:81 #: core/templates/core/user_account_detail.jinja:81
#: counter/templates/counter/last_ops.jinja:17
msgid "Amount" msgid "Amount"
msgstr "Montant" msgstr "Montant"
@ -454,6 +457,8 @@ msgstr "No"
#: core/templates/core/user_account_detail.jinja:46 #: core/templates/core/user_account_detail.jinja:46
#: core/templates/core/user_account_detail.jinja:79 #: core/templates/core/user_account_detail.jinja:79
#: counter/templates/counter/cash_summary_list.jinja:29 #: counter/templates/counter/cash_summary_list.jinja:29
#: counter/templates/counter/last_ops.jinja:14
#: counter/templates/counter/last_ops.jinja:39
msgid "Date" msgid "Date"
msgstr "Date" msgstr "Date"
@ -478,7 +483,7 @@ msgid "Done"
msgstr "Effectué" msgstr "Effectué"
#: accounting/templates/accounting/journal_details.jinja:34 #: accounting/templates/accounting/journal_details.jinja:34
#: counter/templates/counter/cash_summary_list.jinja:32 counter/views.py:646 #: counter/templates/counter/cash_summary_list.jinja:32 counter/views.py:697
msgid "Comment" msgid "Comment"
msgstr "Commentaire" msgstr "Commentaire"
@ -630,6 +635,7 @@ msgstr "Au"
#: club/templates/club/club_sellings.jinja:5 club/views.py:57 #: club/templates/club/club_sellings.jinja:5 club/views.py:57
#: counter/templates/counter/counter_main.jinja:19 #: counter/templates/counter/counter_main.jinja:19
#: counter/templates/counter/last_ops.jinja:35
msgid "Sellings" msgid "Sellings"
msgstr "Ventes" msgstr "Ventes"
@ -655,29 +661,35 @@ msgstr "Total : "
#: club/templates/club/club_sellings.jinja:19 club/views.py:159 #: club/templates/club/club_sellings.jinja:19 club/views.py:159
#: core/templates/core/user_account_detail.jinja:18 #: core/templates/core/user_account_detail.jinja:18
#: core/templates/core/user_account_detail.jinja:47 #: core/templates/core/user_account_detail.jinja:47
#: counter/templates/counter/cash_summary_list.jinja:28 #: counter/templates/counter/cash_summary_list.jinja:28 counter/views.py:74
msgid "Counter" msgid "Counter"
msgstr "Comptoir" msgstr "Comptoir"
#: club/templates/club/club_sellings.jinja:20 #: club/templates/club/club_sellings.jinja:20
#: core/templates/core/user_account_detail.jinja:19 #: core/templates/core/user_account_detail.jinja:19
#: core/templates/core/user_account_detail.jinja:48 #: core/templates/core/user_account_detail.jinja:48
#: counter/templates/counter/last_ops.jinja:15
#: counter/templates/counter/last_ops.jinja:40
msgid "Barman" msgid "Barman"
msgstr "Barman" msgstr "Barman"
#: club/templates/club/club_sellings.jinja:21 #: club/templates/club/club_sellings.jinja:21
#: counter/templates/counter/counter_click.jinja:29 #: counter/templates/counter/counter_click.jinja:29
#: counter/templates/counter/last_ops.jinja:16
#: counter/templates/counter/last_ops.jinja:41
msgid "Customer" msgid "Customer"
msgstr "Client" msgstr "Client"
#: club/templates/club/club_sellings.jinja:22 #: club/templates/club/club_sellings.jinja:22
#: core/templates/core/user_account_detail.jinja:49 #: core/templates/core/user_account_detail.jinja:49
#: counter/templates/counter/last_ops.jinja:42
msgid "Label" msgid "Label"
msgstr "Intitulé" msgstr "Intitulé"
#: club/templates/club/club_sellings.jinja:23 #: club/templates/club/club_sellings.jinja:23
#: core/templates/core/user_account_detail.jinja:50 #: core/templates/core/user_account_detail.jinja:50
#: core/templates/core/user_stats.jinja:28 #: core/templates/core/user_stats.jinja:28
#: counter/templates/counter/last_ops.jinja:43
msgid "Quantity" msgid "Quantity"
msgstr "Quantité" msgstr "Quantité"
@ -685,6 +697,7 @@ msgstr "Quantité"
#: core/templates/core/user_account.jinja:9 #: core/templates/core/user_account.jinja:9
#: core/templates/core/user_account_detail.jinja:51 #: core/templates/core/user_account_detail.jinja:51
#: counter/templates/counter/cash_summary_list.jinja:30 #: counter/templates/counter/cash_summary_list.jinja:30
#: counter/templates/counter/last_ops.jinja:44
#: counter/templates/counter/stats.jinja:18 #: counter/templates/counter/stats.jinja:18
msgid "Total" msgid "Total"
msgstr "Total" msgstr "Total"
@ -692,6 +705,8 @@ msgstr "Total"
#: club/templates/club/club_sellings.jinja:25 #: club/templates/club/club_sellings.jinja:25
#: core/templates/core/user_account_detail.jinja:21 #: core/templates/core/user_account_detail.jinja:21
#: core/templates/core/user_account_detail.jinja:52 #: core/templates/core/user_account_detail.jinja:52
#: counter/templates/counter/last_ops.jinja:18
#: counter/templates/counter/last_ops.jinja:45
msgid "Payment method" msgid "Payment method"
msgstr "Méthode de paiement" msgstr "Méthode de paiement"
@ -1342,7 +1357,7 @@ msgid "Please login to see this page."
msgstr "Merci de vous identifier pour voir cette page." msgstr "Merci de vous identifier pour voir cette page."
#: core/templates/core/login.jinja:28 #: core/templates/core/login.jinja:28
#: counter/templates/counter/counter_main.jinja:54 #: counter/templates/counter/counter_main.jinja:55
msgid "login" msgid "login"
msgstr "login" msgstr "login"
@ -1594,6 +1609,7 @@ msgstr "Compte utilisateur"
#: core/templates/core/user_account.jinja:38 #: core/templates/core/user_account.jinja:38
#: core/templates/core/user_account_detail.jinja:13 #: core/templates/core/user_account_detail.jinja:13
#: counter/templates/counter/cash_summary_list.jinja:12 #: counter/templates/counter/cash_summary_list.jinja:12
#: counter/templates/counter/last_ops.jinja:10
msgid "Refillings" msgid "Refillings"
msgstr "Rechargements" msgstr "Rechargements"
@ -1759,8 +1775,8 @@ msgstr "Fusionner deux utilisateurs"
msgid "Subscriptions" msgid "Subscriptions"
msgstr "Cotisations" msgstr "Cotisations"
#: core/templates/core/user_tools.jinja:23 counter/views.py:420 #: core/templates/core/user_tools.jinja:23 counter/views.py:445
#: counter/views.py:559 #: counter/views.py:584
msgid "Counters" msgid "Counters"
msgstr "Comptoirs" msgstr "Comptoirs"
@ -1781,7 +1797,7 @@ msgid "Product types management"
msgstr "Gestion des types de produit" msgstr "Gestion des types de produit"
#: core/templates/core/user_tools.jinja:30 #: core/templates/core/user_tools.jinja:30
#: counter/templates/counter/cash_summary_list.jinja:18 counter/views.py:440 #: counter/templates/counter/cash_summary_list.jinja:18 counter/views.py:465
msgid "Cash register summaries" msgid "Cash register summaries"
msgstr "Relevés de caisse" msgstr "Relevés de caisse"
@ -1854,7 +1870,7 @@ msgstr "Parrain"
msgid "Godchild" msgid "Godchild"
msgstr "Fillot" msgstr "Fillot"
#: core/views/forms.py:204 counter/views.py:37 #: core/views/forms.py:204 counter/views.py:38
msgid "Select user" msgid "Select user"
msgstr "Choisir un utilisateur" msgstr "Choisir un utilisateur"
@ -2036,7 +2052,7 @@ msgid "Barman list"
msgstr "Barmans" msgstr "Barmans"
#: counter/templates/counter/cash_register_summary.jinja:8 #: counter/templates/counter/cash_register_summary.jinja:8
#: counter/templates/counter/counter_main.jinja:44 #: counter/templates/counter/counter_main.jinja:45
msgid "Make a cash register summary" msgid "Make a cash register summary"
msgstr "Faire un relevé de caisse" msgstr "Faire un relevé de caisse"
@ -2049,7 +2065,7 @@ msgstr "Liste des relevés de caisse"
msgid "Theoric sums" msgid "Theoric sums"
msgstr "Sommes théoriques" msgstr "Sommes théoriques"
#: counter/templates/counter/cash_summary_list.jinja:31 counter/views.py:647 #: counter/templates/counter/cash_summary_list.jinja:31 counter/views.py:698
msgid "Emptied" msgid "Emptied"
msgstr "Coffre vidé" msgstr "Coffre vidé"
@ -2151,10 +2167,20 @@ msgstr "valider"
msgid "Please, login" msgid "Please, login"
msgstr "Merci de vous identifier" msgstr "Merci de vous identifier"
#: counter/templates/counter/counter_main.jinja:47 #: counter/templates/counter/counter_main.jinja:44
msgid "Display last operations"
msgstr "Dernières opérations"
#: counter/templates/counter/counter_main.jinja:48
msgid "Barman: " msgid "Barman: "
msgstr "Barman : " msgstr "Barman : "
#: counter/templates/counter/last_ops.jinja:5
#: counter/templates/counter/last_ops.jinja:9
#, python-format
msgid "%(counter_name)s last operations"
msgstr "Dernières opérations sur %(counter_name)s"
#: counter/templates/counter/product_list.jinja:4 #: counter/templates/counter/product_list.jinja:4
#: counter/templates/counter/product_list.jinja:12 #: counter/templates/counter/product_list.jinja:12
msgid "Product list" msgid "Product list"
@ -2200,105 +2226,113 @@ msgstr "Promo"
msgid "Percentage" msgid "Percentage"
msgstr "Pourcentage" msgstr "Pourcentage"
#: counter/views.py:53 #: counter/views.py:54
msgid "User not found" msgid "User not found"
msgstr "Utilisateur non trouvé" msgstr "Utilisateur non trouvé"
#: counter/views.py:101 #: counter/views.py:79
msgid "Cash summary"
msgstr "Relevé de caisse"
#: counter/views.py:84
msgid "Last operations"
msgstr "Dernières opérations"
#: counter/views.py:125
msgid "Bad credentials" msgid "Bad credentials"
msgstr "Mauvais identifiants" msgstr "Mauvais identifiants"
#: counter/views.py:103 #: counter/views.py:127
msgid "User is not barman" msgid "User is not barman"
msgstr "L'utilisateur n'est pas barman." msgstr "L'utilisateur n'est pas barman."
#: counter/views.py:107 #: counter/views.py:131
msgid "Bad location, someone is already logged in somewhere else" msgid "Bad location, someone is already logged in somewhere else"
msgstr "Mauvais comptoir, quelqu'un est déjà connecté ailleurs" msgstr "Mauvais comptoir, quelqu'un est déjà connecté ailleurs"
#: counter/views.py:290 #: counter/views.py:315
msgid "END" msgid "END"
msgstr "FIN" msgstr "FIN"
#: counter/views.py:292 #: counter/views.py:317
msgid "CAN" msgid "CAN"
msgstr "ANN" msgstr "ANN"
#: counter/views.py:322 #: counter/views.py:347
msgid "You have not enough money to buy all the basket" msgid "You have not enough money to buy all the basket"
msgstr "Vous n'avez pas assez d'argent pour acheter le panier" msgstr "Vous n'avez pas assez d'argent pour acheter le panier"
#: counter/views.py:415 #: counter/views.py:440
msgid "Counter administration" msgid "Counter administration"
msgstr "Administration des comptoirs" msgstr "Administration des comptoirs"
#: counter/views.py:425 #: counter/views.py:450
msgid "Products" msgid "Products"
msgstr "Produits" msgstr "Produits"
#: counter/views.py:430 #: counter/views.py:455
msgid "Archived products" msgid "Archived products"
msgstr "Produits archivés" msgstr "Produits archivés"
#: counter/views.py:435 #: counter/views.py:460
msgid "Product types" msgid "Product types"
msgstr "Types de produit" msgstr "Types de produit"
#: counter/views.py:556 #: counter/views.py:581
msgid "Parent product" msgid "Parent product"
msgstr "Produit parent" msgstr "Produit parent"
#: counter/views.py:557 #: counter/views.py:582
msgid "Buying groups" msgid "Buying groups"
msgstr "Groupes d'achat" msgstr "Groupes d'achat"
#: counter/views.py:626 #: counter/views.py:677
msgid "10 cents" msgid "10 cents"
msgstr "10 centimes" msgstr "10 centimes"
#: counter/views.py:627 #: counter/views.py:678
msgid "20 cents" msgid "20 cents"
msgstr "20 centimes" msgstr "20 centimes"
#: counter/views.py:628 #: counter/views.py:679
msgid "50 cents" msgid "50 cents"
msgstr "50 centimes" msgstr "50 centimes"
#: counter/views.py:629 #: counter/views.py:680
msgid "1 euro" msgid "1 euro"
msgstr "1 €" msgstr "1 €"
#: counter/views.py:630 #: counter/views.py:681
msgid "2 euros" msgid "2 euros"
msgstr "2 €" msgstr "2 €"
#: counter/views.py:631 #: counter/views.py:682
msgid "5 euros" msgid "5 euros"
msgstr "5 €" msgstr "5 €"
#: counter/views.py:632 #: counter/views.py:683
msgid "10 euros" msgid "10 euros"
msgstr "10 €" msgstr "10 €"
#: counter/views.py:633 #: counter/views.py:684
msgid "20 euros" msgid "20 euros"
msgstr "20 €" msgstr "20 €"
#: counter/views.py:634 #: counter/views.py:685
msgid "50 euros" msgid "50 euros"
msgstr "50 €" msgstr "50 €"
#: counter/views.py:635 #: counter/views.py:686
msgid "100 euros" msgid "100 euros"
msgstr "100 €" msgstr "100 €"
#: counter/views.py:636 counter/views.py:638 counter/views.py:640 #: counter/views.py:687 counter/views.py:689 counter/views.py:691
#: counter/views.py:642 counter/views.py:644 #: counter/views.py:693 counter/views.py:695
msgid "Check amount" msgid "Check amount"
msgstr "Montant du chèque" msgstr "Montant du chèque"
#: counter/views.py:637 counter/views.py:639 counter/views.py:641 #: counter/views.py:688 counter/views.py:690 counter/views.py:692
#: counter/views.py:643 counter/views.py:645 #: counter/views.py:694 counter/views.py:696
msgid "Check quantity" msgid "Check quantity"
msgstr "Nombre de chèque" msgstr "Nombre de chèque"
@ -2434,12 +2468,12 @@ msgid "Washing and drying"
msgstr "Lavage et séchage" msgstr "Lavage et séchage"
#: launderette/templates/launderette/launderette_book.jinja:27 #: launderette/templates/launderette/launderette_book.jinja:27
#: sith/settings.py:412 #: sith/settings.py:415
msgid "Washing" msgid "Washing"
msgstr "Lavage" msgstr "Lavage"
#: launderette/templates/launderette/launderette_book.jinja:31 #: launderette/templates/launderette/launderette_book.jinja:31
#: sith/settings.py:412 #: sith/settings.py:415
msgid "Drying" msgid "Drying"
msgstr "Séchage" msgstr "Séchage"
@ -2658,4 +2692,3 @@ msgstr "Un utilisateur avec cette adresse email existe déjà"
msgid "You must either choose an existing user or create a new one properly" msgid "You must either choose an existing user or create a new one properly"
msgstr "" msgstr ""
"Vous devez soit choisir un utilisateur existant, ou en créer un proprement." "Vous devez soit choisir un utilisateur existant, ou en créer un proprement."

View File

@ -398,6 +398,9 @@ SITH_MAXIMUM_FREE_ROLE=1
# Minutes to timeout the logged barmen # Minutes to timeout the logged barmen
SITH_BARMAN_TIMEOUT=20 SITH_BARMAN_TIMEOUT=20
# Minutes to delete the last operations
SITH_LAST_OPERATIONS_LIMIT=5
# ET variables # ET variables
SITH_EBOUTIC_ET_URL = "https://preprod-tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi" SITH_EBOUTIC_ET_URL = "https://preprod-tpeweb.e-transactions.fr/cgi/MYchoix_pagepaiement.cgi"
SITH_EBOUTIC_PBX_SITE = "4000666" SITH_EBOUTIC_PBX_SITE = "4000666"