Commit graph

86 commits

Author SHA1 Message Date
Aurélien Delobelle
2eee8f58aa Merge branch 'master' into aureplop/fewer_requests 2017-04-17 20:45:01 +02:00
Aurélien Delobelle
9668f1d1ec Account: check_negative() -> update_negative() 2017-04-13 15:48:13 +02:00
Aurélien Delobelle
18425b82c2 Check negative on cancellation.
- Like perform operations, cancel_operations can add/remove an account
  from negative accounts system.
- Balances checks are now performed against real_balance instead of
  balance.
  So if someone with a balance_offset go, for real, to positive land (ie even
  without taking into account the balance offset), its account is removed from
  the negative system.
- Fix bug on real_balance when negative exists but balance_offset is
  not set.

Fixes #156.
2017-04-13 15:15:59 +02:00
Aurélien Delobelle
b5cc26bb1b Merge branch 'master' into aureplop/fewer_requests 2017-04-11 22:46:18 +02:00
Aurélien Delobelle
784ba9bd10 Merge branch 'master' into aureplop/kfet_config 2017-04-08 18:36:28 +02:00
Aurélien Delobelle
afdb08b424 Fewer db requests with AccountNegative handling.
- AccountNegative use new AccountNegativeManager which select_related
  account, cofprofile and user for instances accessed via
  AccountNegative.objects.
- Compute sum of negatives with python instead of an SQL statement
  (since we already got the data with a previous query).
- Fix bug on account property `real_balance` (happened if
  an account has a relative AccountNegative instance but balance_offset
  to NULL).

- More compliant to PEP8
2017-04-06 19:07:13 +02:00
Aurélien Delobelle
709d421b2c Add custom Manager for Account model.
- When Account model is queried with Account.objects, it always add
  .select_related('cofprofile_user', 'negative').
- Eg benefits: history doesn't do anymore one request by account to
  fill the account filter.

Important

Using this workaround (systemically append select_related) can be
dangerous normally, however a certain number of properties in
cofprofile and user are frequently used (as firstname or lastname), and
the benefits seems greater.
2017-04-06 18:23:27 +02:00
Aurélien Delobelle
4b2e20e728 created_at required with default 2017-04-06 00:31:04 +02:00
Aurélien Delobelle
3ee9de93d9 few improvements on article category
- add verbose names to ArticleCategory fields
- add button to view categories list from articles list
- fix article_update template in form validation
- improve interface for articlecategory_update
- revert vanished urls (happened in merge with master...)
2017-04-05 15:34:28 +02:00
Aurélien Delobelle
42728e58be Merge branch 'master' into qwann/k-fet/category_addcost 2017-04-05 14:57:26 +02:00
Martin Pepin
fe66a6ef6b Merge branch 'aureplop/fix_stats' into 'master'
Stats K-Fêt - Python side

See merge request !208
2017-04-05 00:41:47 +02: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
7dc233c0e2 Merge branch 'Aufinal/editions' into 'master'
K-Fêt
- Fix: Les éditions ne touchent plus la caisse
- Fix: Seuls les achats sont possibles sur LIQ

