Commit graph

1216 commits

Author SHA1 Message Date
Aurélien Delobelle
c01de558e1 Clean Article stats
kfet.statistic
- delete no longer used defs
- new mixin - ScaleMixin
  - get scale args from GET params
  - chunkify querysets according to a scale

Article stats
- use SingleResumeStat for manifest
- use ScaleMixin for sales
- update urls
- update permission required: teamkfet

Account stats
- update permission required: teamkfet
- operations use ScaleMixin
- fix manifests urls
2017-04-03 03:12:52 +02:00
Aurélien Delobelle
f585247224 Refactor Account Operations stats
K-Fêt - Statistics

New base class - StatScale
- create scale, given chunk size (timedelta), start and end times
- get labels of
- get start and end datetimes of chunks

DayStatScale: Scale whose chunks interval is 1 day
WeekStatScale: same with 1 week
MonthStatScale: same with 1 month

AccountStatOperationList: manifest of operations stats of an account
- renamed from AccountStatLastAll
- updated according to SingleResumeStat

AccountStatOperation:
- renamed from AccountStatLast
- remove scale logic with use of StatScale objects
- used scale is given by `scale` and `scale_args` GET params
- add filter on operations types with `types` GET param

AccountStatLast(Day,Week,Month) are deleted ("merged" in
AccountStatOperation)
2017-04-03 00:40:52 +02:00
Aurélien Delobelle
31261fd376 set height canvas graph & fix graph display 2017-04-02 23:38:42 +02:00
Aurélien Delobelle
6ebea6557c Merge branch 'Aufinal/graph_size' into aureplop/fix_stats 2017-04-02 23:19:34 +02:00
Ludovic Stephan
48721b7dca Reduce graph size 2017-04-02 17:54:13 -03:00
Aurélien Delobelle
df7e935390 Clean GET params in ajax calls
- Use `data` arg of `$.getJSON` for `format` param
- Delete `dictToArray` call on data returned by `SingleResumeStat` class view since this view now returns stats manifest as an array
2017-04-02 17:16:05 +02:00
Aurélien Delobelle
1ee993e1e1 Add permission check to AccountStatBalance
Only connected user can get its balance data
2017-04-02 17:14:36 +02:00
Aurélien Delobelle
87b9db520f Refactor py base stats and account balance stats
New mixin: PkUrlMixin
- use with SingleObjectMixin standard django mixin (used by
  DetailView...)
- `get_object` use field declared in `pk_url_kwarg` to get... the object

SingleResumeStat
- clean (part of) py code

AccountStatBalanceList
- renamed from `AccountStatBalanceAll`
- url modified
- add permission checking (only the connected user can get balance
  stats manifest)
- clean py code

AccountStatBalance
- cleaner filtering management
- merge urls using this class
- clean py code
2017-04-02 17:03:20 +02:00
Aurélien Delobelle
f6022ecf7d Add str to Transfer model
+ PEP8 this model
2017-04-02 16:49:41 +02:00
Aurélien Delobelle
78aa5df350 fix template error 2017-04-02 12:55:44 +02:00
Aurélien Delobelle
e8fdd083aa delete unused class-views 2017-04-02 05:34:34 +02:00
Aurélien Delobelle
96597aa146 clean some kfet templates 2017-04-02 05:17:26 +02:00
Aurélien Delobelle
55116f7179 Merge branch 'Aufinal/stat_article' into 'master'
Fix article stat display

See merge request !207
2017-04-02 02:49:54 +02:00
Martin Pépin
e4d51de569 Merge branch 'hotfix/autocomplete_no_value' 2017-04-01 22:11:36 +01:00
Martin Pépin
a793e9a2e7 exclude empty strings from ldap results
The uid attribute in a LDAP's entry cannot be an empty string. We need
to get an actual identifier.
2017-04-01 22:07:32 +01:00
Martin Pépin
9cdf064005 Handle incomplete values from the LDAP
Sometime `uid` is not set in the objects fetched from the LDAP. This
case has to be handled. Also, the `.uid` and `.cn` attributes of these
objects in the python abstractions have a `.value` method which we
should use.
2017-04-01 21:45:05 +01:00
Ludovic Stephan
cce0411ee9 Merge both 0048 migrations 2017-04-01 17:37:29 -03:00
Martin Pepin
1eed2283f5 Merge branch 'Roussille/bda' into 'master'
Catalogue BdA

