From 40927fa13d130234b7bbff47de62875dd399e8e5 Mon Sep 17 00:00:00 2001 From: klmp200 Date: Fri, 21 Jul 2017 21:39:49 +0200 Subject: [PATCH] Add limit for ecocup recording --- core/management/commands/populate.py | 12 + .../0013_customer_recorded_products.py | 19 + counter/models.py | 22 + counter/views.py | 27 ++ locale/fr/LC_MESSAGES/django.po | 392 +++++++++--------- sith/settings.py | 10 + 6 files changed, 285 insertions(+), 197 deletions(-) create mode 100644 counter/migrations/0013_customer_recorded_products.py diff --git a/core/management/commands/populate.py b/core/management/commands/populate.py index 241832a3..9fbe30ef 100644 --- a/core/management/commands/populate.py +++ b/core/management/commands/populate.py @@ -340,6 +340,8 @@ Welcome to the wiki page! c.save() r = ProductType(name="Rechargements") r.save() + verre = ProductType(name="Verre") + verre.save() cotis = Product(name="Cotis 1 semestre", code="1SCOTIZ", product_type=c, purchase_price="15", selling_price="15", special_selling_price="15", club=main_club) cotis.save() @@ -355,6 +357,14 @@ Welcome to the wiki page! cble = Product(name="Chimay Bleue", code="CBLE", product_type=p, purchase_price="1.50", selling_price="1.7", special_selling_price="1.6", club=main_club) cble.save() + cons = Product(name="Consigne Eco-cup", code="CONS", product_type=verre, purchase_price="1", selling_price="1", + special_selling_price="1", club=main_club) + cons.id = 1152 + cons.save() + dcons = Product(name="Déconsigne Eco-cup", code="DECO", product_type=verre, purchase_price="-1", selling_price="-1", + special_selling_price="-1", club=main_club) + dcons.id = 1151 + dcons.save() Product(name="Corsendonk", code="CORS", product_type=p, purchase_price="1.50", selling_price="1.7", special_selling_price="1.6", club=main_club).save() Product(name="Carolus", code="CARO", product_type=p, purchase_price="1.50", selling_price="1.7", @@ -362,6 +372,8 @@ Welcome to the wiki page! mde = Counter.objects.filter(name="MDE").first() mde.products.add(barb) mde.products.add(cble) + mde.products.add(cons) + mde.products.add(dcons) mde.sellers.add(skia) mde.save() diff --git a/counter/migrations/0013_customer_recorded_products.py b/counter/migrations/0013_customer_recorded_products.py new file mode 100644 index 00000000..59405ed2 --- /dev/null +++ b/counter/migrations/0013_customer_recorded_products.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('counter', '0012_auto_20170515_2202'), + ] + + operations = [ + migrations.AddField( + model_name='customer', + name='recorded_products', + field=models.IntegerField(verbose_name='recorded items', default=0), + ), + ] diff --git a/counter/models.py b/counter/models.py index d85813ba..1f318914 100644 --- a/counter/models.py +++ b/counter/models.py @@ -51,6 +51,7 @@ class Customer(models.Model): user = models.OneToOneField(User, primary_key=True) account_id = models.CharField(_('account id'), max_length=10, unique=True) amount = CurrencyField(_('amount')) + recorded_products = models.IntegerField(_('recorded product'), default=0) class Meta: verbose_name = _('customer') @@ -60,6 +61,13 @@ class Customer(models.Model): def __str__(self): return "%s - %s" % (self.user.username, self.account_id) + @property + def can_record(self): + return self.recorded_products > -settings.SITH_RECORD_LIMIT + + def can_record_more(self, number): + return self.recorded_products - number >= -settings.SITH_RECORD_LIMIT + @property def can_buy(self): return (self.user.subscriptions.last() and @@ -143,6 +151,20 @@ class Product(models.Model): class Meta: verbose_name = _('product') + @property + def is_record_product(self): + for product in settings.SITH_RECORD_PRODUCT: + if product == self.id: + return True + return False + + @property + def is_unrecord_product(self): + for product in settings.SITH_UNRECORD_PRODUCT: + if product == self.id: + return True + return False + def is_owned_by(self, user): """ Method to see if that object can be edited by the given user diff --git a/counter/views.py b/counter/views.py index 863a703d..7b529f2c 100644 --- a/counter/views.py +++ b/counter/views.py @@ -330,6 +330,28 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): except: return 0 + def compute_record_product(self, request, product=None): + recorded = 0 + basket = request.session['basket'] + + if product: + if product.is_record_product: + recorded -= 1 + elif product.is_unrecord_product: + recorded += 1 + + for p in basket: + bproduct = self.get_product(str(p)) + if bproduct.is_record_product: + recorded -= basket[p]['qty'] + elif bproduct.is_unrecord_product: + recorded += basket[p]['qty'] + return recorded + + def is_record_product_ok(self, request, product): + return self.customer.can_record_more( + self.compute_record_product(request, product)) + def add_product(self, request, q=1, p=None): """ Add a product to the basket @@ -359,6 +381,9 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): if self.customer.amount < (total + round(q * float(price), 2)): # Check for enough money request.session['not_enough'] = True return False + if not self.is_record_product_ok(request, product): + request.session['not_allowed'] = True + return False if product.limit_age >= 18 and not self.customer.user.date_of_birth: request.session['no_age'] = True return False @@ -438,6 +463,8 @@ class CounterClick(CounterTabsMixin, CanViewMixin, DetailView): s = Selling(label=p.name + " (Plateau)", product=p, club=p.club, counter=self.object, unit_price=0, quantity=infos['bonus_qty'], seller=self.operator, customer=self.customer) s.save() + self.customer.recorded_products -= self.compute_record_product(request) + self.customer.save() request.session['last_customer'] = self.customer.user.get_display_name() request.session['last_total'] = "%0.2f" % self.sum_basket(request) request.session['new_customer_amount'] = str(self.customer.amount) diff --git a/locale/fr/LC_MESSAGES/django.po b/locale/fr/LC_MESSAGES/django.po index 28dbaa7b..ac4afbe6 100644 --- a/locale/fr/LC_MESSAGES/django.po +++ b/locale/fr/LC_MESSAGES/django.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2017-08-01 13:50+0200\n" +"POT-Creation-Date: 2017-07-21 18:45+0200\n" "PO-Revision-Date: 2016-07-18\n" "Last-Translator: Skia \n" "Language-Team: AE info \n" @@ -18,8 +18,8 @@ msgstr "" #: accounting/models.py:61 accounting/models.py:110 accounting/models.py:138 #: accounting/models.py:197 club/models.py:44 -#: core/templates/core/base.jinja:234 counter/models.py:100 -#: counter/models.py:126 counter/models.py:162 forum/models.py:49 +#: core/templates/core/base.jinja:234 counter/models.py:108 +#: counter/models.py:134 counter/models.py:184 forum/models.py:49 #: launderette/models.py:38 launderette/models.py:84 launderette/models.py:110 #: stock/models.py:38 stock/models.py:54 stock/models.py:77 stock/models.py:97 msgid "name" @@ -65,9 +65,9 @@ msgstr "IBAN" msgid "account number" msgstr "numero de compte" -#: accounting/models.py:113 accounting/models.py:139 club/models.py:187 -#: com/models.py:65 com/models.py:156 counter/models.py:135 -#: counter/models.py:163 trombi/models.py:149 +#: accounting/models.py:113 accounting/models.py:139 club/models.py:186 +#: com/models.py:65 com/models.py:156 counter/models.py:143 +#: counter/models.py:185 trombi/models.py:149 msgid "club" msgstr "club" @@ -88,12 +88,12 @@ msgstr "Compte club" msgid "%(club_account)s on %(bank_account)s" msgstr "%(club_account)s sur %(bank_account)s" -#: accounting/models.py:195 club/models.py:188 counter/models.py:439 +#: accounting/models.py:195 club/models.py:187 counter/models.py:461 #: election/models.py:16 launderette/models.py:148 msgid "start date" msgstr "date de début" -#: accounting/models.py:196 club/models.py:189 counter/models.py:440 +#: accounting/models.py:196 club/models.py:188 counter/models.py:462 #: election/models.py:17 msgid "end date" msgstr "date de fin" @@ -107,7 +107,7 @@ msgid "club account" msgstr "compte club" #: accounting/models.py:200 accounting/models.py:257 counter/models.py:53 -#: counter/models.py:276 +#: counter/models.py:298 msgid "amount" msgstr "montant" @@ -127,18 +127,18 @@ msgstr "numéro" msgid "journal" msgstr "classeur" -#: accounting/models.py:258 core/models.py:628 core/models.py:1003 -#: core/models.py:1044 counter/models.py:279 counter/models.py:328 -#: counter/models.py:457 eboutic/models.py:39 eboutic/models.py:73 +#: accounting/models.py:258 core/models.py:616 core/models.py:991 +#: core/models.py:1032 counter/models.py:301 counter/models.py:350 +#: counter/models.py:479 eboutic/models.py:39 eboutic/models.py:73 #: forum/models.py:239 forum/models.py:314 stock/models.py:76 msgid "date" msgstr "date" -#: accounting/models.py:259 counter/models.py:458 stock/models.py:79 +#: accounting/models.py:259 counter/models.py:480 stock/models.py:79 msgid "comment" msgstr "commentaire" -#: accounting/models.py:260 counter/models.py:280 counter/models.py:329 +#: accounting/models.py:260 counter/models.py:302 counter/models.py:351 #: subscription/models.py:55 msgid "payment method" msgstr "méthode de paiement" @@ -164,7 +164,7 @@ msgid "accounting type" msgstr "type comptable" #: accounting/models.py:269 accounting/models.py:371 accounting/models.py:398 -#: accounting/models.py:422 counter/models.py:320 +#: accounting/models.py:422 counter/models.py:342 msgid "label" msgstr "étiquette" @@ -253,7 +253,7 @@ msgstr "" "Vous devez fournir soit un type comptable simplifié ou un type comptable " "standard" -#: accounting/models.py:366 counter/models.py:130 +#: accounting/models.py:366 counter/models.py:138 msgid "code" msgstr "code" @@ -347,12 +347,11 @@ msgstr "Compte en banque : " #: election/templates/election/election_detail.jinja:280 #: election/templates/election/election_detail.jinja:330 #: election/templates/election/election_detail.jinja:378 -#: forum/templates/forum/macros.jinja:21 -#: forum/templates/forum/macros.jinja:123 +#: forum/templates/forum/macros.jinja:21 forum/templates/forum/macros.jinja:123 #: launderette/templates/launderette/launderette_admin.jinja:16 #: launderette/views.py:182 sas/templates/sas/album.jinja:26 #: sas/templates/sas/moderation.jinja:18 sas/templates/sas/picture.jinja:74 -#: sas/templates/sas/picture.jinja:124 +#: sas/templates/sas/picture.jinja.py:124 #: stock/templates/stock/stock_shopping_list.jinja:43 #: stock/templates/stock/stock_shopping_list.jinja:69 #: trombi/templates/trombi/detail.jinja:35 @@ -385,7 +384,7 @@ msgstr "Nouveau compte club" #: com/templates/com/news_admin_list.jinja:72 #: com/templates/com/weekmail.jinja:32 com/templates/com/weekmail.jinja:61 #: core/templates/core/file.jinja:38 core/templates/core/page.jinja:31 -#: core/templates/core/user_tools.jinja:42 core/views/user.py:186 +#: core/templates/core/user_tools.jinja:40 core/views/user.py:186 #: counter/templates/counter/cash_summary_list.jinja:53 #: counter/templates/counter/counter_list.jinja:17 #: counter/templates/counter/counter_list.jinja:32 @@ -505,8 +504,8 @@ msgstr "Non" #: accounting/templates/accounting/club_account_details.jinja:56 #: com/templates/com/news_admin_list.jinja:38 -#: com/templates/com/news_admin_list.jinja:71 -#: core/templates/core/file.jinja:36 core/templates/core/page.jinja:28 +#: com/templates/com/news_admin_list.jinja:71 core/templates/core/file.jinja:36 +#: core/templates/core/page.jinja:28 msgid "View" msgstr "Voir" @@ -604,7 +603,7 @@ msgid "Done" msgstr "Effectuées" #: accounting/templates/accounting/journal_details.jinja:39 -#: counter/templates/counter/cash_summary_list.jinja:37 counter/views.py:827 +#: counter/templates/counter/cash_summary_list.jinja:37 counter/views.py:854 #: trombi/templates/trombi/comment.jinja:4 #: trombi/templates/trombi/comment.jinja:8 #: trombi/templates/trombi/user_tools.jinja:50 @@ -855,38 +854,37 @@ msgstr "Vous ne pouvez pas faire de boucles dans les clubs" msgid "A club with that unix_name already exists" msgstr "Un club avec ce nom UNIX existe déjà." -#: club/models.py:186 counter/models.py:437 counter/models.py:455 +#: club/models.py:185 counter/models.py:459 counter/models.py:477 #: eboutic/models.py:38 eboutic/models.py:72 election/models.py:140 #: launderette/models.py:114 launderette/models.py:152 sas/models.py:158 #: trombi/models.py:148 msgid "user" msgstr "nom d'utilisateur" -#: club/models.py:190 core/models.py:178 election/models.py:139 +#: club/models.py:189 core/models.py:178 election/models.py:139 #: election/models.py:155 trombi/models.py:150 msgid "role" msgstr "rôle" -#: club/models.py:192 core/models.py:64 counter/models.py:101 -#: counter/models.py:127 election/models.py:13 election/models.py:93 +#: club/models.py:191 core/models.py:64 counter/models.py:109 +#: counter/models.py:135 election/models.py:13 election/models.py:93 #: election/models.py:141 forum/models.py:50 forum/models.py:186 msgid "description" msgstr "description" -#: club/models.py:197 +#: club/models.py:196 msgid "User must be subscriber to take part to a club" msgstr "L'utilisateur doit être cotisant pour faire partie d'un club" -#: club/models.py:199 +#: club/models.py:198 msgid "User is already member of that club" msgstr "L'utilisateur est déjà membre de ce club" -#: club/models.py:203 +#: club/models.py:202 msgid "past member" msgstr "Anciens membres" -#: club/templates/club/club_list.jinja:4 -#: club/templates/club/club_list.jinja:24 +#: club/templates/club/club_list.jinja:4 club/templates/club/club_list.jinja:24 msgid "Club list" msgstr "Liste des clubs" @@ -951,14 +949,13 @@ msgstr "Du" msgid "To" msgstr "Au" -#: club/templates/club/club_sellings.jinja:5 club/views.py:78 -#: club/views.py:251 counter/templates/counter/counter_main.jinja:19 +#: club/templates/club/club_sellings.jinja:5 club/views.py:78 club/views.py:251 +#: counter/templates/counter/counter_main.jinja:19 #: counter/templates/counter/last_ops.jinja:35 msgid "Sellings" msgstr "Ventes" -#: club/templates/club/club_sellings.jinja:9 -#: club/templates/club/stats.jinja:19 +#: club/templates/club/club_sellings.jinja:9 club/templates/club/stats.jinja:19 #: counter/templates/counter/cash_summary_list.jinja:15 msgid "Show" msgstr "Montrer" @@ -1096,17 +1093,17 @@ msgstr "Choisir un utilisateur" msgid "You do not have the permission to do that" msgstr "Vous n'avez pas la permission de faire cela" -#: club/views.py:197 counter/views.py:1069 +#: club/views.py:197 counter/views.py:1096 msgid "Begin date" msgstr "Date de début" -#: club/views.py:198 com/views.py:130 counter/views.py:1070 +#: club/views.py:198 com/views.py:130 counter/views.py:1097 #: election/views.py:135 subscription/views.py:47 msgid "End date" msgstr "Date de fin" #: club/views.py:213 core/templates/core/user_stats.jinja:27 -#: counter/views.py:1160 +#: counter/views.py:1187 msgid "Product" msgstr "Produit" @@ -1156,7 +1153,7 @@ msgstr "résumé" msgid "content" msgstr "contenu" -#: com/models.py:64 core/models.py:1043 launderette/models.py:86 +#: com/models.py:64 core/models.py:1031 launderette/models.py:86 #: launderette/models.py:112 launderette/models.py:149 stock/models.py:59 #: stock/models.py:98 msgid "type" @@ -1166,7 +1163,7 @@ msgstr "type" msgid "author" msgstr "auteur" -#: com/models.py:67 core/models.py:629 +#: com/models.py:67 core/models.py:617 msgid "is moderated" msgstr "est modéré" @@ -1219,9 +1216,8 @@ msgid "News admin" msgstr "Administration des nouvelles" #: com/templates/com/news_admin_list.jinja:9 -#: com/templates/com/news_detail.jinja:5 -#: com/templates/com/news_detail.jinja:11 com/templates/com/news_list.jinja:4 -#: com/templates/com/news_list.jinja:28 +#: com/templates/com/news_detail.jinja:5 com/templates/com/news_detail.jinja:11 +#: com/templates/com/news_list.jinja:4 com/templates/com/news_list.jinja:28 msgid "News" msgstr "Nouvelles" @@ -1344,7 +1340,7 @@ msgid "Coming soon... don't miss!" msgstr "Prochainement... à ne pas rater!" #: com/templates/com/weekmail.jinja:5 com/templates/com/weekmail.jinja.py:9 -#: com/views.py:62 core/templates/core/user_tools.jinja:82 +#: com/views.py:62 core/templates/core/user_tools.jinja:80 msgid "Weekmail" msgstr "Weekmail" @@ -1435,7 +1431,7 @@ msgstr "Le mot de la fin" msgid "Communication administration" msgstr "Administration de la communication" -#: com/views.py:67 core/templates/core/user_tools.jinja:83 +#: com/views.py:67 core/templates/core/user_tools.jinja:81 msgid "Weekmail destinations" msgstr "Destinataires du Weekmail" @@ -1707,11 +1703,11 @@ msgstr "adresse des parents" msgid "is subscriber viewable" msgstr "profil visible par les cotisants" -#: core/models.py:367 +#: core/models.py:359 msgid "A user with that username already exists" msgstr "Un utilisateur de ce nom d'utilisateur existe déjà" -#: core/models.py:492 core/templates/core/macros.jinja:21 +#: core/models.py:484 core/templates/core/macros.jinja:21 #: core/templates/core/user_detail.jinja:14 #: core/templates/core/user_detail.jinja:16 #: core/templates/core/user_edit.jinja:17 @@ -1722,109 +1718,109 @@ msgstr "Un utilisateur de ce nom d'utilisateur existe déjà" msgid "Profile" msgstr "Profil" -#: core/models.py:581 +#: core/models.py:569 msgid "Visitor" msgstr "Visiteur" -#: core/models.py:587 +#: core/models.py:575 msgid "do you want to receive the weekmail" msgstr "voulez-vous recevoir le Weekmail" -#: core/models.py:592 +#: core/models.py:580 msgid "define if we show a users stats" msgstr "Definit si l'on montre les statistiques de l'utilisateur" -#: core/models.py:594 +#: core/models.py:582 msgid "Show your account statistics to others" msgstr "Montrez vos statistiques de compte aux autres" -#: core/models.py:617 +#: core/models.py:605 msgid "file name" msgstr "nom du fichier" -#: core/models.py:618 core/models.py:829 +#: core/models.py:606 core/models.py:817 msgid "parent" msgstr "parent" -#: core/models.py:619 core/models.py:635 +#: core/models.py:607 core/models.py:623 msgid "file" msgstr "fichier" -#: core/models.py:620 +#: core/models.py:608 msgid "compressed file" msgstr "version allégée" -#: core/models.py:621 +#: core/models.py:609 msgid "thumbnail" msgstr "miniature" -#: core/models.py:622 core/models.py:630 +#: core/models.py:610 core/models.py:618 msgid "owner" msgstr "propriétaire" -#: core/models.py:623 core/models.py:835 core/views/files.py:149 +#: core/models.py:611 core/models.py:823 core/views/files.py:149 msgid "edit group" msgstr "groupe d'édition" -#: core/models.py:624 core/models.py:836 core/views/files.py:150 +#: core/models.py:612 core/models.py:824 core/views/files.py:150 msgid "view group" msgstr "groupe de vue" -#: core/models.py:625 +#: core/models.py:613 msgid "is folder" msgstr "est un dossier" -#: core/models.py:626 +#: core/models.py:614 msgid "mime type" msgstr "type mime" -#: core/models.py:627 +#: core/models.py:615 msgid "size" msgstr "taille" -#: core/models.py:631 +#: core/models.py:619 msgid "asked for removal" msgstr "retrait demandé" -#: core/models.py:632 +#: core/models.py:620 msgid "is in the SAS" msgstr "est dans le SAS" -#: core/models.py:671 +#: core/models.py:659 msgid "Character '/' not authorized in name" msgstr "Le caractère '/' n'est pas autorisé dans les noms de fichier" -#: core/models.py:674 core/models.py:679 +#: core/models.py:662 core/models.py:667 msgid "Loop in folder tree" msgstr "Boucle dans l'arborescence des dossiers" -#: core/models.py:683 +#: core/models.py:671 msgid "You can not make a file be a children of a non folder file" msgstr "" "Vous ne pouvez pas mettre un fichier enfant de quelque chose qui n'est pas " "un dossier" -#: core/models.py:687 +#: core/models.py:675 msgid "Duplicate file" msgstr "Un fichier de ce nom existe déjà" -#: core/models.py:701 +#: core/models.py:689 msgid "You must provide a file" msgstr "Vous devez fournir un fichier" -#: core/models.py:767 +#: core/models.py:755 msgid "Folder: " msgstr "Dossier : " -#: core/models.py:769 +#: core/models.py:757 msgid "File: " msgstr "Fichier : " -#: core/models.py:821 +#: core/models.py:809 msgid "page unix name" msgstr "nom unix de la page" -#: core/models.py:825 +#: core/models.py:813 msgid "" "Enter a valid page name. This value may contain only unaccented letters, " "numbers and ./+/-/_ characters." @@ -1832,51 +1828,51 @@ msgstr "" "Entrez un nom de page correct. Uniquement des lettres non accentuées, " "numéros, et ./+/-/_" -#: core/models.py:832 +#: core/models.py:820 msgid "page name" msgstr "nom de la page" -#: core/models.py:833 +#: core/models.py:821 msgid "owner group" msgstr "groupe propriétaire" -#: core/models.py:837 +#: core/models.py:825 msgid "lock user" msgstr "utilisateur bloquant" -#: core/models.py:838 +#: core/models.py:826 msgid "lock_timeout" msgstr "décompte du déblocage" -#: core/models.py:865 +#: core/models.py:853 msgid "Duplicate page" msgstr "Une page de ce nom existe déjà" -#: core/models.py:871 +#: core/models.py:859 msgid "Loop in page tree" msgstr "Boucle dans l'arborescence des pages" -#: core/models.py:1000 +#: core/models.py:988 msgid "revision" msgstr "révision" -#: core/models.py:1001 +#: core/models.py:989 msgid "page title" msgstr "titre de la page" -#: core/models.py:1002 +#: core/models.py:990 msgid "page content" msgstr "contenu de la page" -#: core/models.py:1041 +#: core/models.py:1029 msgid "url" msgstr "url" -#: core/models.py:1042 +#: core/models.py:1030 msgid "param" msgstr "param" -#: core/models.py:1045 +#: core/models.py:1033 msgid "viewed" msgstr "vue" @@ -1942,7 +1938,7 @@ msgstr "SAS" #: core/templates/core/base.jinja:95 forum/templates/forum/forum.jinja:10 #: forum/templates/forum/last_unread.jinja:13 -#: forum/templates/forum/main.jinja:6 forum/templates/forum/main.jinja:11 +#: forum/templates/forum/main.jinja:6 forum/templates/forum/main.jinja.py:11 #: forum/templates/forum/main.jinja:14 forum/templates/forum/reply.jinja:15 #: forum/templates/forum/topic.jinja:30 msgid "Forum" @@ -2192,13 +2188,11 @@ msgstr "login" msgid "Lost password?" msgstr "Mot de passe perdu ?" -#: core/templates/core/macros.jinja:31 -#: core/templates/core/user_detail.jinja:27 +#: core/templates/core/macros.jinja:31 core/templates/core/user_detail.jinja:27 msgid "Born: " msgstr "Né le : " -#: core/templates/core/macros.jinja:35 -#: core/templates/core/user_detail.jinja:48 +#: core/templates/core/macros.jinja:35 core/templates/core/user_detail.jinja:48 msgid "Promo: " msgstr "Promo : " @@ -2489,7 +2483,7 @@ msgid "Eboutic invoices" msgstr "Facture eboutic" #: core/templates/core/user_account.jinja:53 -#: core/templates/core/user_tools.jinja:36 counter/views.py:573 +#: core/templates/core/user_tools.jinja:34 counter/views.py:600 msgid "Etickets" msgstr "Etickets" @@ -2683,8 +2677,8 @@ msgstr "Cotisations" msgid "Subscription stats" msgstr "Statistiques de cotisation" -#: core/templates/core/user_tools.jinja:27 counter/views.py:543 -#: counter/views.py:709 +#: core/templates/core/user_tools.jinja:25 counter/views.py:570 +#: counter/views.py:736 msgid "Counters" msgstr "Comptoirs" @@ -2704,17 +2698,17 @@ msgstr "Gestion des produits" msgid "Product types management" msgstr "Gestion des types de produit" -#: core/templates/core/user_tools.jinja:34 -#: counter/templates/counter/cash_summary_list.jinja:23 counter/views.py:563 +#: core/templates/core/user_tools.jinja:32 +#: counter/templates/counter/cash_summary_list.jinja:23 counter/views.py:590 msgid "Cash register summaries" msgstr "Relevés de caisse" -#: core/templates/core/user_tools.jinja:35 -#: counter/templates/counter/invoices_call.jinja:4 counter/views.py:568 +#: core/templates/core/user_tools.jinja:33 +#: counter/templates/counter/invoices_call.jinja:4 counter/views.py:595 msgid "Invoices call" msgstr "Appels à facture" -#: core/templates/core/user_tools.jinja:43 core/views/user.py:213 +#: core/templates/core/user_tools.jinja:41 core/views/user.py:213 #: counter/templates/counter/counter_list.jinja:18 #: counter/templates/counter/counter_list.jinja:33 #: counter/templates/counter/counter_list.jinja:54 @@ -2881,80 +2875,84 @@ msgstr "L'utilisateur a déjà une photo de profil" msgid "account id" msgstr "numéro de compte" -#: counter/models.py:56 +#: counter/models.py:54 +msgid "recorded product" +msgstr "produits consignés" + +#: counter/models.py:57 msgid "customer" msgstr "client" -#: counter/models.py:57 +#: counter/models.py:58 msgid "customers" msgstr "clients" -#: counter/models.py:77 counter/templates/counter/counter_click.jinja:48 +#: counter/models.py:85 counter/templates/counter/counter_click.jinja:48 #: counter/templates/counter/counter_click.jinja:82 msgid "Not enough money" msgstr "Solde insuffisant" -#: counter/models.py:105 counter/models.py:128 +#: counter/models.py:113 counter/models.py:136 msgid "product type" msgstr "type du produit" -#: counter/models.py:131 +#: counter/models.py:139 msgid "purchase price" msgstr "prix d'achat" -#: counter/models.py:132 +#: counter/models.py:140 msgid "selling price" msgstr "prix de vente" -#: counter/models.py:133 +#: counter/models.py:141 msgid "special selling price" msgstr "prix de vente spécial" -#: counter/models.py:134 +#: counter/models.py:142 msgid "icon" msgstr "icône" -#: counter/models.py:136 +#: counter/models.py:144 msgid "limit age" msgstr "âge limite" -#: counter/models.py:137 +#: counter/models.py:145 msgid "tray price" msgstr "prix plateau" -#: counter/models.py:138 +#: counter/models.py:146 msgid "parent product" msgstr "produit parent" -#: counter/models.py:140 +#: counter/models.py:148 msgid "buying groups" msgstr "groupe d'achat" -#: counter/models.py:141 election/models.py:36 +#: counter/models.py:149 election/models.py:36 msgid "archived" msgstr "archivé" -#: counter/models.py:144 counter/models.py:540 +#: counter/models.py:152 counter/models.py:562 msgid "product" msgstr "produit" -#: counter/models.py:164 +#: counter/models.py:186 msgid "products" msgstr "produits" -#: counter/models.py:165 +#: counter/models.py:187 msgid "counter type" msgstr "type de comptoir" -#: counter/models.py:167 +#: counter/models.py:189 msgid "Bar" msgstr "Bar" -#: counter/models.py:167 +#: counter/models.py:189 msgid "Office" msgstr "Bureau" -#: counter/models.py:167 counter/templates/counter/counter_list.jinja:11 +#: counter/models.py:189 counter/templates/counter/counter_list.jinja:11 #: eboutic/templates/eboutic/eboutic_main.jinja:4 #: eboutic/templates/eboutic/eboutic_main.jinja:24 #: eboutic/templates/eboutic/eboutic_makecommand.jinja:8 @@ -2963,15 +2961,15 @@ msgstr "Bureau" msgid "Eboutic" msgstr "Eboutic" -#: counter/models.py:168 +#: counter/models.py:190 msgid "sellers" msgstr "vendeurs" -#: counter/models.py:171 launderette/models.py:151 +#: counter/models.py:193 launderette/models.py:151 msgid "token" msgstr "jeton" -#: counter/models.py:174 counter/models.py:438 counter/models.py:456 +#: counter/models.py:196 counter/models.py:460 counter/models.py:478 #: launderette/models.py:39 stock/models.py:39 msgid "counter" msgstr "comptoir" @@ -3005,20 +3003,20 @@ msgstr "Compte utilisateur" msgid "Credit card" msgstr "Carte bancaire" -#: counter/models.py:334 +#: counter/models.py:356 msgid "selling" msgstr "vente" -#: counter/models.py:353 +#: counter/models.py:375 msgid "Unknown event" msgstr "Événement inconnu" -#: counter/models.py:354 +#: counter/models.py:376 #, python-format msgid "Eticket bought for the event %(event)s" msgstr "Eticket acheté pour l'événement %(event)s" -#: counter/models.py:356 counter/models.py:368 +#: counter/models.py:378 counter/models.py:390 #, python-format msgid "" "You bought an eticket for the event %(event)s.\n" @@ -3027,51 +3025,51 @@ msgstr "" "Vous avez acheté un Eticket pour l'événement %(event)s.\n" "Vous pouvez le télécharger sur cette page: %(url)s" -#: counter/models.py:441 +#: counter/models.py:463 msgid "last activity date" msgstr "dernière activité" -#: counter/models.py:444 +#: counter/models.py:466 msgid "permanency" msgstr "permanence" -#: counter/models.py:459 +#: counter/models.py:481 msgid "emptied" msgstr "coffre vidée" -#: counter/models.py:462 +#: counter/models.py:484 msgid "cash register summary" msgstr "relevé de caisse" -#: counter/models.py:527 +#: counter/models.py:549 msgid "cash summary" msgstr "relevé" -#: counter/models.py:528 +#: counter/models.py:550 msgid "value" msgstr "valeur" -#: counter/models.py:530 +#: counter/models.py:552 msgid "check" msgstr "chèque" -#: counter/models.py:533 +#: counter/models.py:555 msgid "cash register summary item" msgstr "élément de relevé de caisse" -#: counter/models.py:541 +#: counter/models.py:563 msgid "banner" msgstr "bannière" -#: counter/models.py:542 +#: counter/models.py:564 msgid "event date" msgstr "date de l'événement" -#: counter/models.py:543 +#: counter/models.py:565 msgid "event title" msgstr "titre de l'événement" -#: counter/models.py:544 +#: counter/models.py:566 msgid "secret" msgstr "secret" @@ -3123,7 +3121,7 @@ msgstr "Liste des relevés de caisse" msgid "Theoric sums" msgstr "Sommes théoriques" -#: counter/templates/counter/cash_summary_list.jinja:36 counter/views.py:828 +#: counter/templates/counter/cash_summary_list.jinja:36 counter/views.py:855 msgid "Emptied" msgstr "Coffre vidé" @@ -3359,97 +3357,97 @@ msgstr "L'utilisateur n'est pas barman." msgid "Bad location, someone is already logged in somewhere else" msgstr "Mauvais comptoir, quelqu'un est déjà connecté ailleurs" -#: counter/views.py:400 +#: counter/views.py:425 msgid "END" msgstr "FIN" -#: counter/views.py:402 +#: counter/views.py:427 msgid "CAN" msgstr "ANN" -#: counter/views.py:432 +#: counter/views.py:457 msgid "You have not enough money to buy all the basket" msgstr "Vous n'avez pas assez d'argent pour acheter le panier" -#: counter/views.py:533 +#: counter/views.py:560 msgid "Counter administration" msgstr "Administration des comptoirs" -#: counter/views.py:538 +#: counter/views.py:565 msgid "Stocks" msgstr "Stocks" -#: counter/views.py:548 +#: counter/views.py:575 msgid "Products" msgstr "Produits" -#: counter/views.py:553 +#: counter/views.py:580 msgid "Archived products" msgstr "Produits archivés" -#: counter/views.py:558 +#: counter/views.py:585 msgid "Product types" msgstr "Types de produit" -#: counter/views.py:706 +#: counter/views.py:733 msgid "Parent product" msgstr "Produit parent" -#: counter/views.py:707 +#: counter/views.py:734 msgid "Buying groups" msgstr "Groupes d'achat" -#: counter/views.py:807 +#: counter/views.py:834 msgid "10 cents" msgstr "10 centimes" -#: counter/views.py:808 +#: counter/views.py:835 msgid "20 cents" msgstr "20 centimes" -#: counter/views.py:809 +#: counter/views.py:836 msgid "50 cents" msgstr "50 centimes" -#: counter/views.py:810 +#: counter/views.py:837 msgid "1 euro" msgstr "1 €" -#: counter/views.py:811 +#: counter/views.py:838 msgid "2 euros" msgstr "2 €" -#: counter/views.py:812 +#: counter/views.py:839 msgid "5 euros" msgstr "5 €" -#: counter/views.py:813 +#: counter/views.py:840 msgid "10 euros" msgstr "10 €" -#: counter/views.py:814 +#: counter/views.py:841 msgid "20 euros" msgstr "20 €" -#: counter/views.py:815 +#: counter/views.py:842 msgid "50 euros" msgstr "50 €" -#: counter/views.py:816 +#: counter/views.py:843 msgid "100 euros" msgstr "100 €" -#: counter/views.py:817 counter/views.py:819 counter/views.py:821 -#: counter/views.py:823 counter/views.py:825 +#: counter/views.py:844 counter/views.py:846 counter/views.py:848 +#: counter/views.py:850 counter/views.py:852 msgid "Check amount" msgstr "Montant du chèque" -#: counter/views.py:818 counter/views.py:820 counter/views.py:822 -#: counter/views.py:824 counter/views.py:826 +#: counter/views.py:845 counter/views.py:847 counter/views.py:849 +#: counter/views.py:851 counter/views.py:853 msgid "Check quantity" msgstr "Nombre de chèque" -#: counter/views.py:1234 +#: counter/views.py:1261 msgid "people(s)" msgstr "personne(s)" @@ -3860,12 +3858,12 @@ msgid "Washing and drying" msgstr "Lavage et séchage" #: launderette/templates/launderette/launderette_book.jinja:27 -#: sith/settings.py:526 +#: sith/settings.py:532 msgid "Washing" msgstr "Lavage" #: launderette/templates/launderette/launderette_book.jinja:31 -#: sith/settings.py:526 +#: sith/settings.py:532 msgid "Drying" msgstr "Séchage" @@ -4091,133 +4089,133 @@ msgstr "Sevenans" msgid "Montbéliard" msgstr "Montbéliard" -#: sith/settings.py:419 +#: sith/settings.py:425 msgid "One semester" msgstr "Un semestre, 15 €" -#: sith/settings.py:424 +#: sith/settings.py:430 msgid "Two semesters" msgstr "Deux semestres, 28 €" -#: sith/settings.py:429 +#: sith/settings.py:435 msgid "Common core cursus" msgstr "Cursus tronc commun, 45 €" -#: sith/settings.py:434 +#: sith/settings.py:440 msgid "Branch cursus" msgstr "Cursus branche, 45 €" -#: sith/settings.py:439 +#: sith/settings.py:445 msgid "Alternating cursus" msgstr "Cursus alternant, 30 €" -#: sith/settings.py:444 +#: sith/settings.py:450 msgid "Honorary member" msgstr "Membre honoraire, 0 €" -#: sith/settings.py:449 +#: sith/settings.py:455 msgid "Assidu member" msgstr "Membre d'Assidu, 0 €" -#: sith/settings.py:454 +#: sith/settings.py:460 msgid "Amicale/DOCEO member" msgstr "Membre de l'Amicale/DOCEO, 0 €" -#: sith/settings.py:459 +#: sith/settings.py:465 msgid "UT network member" msgstr "Cotisant du réseau UT, 0 €" -#: sith/settings.py:464 +#: sith/settings.py:470 msgid "CROUS member" msgstr "Membres du CROUS, 0 €" -#: sith/settings.py:469 +#: sith/settings.py:475 msgid "Sbarro/ESTA member" msgstr "Membre de Sbarro ou de l'ESTA, 15 €" -#: sith/settings.py:491 +#: sith/settings.py:497 msgid "President" msgstr "Président" -#: sith/settings.py:492 +#: sith/settings.py:498 msgid "Vice-President" msgstr "Vice-Président" -#: sith/settings.py:493 +#: sith/settings.py:499 msgid "Treasurer" msgstr "Trésorier" -#: sith/settings.py:494 +#: sith/settings.py:500 msgid "Communication supervisor" msgstr "Responsable communication" -#: sith/settings.py:495 +#: sith/settings.py:501 msgid "Secretary" msgstr "Secrétaire" -#: sith/settings.py:496 +#: sith/settings.py:502 msgid "IT supervisor" msgstr "Responsable info" -#: sith/settings.py:497 +#: sith/settings.py:503 msgid "Board member" msgstr "Membre du bureau" -#: sith/settings.py:498 +#: sith/settings.py:504 msgid "Active member" msgstr "Membre actif" -#: sith/settings.py:499 +#: sith/settings.py:505 msgid "Curious" msgstr "Curieux" -#: sith/settings.py:533 +#: sith/settings.py:539 msgid "A fresh new to be moderated" msgstr "Une nouvelle toute neuve à modérer" -#: sith/settings.py:534 +#: sith/settings.py:540 msgid "New files to be moderated" msgstr "Nouveaux fichiers à modérer" -#: sith/settings.py:535 +#: sith/settings.py:541 msgid "New pictures/album to be moderated in the SAS" msgstr "Nouvelles photos/albums à modérer dans le SAS" -#: sith/settings.py:536 +#: sith/settings.py:542 msgid "You've been identified on some pictures" msgstr "Vous avez été identifié sur des photos" -#: sith/settings.py:537 +#: sith/settings.py:543 #, python-format msgid "You just refilled of %s €" msgstr "Vous avez rechargé votre compte de %s €" -#: sith/settings.py:538 +#: sith/settings.py:544 #, python-format msgid "You just bought %s" msgstr "Vous avez acheté %s" -#: sith/settings.py:539 +#: sith/settings.py:545 msgid "You have a notification" msgstr "Vous avez une notification" -#: sith/settings.py:543 +#: sith/settings.py:549 msgid "Success!" msgstr "Succès !" -#: sith/settings.py:544 +#: sith/settings.py:550 msgid "Fail!" msgstr "Échec !" -#: sith/settings.py:545 +#: sith/settings.py:551 msgid "You successfully posted an article in the Weekmail" msgstr "Article posté avec succès dans le Weekmail" -#: sith/settings.py:546 +#: sith/settings.py:552 msgid "You successfully edited an article in the Weekmail" msgstr "Article édité avec succès dans le Weekmail" -#: sith/settings.py:547 +#: sith/settings.py:553 msgid "You successfully sent the Weekmail" msgstr "Weekmail envoyé avec succès" diff --git a/sith/settings.py b/sith/settings.py index 9d1d16a3..89d315f9 100644 --- a/sith/settings.py +++ b/sith/settings.py @@ -397,6 +397,16 @@ SITH_COUNTER_BANK = [ ('LA-POSTE', 'La Poste'), ] +SITH_RECORD_PRODUCT = [ + 1152, +] + +SITH_UNRECORD_PRODUCT = [ + 1151, +] + +SITH_RECORD_LIMIT = 3 + # Defines pagination for cash summary SITH_COUNTER_CASH_SUMMARY_LENGTH = 50