Commit graph

271 commits

Author SHA1 Message Date
Aurélien Delobelle
7989a07b5f cleaner fix 2017-04-04 01:36:19 +02:00
Aurélien Delobelle
df467767f4 fix default GET param 'types' on operations stats 2017-04-04 01:29:19 +02:00
Ludovic Stephan
b91edc9c7d Merge remote-tracking branch 'origin/aureplop/kpsul_js_refactor' into Aufinal/refactor_articles 2017-04-03 20:03:58 -03:00
Aurélien Delobelle
9d2298a089 Merge branch 'master' into aureplop/kpsul_js_refactor
Not chill.
2017-04-04 00:51:49 +02:00
Aurélien Delobelle
ce2a05766d Add set_many methods to kfet_config
- Fix addcost updates (from K-Psul)
2017-04-03 23:06:47 +02:00
Ludovic Stephan
f46ba0dd6c Merge branch 'master' into Aufinal/inventaires 2017-04-03 16:01:51 -03:00
Aurélien Delobelle
85caa6b058 Use django-djconfig for kfet app.
Old configuration(/settings), based on Settings model, system is
deleted: SettingsForm, Settings.
New system use `django-djconfig` module.

- `kfet.config` module provides `kfet_config` to access configuration concerning
kfet app.
- Views, forms, models, etc now use this object to retrieve conf values.
- Views no longer add config values to context, instead templates use
  `kfet_config` provided by a new context_processor.
- Enhance list and update views of settings.
- Fix: settings can directly be used without having to visit a specific
  page...

Misc
- Delete some py2/3 imports
- Delete unused imports in kfet.models and kfet.views
- Some PEP8 compliance
2017-04-03 20:32:16 +02: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
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
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
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
e8fdd083aa delete unused class-views 2017-04-02 05:34:34 +02:00
Ludovic Stephan
271654b447 No need for intermediate error reporting 2017-04-01 08:47:09 -03:00
Ludovic Stephan
ccf5f80685 Merge remote-tracking branch 'origin/master' into Aufinal/editions 2017-04-01 02:43:19 -03:00
Ludovic Stephan
aa29621c7c Prevents special opes on LIQ 2017-03-31 18:28:03 -03:00
Ludovic Stephan
1d8e084a19 websocket update when addcost 2017-03-31 14:37:00 -03:00
Ludovic Stephan
3b793dc726 Add first improvements for inventory 2017-03-28 23:47:41 -03:00
Ludovic Stephan
a1c976185c Fix transfer sort 2017-03-25 13:44:35 -03:00
Ludovic Stephan
0997d85083 Merge branch 'aureplop/kpsul_js_refactor' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/refactor_history 2017-03-25 12:39:30 -03:00
Ludovic Stephan
5ff8f69bfa Merge branch 'aureplop/kpsul_js_refactor' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/refactor_articles 2017-03-25 12:35:04 -03:00
Ludovic Stephan
f645121fb1 Add error when editing LIQ 2017-03-25 10:39:53 -03:00
Ludovic Stephan
aa6a50a6e7 Simplify JS-Python interface for cancel_ops 2017-03-24 23:57:27 -03:00
Ludovic Stephan
44fbc92893 Merge branch 'master' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/editions 2017-03-24 21:07:32 -03:00
Ludovic Stephan
d7740e66fe adapt code to is_checkout removal 2017-03-24 20:52:49 -03:00
Aurélien Delobelle
ac18cbd9d9 fix by on last statement 2017-03-24 22:10:34 +01:00
Ludovic Stephan
1fcd53d780 Continue renaming node.type to node.modelname 2017-03-20 00:42:12 -03:00
Ludovic Stephan
fe965875f7 Merge branch 'Aufinal/refactor_articles' into Aufinal/refactor_history 2017-03-20 00:33:30 -03:00
Ludovic Stephan
3465dd7045 Change node.type to node.modelname for clarity 2017-03-20 00:26:11 -03:00
Ludovic Stephan
66c5a6953c Improve websocket filter for special history pages 2017-03-19 04:29:54 +01:00
Ludovic Stephan
644b08973a Add websocket support for history 2017-03-18 02:32:27 -03:00
Ludovic Stephan
df0ea96b41 Adapt history_json return value to ModelForest standards 2017-03-17 15:59:21 -03:00
Qwann
de724a2c0d PEP8 for perform_operation 2017-03-17 19:53:23 +01:00
Qwann
fcc2ab8810 frontend working 2017-03-17 19:17:36 +01:00
Ludovic Stephan
53f89f53e0 Merge branch 'Aufinal/refactor_articles' into Aufinal/refactor_history 2017-03-17 12:34:48 -03:00
Ludovic Stephan
a7de396aa3 Better comparison control 2017-03-17 12:33:43 -03:00
Ludovic Stephan
11603cee69 Merge branch 'Aufinal/refactor_articles' into Aufinal/refactor_history 2017-03-17 00:19:45 -03:00
Ludovic Stephan
3d76079439 Add correct syntax to category data 2017-03-16 01:20:06 -03:00
Ludovic Stephan
3793863bab Merge remote-tracking branch 'origin/k-fet' into Aufinal/merge_k-fet 2017-03-15 22:58:54 -03:00
Ludovic Stephan
fe6823fc7b Adapt article_data return value to ModelTree standards 2017-03-15 22:39:30 -03:00
Qwann
d0938dfae7 Merge branch 'k-fet' into qwann/k-fet/category_addcost 2017-03-11 15:10:04 +01:00
Ludovic Stephan
66beeb5bd0 transfer history added 2017-03-11 01:41:21 -03:00
Ludovic Stephan
ab6b0d52f2 Merge branch 'Aufinal/transferts_historique' into Aufinal/refactor_history 2017-03-11 00:45:54 -03:00
Ludovic Stephan
8eae3cee7f adapt history view 2017-03-10 22:08:44 -03:00
Qwann
ee6de35627 category addcost added 2017-03-10 18:29:15 +01:00
Ludovic Stephan
8aa4fa2dce modify article API return 2017-03-09 09:21:07 -03:00
Qwann
f52aba8ca6 Merge branch 'k-fet' into qwann/k-fet/home 2017-03-05 19:21:20 +01:00
Aurélien Delobelle
95b129e396 resolved merge conflict in kfet views imports 2017-02-25 02:00:56 +01:00
Aurélien Delobelle
a9cb50b38d Better k-fet js and more
JavaScript
----------
- Basic classes that can be inherited to define a new class for a
  django model in javascript.
