Ajout historique d'un compte

- Création d'un style général pour les historiques
- Reprise de l'affichage historique K-Psul
This commit is contained in:
Aurélien Delobelle 2016-08-20 17:18:41 +02:00
parent 50ed08dd72
commit ee583c3cfb
9 changed files with 239 additions and 100 deletions

View file

@ -7,6 +7,7 @@ from gestioncof.models import CofProfile
from django.utils.six.moves import reduce
from django.utils import timezone
from django.db import transaction
from django.core.cache import cache
from datetime import date, timedelta
import re
@ -415,10 +416,10 @@ class Transfer(models.Model):
class OperationGroup(models.Model):
on_acc = models.ForeignKey(
Account, on_delete = models.PROTECT,
related_name = "operations")
related_name = "opesgroup")
checkout = models.ForeignKey(
Checkout, on_delete = models.PROTECT,
related_name = "operations")
related_name = "opesgroup")
at = models.DateTimeField(auto_now_add = True)
amount = models.DecimalField(
max_digits = 6, decimal_places = 2,
@ -446,7 +447,7 @@ class Operation(models.Model):
group = models.ForeignKey(
OperationGroup, on_delete = models.PROTECT,
related_name = "+")
related_name = "opes")
type = models.CharField(
choices = TYPE_ORDER_CHOICES,
max_length = choices_length(TYPE_ORDER_CHOICES))
@ -507,10 +508,15 @@ class Settings(models.Model):
@staticmethod
def SUBVENTION_COF():
subvention_cof = cache.get('SUBVENTION_COF')
if subvention_cof:
return subvention_cof
try:
return Settings.setting_inst("SUBVENTION_COF").value_decimal
subvention_cof = Settings.setting_inst("SUBVENTION_COF").value_decimal
except Settings.DoesNotExist:
return 0
subvention_cof = 0
cache.set('SUBVENTION_COF', subvention_cof)
return subvention_cof
@staticmethod
def ADDCOST_AMOUNT():