See merge request !187
2017-04-01 18:56:26 +02:00
Hugo Roussille
66dd7848b8 Correction du format de l'URL 2017-04-01 16:48:18 +02:00
Hugo Roussille
6b8001db56 Correction des messages d'erreur et de la gestion des exceptions 2017-04-01 16:34:17 +02:00
Ludovic Stephan
bbb517fbd3 Fix article stat display 2017-04-01 10:37:40 -03:00
Aurélien Delobelle
c355316045 Merge branch 'Aufinal/fix_stock_ws' into 'master'
K-Psul
- Fix: indicateur de stock bas

See merge request !201
2017-04-01 12:36:59 +02:00
Ludovic Stephan
9c9ad21d73 Add variable for article line 2017-03-31 23:46:10 -03:00
Ludovic Stephan
92fd94d1f9 Merge remote-tracking branch 'origin/master' into Aufinal/fix_stock_ws 2017-03-31 23:43:19 -03:00
Aurélien Delobelle
1286606f7a Merge branch 'Aufinal/hotfix/liq_withdraw' into 'master'
K-Fêt :
- Empêche les retraits/charges sur LIQ

See merge request !205
2017-03-31 23:49:33 +02:00
Aurélien Delobelle
fafa7e536e Merge branch 'Aufinal/websockets' into 'master'
K-Fêt :
- Ajout d'une classe générale pour les websockets

See merge request !204
2017-03-31 23:40:02 +02:00
Ludovic Stephan
aa29621c7c Prevents special opes on LIQ 2017-03-31 18:28:03 -03:00
Ludovic Stephan
ab15dbae76 Add handler management 2017-03-31 17:37:39 -03:00
Ludovic Stephan
38bfccf331 Change class name 2017-03-31 15:57:15 -03:00
Ludovic Stephan
8bf1bd5343 Websocket as member 2017-03-31 15:45:15 -03:00
Ludovic Stephan
413df0806d Add url get method 2017-03-31 15:10:41 -03:00
Martin Pépin
67b4421933 PEP8 does not like \ 2017-03-31 17:54:31 +01:00
Martin Pépin
8a1af73ee0 A migration for the new field appear_catalogue 2017-03-31 17:53:35 +01:00
Ludovic Stephan
499c081565 Websocket class and instance 2017-03-31 12:23:27 -03:00
Hugo Roussille
8cf14d3f6b Possibilité de filtrer sur plusieurs salles/catégories 2017-03-31 04:33:13 +02:00
Hugo Roussille
73c21d83ee Correction des exceptions et de l'URL des images 2017-03-31 03:47:32 +02:00
Hugo Roussille
f3b9266e35 Simplification du code avec des méthodes de Django 2017-03-31 03:35:09 +02:00
Hugo Roussille
a9c8de7544 Utilisation des JsonResponse 2017-03-31 03:15:40 +02:00
Hugo Roussille
c4a3c1a92a Formatage du code selon PEP-8 2017-03-31 02:51:58 +02:00
Martin Pepin
63cb7b7fd0 Merge branch 'Aufinal/dev_supplier' into 'master'
Ajoute un fournisseur aux données de dev

See merge request !202
2017-03-30 19:04:22 +02:00
Ludovic Stephan
56b5fd6279 Always randomize supplier articles 2017-03-29 23:22:18 -03:00
Ludovic Stephan
95c59de4fc Add supplier to dev data 2017-03-29 23:16:40 -03:00
Martin Pépin
f32f83db75 Merge branch 'hotfix/bda_mail_context' 2017-03-29 18:43:55 +01:00
Martin Pépin
2d22c202e9 Prevent side effects while sending emails 2017-03-29 18:17:20 +01:00
Ludovic Stephan
ca6e120a38 Fix ws stock update 2017-03-29 09:43:10 -03:00
Martin Pépin
c95d7cb670 Merge branch 'master' of git.eleves.ens.fr:cof-geek/gestioCOF 2017-03-29 11:21:11 +01:00
Martin Pépin
47e1071b12 Merge branch 'Production' 2017-03-29 11:20:55 +01:00
Martin Pépin
579711ed2d Hotfix: typo in template name 2017-03-29 11:17:34 +01:00
Aurélien Delobelle
ae82c34023 add missing migration 2017-03-25 11:21:21 +01:00
Aurélien Delobelle
215d4a63ad Merge branch 'Aufinal/create_opes' into 'master'
K-Fêt - Dev :
- new command - createopes: Création d'opérations et transferts aléatoires

See merge request !193
2017-03-25 11:08:22 +01:00