- Formatters classes are used to render properties and attributes of
  the instances of models classes.
- New classes to handle Account, Checkout, Statement models.
- Refactor K-Psul JS (part n/m).
- Better file organization.

Views
-----
- 'kpsul.checkout_data' is cleaner. Last statement is added to the JSON
  response with GET paramater 'last_statement'.
- 'account.read.json' is merged in account.read. JSON response is sent if
  GET parametter 'format' is set to 'json'.
- Fix PEP8 of concerned views.

New requirement: django-js-reverse
----------------------------------
Used to resolve the URLs defined in the project in JavaScript.
See https://github.com/ierror/django-js-reverse
2017-02-23 22:07:38 +01:00
Evarin
0fcb29252b Frontend tout en JS 2017-02-15 21:01:54 +01:00
Qwann
1c90608f6d some cleaning 2017-02-15 14:21:00 +01:00
Aurélien Delobelle
2e8fc45a1b Merge branch 'Aufinal/own_password' into 'k-fet'
Changement de son propre mot de passe

Permet à un K-Fêteux (disposant de la permission `kfet.is_team`) de modifier son propre mot de passe sur la page `account/XXX/edit`.

Accessoirement, la fonction `account_update` est maintenant conforme à PEP8.

Fix #121

See merge request !148
2017-02-13 16:32:40 +01:00
Ludovic Stephan
46e9e82da8 move account save 2017-02-13 12:19:47 -02:00
Qwann
9cae3ad0bd Merge branch 'k-fet' into qwann/k-fet/stats 2017-02-13 14:37:29 +01:00
Aurélien Delobelle
db4786abf8 Merge branch 'manet/correction-commandes' into 'k-fet'
Manet/correction commandes

- Fix création de commandes (fournisseur)