See merge request !198
2017-04-03 14:39:53 +02:00
Aurélien Delobelle
f6022ecf7d Add str to Transfer model
+ PEP8 this model
2017-04-02 16:49:41 +02:00
Ludovic Stephan
ccf5f80685 Merge remote-tracking branch 'origin/master' into Aufinal/editions 2017-04-01 02:43:19 -03:00
Ludovic Stephan
ebf133d9af Lowercase model verbose names 2017-03-30 21:38:16 -03:00
Ludovic Stephan
20561eb515 Idem for account_update 2017-03-30 21:31:16 -03:00
Ludovic Stephan
c1b8849cb8 Idem for supplier_form 2017-03-30 21:16:47 -03:00
Ludovic Stephan
91d5fe234c Idem for checkoutstatements 2017-03-30 21:10:50 -03:00
Ludovic Stephan
079666c0db Use verbose names and form snippets for article_create 2017-03-30 19:32:11 -03:00
Ludovic Stephan
9a081ddae0 PEP8 on Operation model 2017-03-25 10:43:02 -03:00
Ludovic Stephan
14e0d8090f Add euros symbols 2017-03-25 10:01:35 -03:00
Ludovic Stephan
d8f572bb01 Remove group check in is_checkout 2017-03-25 09:57:44 -03: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
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
Ludovic Stephan
cadaf43131 Remove is_checkout field from Operation model 2017-03-24 18:50:57 -03:00
Ludovic Stephan
dd4d1f3061 Improves creation efficiency 2017-03-20 20:19:04 -03:00
Qwann
d0938dfae7 Merge branch 'k-fet' into qwann/k-fet/category_addcost 2017-03-11 15:10:04 +01:00
Qwann
ee6de35627 category addcost added 2017-03-10 18:29:15 +01: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
Qwann
1c90608f6d some cleaning 2017-02-15 14:21:00 +01:00
Ludovic Stephan
46e9e82da8 move account save 2017-02-13 12:19:47 -02: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
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
Qwann
de9387c6ad cleaning: PEP8, html, permissions 2016-12-24 12:34:11 +01:00
Aurélien Delobelle
db4ae73dfd Fix acc neg 2016-09-05 19:19:09 +02:00
Aurélien Delobelle
16fe7eb994 Ajout champ création sur modèle Account 2016-09-05 13:59:14 +02:00
Aurélien Delobelle
f538f27843 Création compte avec balance initiale
- Utile pour la migration des anciens comptes vers le nouveau système
- Fix JS page historique
2016-09-05 07:31:54 +02:00
Aurélien Delobelle
42f6144226 Fix reset cache lors d'un update settings 2016-09-03 18:07:43 +02:00
Aurélien Delobelle
6899476868 Fix calcul stock error inventaire 2016-09-03 18:04:00 +02:00
Aurélien Delobelle
a432230128 Fixs annulations
- Fix oublie de @staticmethod pour Settings.CANCEl_DURATION()
- Mise en cache de Settings.CANCEL_DURATION
- Fix sur cancel_operations : mauvais modèles et at
2016-09-03 13:50:40 +02:00
Aurélien Delobelle
f1444b2462 Changer le pwd d'un account 2016-09-01 16:31:18 +02:00
Aurélien Delobelle
94989b0ad2 Oubli compat Py2 req (encore) 2016-09-01 01:02:15 +02:00
Aurélien Delobelle
ba0a5d0d27 Py2 compatible 2016-09-01 00:45:44 +02:00
Aurélien Delobelle
3444426114 K-Psul - Edition
- Via "F8", possible de faire des charges sans modifier la caisse si
  l'utilisateur a la permission `kfet.edit_balance_account`. Un
commentaire est alors nécessaire sur la commande.
2016-08-31 01:36:58 +02:00
Aurélien Delobelle
9467103879 Inventaire depuis une commande
- Possible de générer un inventaire à partir d'une commande passée.
  Préremplissage avec les valeurs commandées.
- Possible d'indiquer les prix d'achat pour avoir l'historique des prix
  d'un article chez un fournisseur. Et bientôt, une proposition
  automatique de prix.
- L'erreur sur le stock d'un article lors d'un inventaire n'est pas mise
  à jour dans le cas où l'inventaire est généré à partir d'une commande.
- Ajout d'un champ `at` au modèle `SupplierArticle` afin de conserver
  l'historique des prix d'achat
- Fix sur la vue `order_create`
2016-08-30 15:35:30 +02:00
Aurélien Delobelle
61feb9bbcd Ajout livraison
- Possible de passer une livraison à un fournisseur
- Proposition de quantités générées à partir des ventes sur les 5
  dernières semaines
- Mail généré à partir d'une commande (pas d'envoi auto)
- box_capacity et box_type passe de SupplierArticle à Article
2016-08-28 05:39:34 +02:00