Commit graph

1225 commits

Author SHA1 Message Date
Martin Pépin
f13d1072c7 Add simple tests for the stat views
We check that we can get all the stats views with the appropriate
permissions.
2017-04-03 23:21:42 +01:00
Aurélien Delobelle
10d2b58fa7 clean some comments
- fix: error if actions are empty in balance stats
2017-04-03 17:06:32 +02:00
Aurélien Delobelle
6d2e150aa0 clean align 2017-04-03 16:56:44 +02:00
Aurélien Delobelle
903da795ab clean kfet statistic.js
- no longer dictToArray where it isn't necessary (because already an
  array)
- fix chart height:
  - previous charts were causing bugs
  - height is fixed (even with window resizing)
- clean whitespaces
2017-04-03 16:53:28 +02:00
Aurélien Delobelle
87bc90ec8b Begin/end balance stat graph
- Anytime begin at account creation datetime
- Others doesn't take care of account creation
- Add check to avoid to bug on actions list length
2017-04-03 16:07:31 +02:00
Aurélien Delobelle
769c37634d delete debug msg 2017-04-03 15:43:56 +02:00
Aurélien Delobelle
1bb83ccdd7 simplify StatScale 2017-04-03 15:10:53 +02:00
Aurélien Delobelle
b3a9ad8a96 clean mixin 2017-04-03 13:24:04 +02:00
Aurélien Delobelle
d97a7be819 stats: fix begin of balances graphs
- graph begin at first operation or later
2017-04-03 03:15:07 +02:00
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