Fix #97
See merge request !128
2017-02-11 22:00:45 +01:00
Qwann
a4fdb99267 Revert "WS : quand la K-Fêt est ouverte ?"
This reverts commit ce9f717f06.
2017-02-08 12:42:07 +01:00
Ludovic Stephan
b404c989ff pep8 2017-02-05 03:42:02 -02:00
Ludovic Stephan
1d5e693045 ws for transfers 2017-02-05 03:26:15 -02:00
Ludovic Stephan
f8aa67721c fix socket update 2017-02-05 02:19:20 -02:00
Qwann
ce9f717f06 WS : quand la K-Fêt est ouverte ? 2017-01-27 21:46:21 +01:00
Qwann
0ac1eaf414 fixing decimal_issue 2017-01-27 13:08:50 +01:00
Qwann
5cedabf5a8 Merge branch 'qwann/k-fet/stats' into qwann/k-fet/home 2017-01-27 12:15:47 +01:00
Qwann
2f1fe15be3 fixing decimal_issue merging 2017-01-27 12:08:18 +01:00
Qwann
aa1afccf1f adding argumement hidden to Article
in order to avoid some articles to appear in the menu
2017-01-26 19:22:38 +01:00
Qwann
3ca38bd8e9 Carte done. 2017-01-26 17:19:42 +01:00
Qwann
a63966b2f6 carte styling done 2017-01-25 23:41:16 +01:00
Martin Pépin
bd7f767953 Cleanup
- Un peu de PEP8
- Suppression d'une partie de la py2 compat
- Typos
2017-01-25 23:23:53 +01:00
Qwann
df2a9bb1b3 factorising BalanceStat views 2017-01-24 16:56:26 +01:00
Qwann
232b293052 typos fixed 2017-01-20 20:27:24 +01:00
Qwann
f8c49ae90c docstring instead of comments 2017-01-20 20:19:28 +01:00
Qwann
de3db1405e Merge branch 'qwann/decimal_fixes' into qwann/k-fet/stats 2017-01-20 18:53:49 +01:00
Qwann
8b4f7ad60c decimal cast for operation.amount 2017-01-20 18:34:45 +01:00
Qwann
bdbb252a05 Revert "first fixes"
This reverts commit 5877218af5.
2017-01-17 17:16:53 +01:00
Qwann
5877218af5 first fixes 2017-01-14 16:23:45 +01:00
Ludovic Stephan
fabd0949e2 correct imports
Signed-off-by: Ludovic Stephan <lstephan@clipper.ens.fr>
2017-01-10 15:15:53 -02:00
Ludovic Stephan
6315ddf6b8 move pwd change to method
Signed-off-by: Ludovic Stephan <lstephan@clipper.ens.fr>
2017-01-10 12:58:35 -02:00
Martin Pépin
540b6f38b8 Merge branch 'master' into Kerl/ldap 2017-01-09 15:47:12 +01:00
Ludovic Stephan
7dc7d57a5e restrict to team even if malicious POST edit 2017-01-07 13:57:54 -02:00
Ludovic Stephan
fcf76b4af8 can change own password (actually working now) 2017-01-07 13:32:05 -02:00
Ludovic Stephan
2a20beeb59 pep8 2017-01-07 13:28:53 -02:00
Ludovic Stephan
1c5c1fe94d can change own password 2017-01-07 12:47:43 -02:00
Martin Pépin
3c7558c853 The end of Clipper
GestioCOF fetches the clipper accounts from an LDAP database and doesn't
need to store clippers in a table anymore.
2016-12-25 11:57:50 +01:00
Qwann
219835be17 putting away some code for future improvments 2016-12-24 12:42:35 +01:00
Qwann
de9387c6ad cleaning: PEP8, html, permissions 2016-12-24 12:34:11 +01:00
Qwann
7070129add evolution de la balance\n premier jet 2016-12-21 11:51:08 +01:00
Qwann
ccf7c4a484 ma conso added 2016-12-20 22:46:38 +01:00
Qwann
0c3c41a812 small changes 2016-12-19 16:36:23 +01:00
Ludovic Stephan
f06a732da5 remove unnecessary function 2016-12-11 23:29:05 -02:00
Ludovic Stephan
a9e1cd01db add transfersonly option 2016-12-11 23:22:14 -02:00
Qwann
4da9327666 Merge branch 'k-fet' of git.eleves.ens.fr:cof-geek/gestioCOF into qwann/k-fet/stats 2016-12-11 20:45:52 +01:00
Ludovic Stephan
66304359c0 unite cancel_ope and cancel_transfer 2016-12-11 16:22:55 -02:00
Ludovic Stephan
49bef61e53 filter transfers frop opes 2016-12-11 14:45:52 -02:00
Qwann
14f021b5b0 WIP articleCategory stat 2016-12-10 23:06:38 +01:00
Qwann
d19daa04b1 resuming views for stat 2016-12-10 17:33:24 +01:00
Qwann
3a7ffefacf week & day stat 2016-12-09 21:45:34 +01:00
Ludovic Stephan
85af7fe485 filter on id 2016-12-09 17:29:40 -02:00
Ludovic Stephan
b0a21119fa Merge branch 'k-fet' of git.eleves.ens.fr:cof-geek/gestioCOF into Aufinal/transferts_historique 2016-12-09 01:25:40 -02:00
Hugo Manet
92ec85dbbd Ajout d'un .distinct() dans la selection des articles liés à un supplier 2016-12-07 21:35:27 +01:00