Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
ecf54657
Commit
ecf54657
authored
Jun 12, 2017
by
Skia
🤘
Browse files
Merge branch 'Tresorerie'
parents
88d81df2
8ba21b94
Pipeline
#1055
failed with stage
in 4 minutes and 30 seconds
Changes
3
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
accounting/models.py
View file @
ecf54657
...
...
@@ -282,7 +282,9 @@ class Operation(models.Model):
def
clean
(
self
):
super
(
Operation
,
self
).
clean
()
if
self
.
date
<
self
.
journal
.
start_date
:
if
self
.
date
is
None
:
raise
ValidationError
(
_
(
"The date must be set."
))
elif
self
.
date
<
self
.
journal
.
start_date
:
raise
ValidationError
(
_
(
"""The date can not be before the start date of the journal, which is
%(start_date)s."""
)
%
{
'start_date'
:
defaultfilters
.
date
(
self
.
journal
.
start_date
,
settings
.
DATE_FORMAT
)})
if
self
.
target_type
!=
"OTHER"
and
self
.
get_target
()
is
None
:
...
...
accounting/views.py
View file @
ecf54657
...
...
@@ -28,7 +28,7 @@ from django.shortcuts import render
from
django.core.urlresolvers
import
reverse_lazy
,
reverse
from
django.utils.translation
import
ugettext_lazy
as
_
from
django.forms.models
import
modelform_factory
from
django.core.exceptions
import
PermissionDenied
from
django.core.exceptions
import
PermissionDenied
,
ValidationError
from
django.forms
import
HiddenInput
,
TextInput
from
django.db
import
transaction
from
django.db.models
import
Sum
...
...
@@ -305,14 +305,21 @@ class OperationForm(forms.ModelForm):
def
clean
(
self
):
self
.
cleaned_data
=
super
(
OperationForm
,
self
).
clean
()
if
'target_type'
in
self
.
cleaned_data
.
keys
():
if
self
.
cleaned_data
[
'target_type'
]
==
"USER"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'user'
].
id
elif
self
.
cleaned_data
[
'target_type'
]
==
"ACCOUNT"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'club_account'
].
id
elif
self
.
cleaned_data
[
'target_type'
]
==
"CLUB"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'club'
].
id
elif
self
.
cleaned_data
[
'target_type'
]
==
"COMPANY"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'company'
].
id
if
self
.
cleaned_data
.
get
(
"user"
)
is
None
or
self
.
cleaned_data
.
get
(
"club"
)
or
self
.
cleaned_data
.
get
(
"club_account"
)
is
None
or
self
.
cleaned_data
.
get
(
"company"
)
is
None
or
self
.
cleaned_data
.
get
(
"other"
):
self
.
add_error
(
'target_id'
,
ValidationError
(
_
(
"The target must be set."
)))
else
:
if
self
.
cleaned_data
[
'target_type'
]
==
"USER"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'user'
].
id
elif
self
.
cleaned_data
[
'target_type'
]
==
"ACCOUNT"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'club_account'
].
id
elif
self
.
cleaned_data
[
'target_type'
]
==
"CLUB"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'club'
].
id
elif
self
.
cleaned_data
[
'target_type'
]
==
"COMPANY"
:
self
.
cleaned_data
[
'target_id'
]
=
self
.
cleaned_data
[
'company'
].
id
if
self
.
cleaned_data
.
get
(
"amount"
)
is
None
:
self
.
add_error
(
'amount'
,
ValidationError
(
_
(
"The amount must be set."
)))
return
self
.
cleaned_data
def
save
(
self
):
...
...
locale/fr/LC_MESSAGES/django.po
View file @
ecf54657
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2017-06-1
0 19:56
+0200
\n
"
"POT-Creation-Date: 2017-06-1
2 08:12
+0200
\n
"
"PO-Revision-Date: 2016-07-18
\n
"
"Last-Translator: Skia <skia@libskia.so>
\n
"
"Language-Team: AE info <ae.info@utbm.fr>
\n
"
...
...
@@ -102,7 +102,7 @@ msgstr "date de fin"
msgid
"is closed"
msgstr
"est fermé"
#: accounting/models.py:196 accounting/models.py:41
4
#: accounting/models.py:196 accounting/models.py:41
6
msgid
"club account"
msgstr
"compte club"
...
...
@@ -159,12 +159,12 @@ msgstr "est fait"
msgid
"simple type"
msgstr
"type simplifié"
#: accounting/models.py:263 accounting/models.py:3
69
#: accounting/models.py:263 accounting/models.py:3
71
msgid
"accounting type"
msgstr
"type comptable"
#: accounting/models.py:265 accounting/models.py:36
4
accounting/models.py:39
0
#: accounting/models.py:41
3
counter/models.py:316
#: accounting/models.py:265 accounting/models.py:36
6
accounting/models.py:39
2
#: accounting/models.py:41
5
counter/models.py:316
msgid
"label"
msgstr
"étiquette"
...
...
@@ -218,6 +218,10 @@ msgid "linked operation"
msgstr
"opération liée"
#: accounting/models.py:286
msgid
"The date must be set."
msgstr
"La date doit être indiquée."
#: accounting/models.py:288
#, python-format
msgid
""
"The date can not be before the start date of the journal, which is
\n
"
...
...
@@ -226,16 +230,16 @@ msgstr ""
"La date ne peut pas être avant la date de début du journal, qui est
\n
"
"%(start_date)s."
#: accounting/models.py:2
8
9
#: accounting/models.py:29
1
msgid
"Target does not exists"
msgstr
"La cible n'existe pas."
#: accounting/models.py:29
1
#: accounting/models.py:29
3
msgid
"Please add a target label if you set no existing target"
msgstr
""
"Merci d'ajouter un nom de cible si vous ne spécifiez pas de cible existante"
#: accounting/models.py:29
3
#: accounting/models.py:29
5
msgid
""
"You need to provide ether a simplified accounting type or a standard "
"accounting type"
...
...
@@ -243,41 +247,41 @@ msgstr ""
"Vous devez fournir soit un type comptable simplifié ou un type comptable "
"standard"
#: accounting/models.py:3
59
counter/models.py:129
#: accounting/models.py:3
61
counter/models.py:129
msgid
"code"
msgstr
"code"
#: accounting/models.py:36
1
#: accounting/models.py:36
3
msgid
"An accounting type code contains only numbers"
msgstr
"Un code comptable ne contient que des numéros"
#: accounting/models.py:36
5
#: accounting/models.py:36
7
msgid
"movement type"
msgstr
"type de mouvement"
#: accounting/models.py:36
5
#: accounting/models.py:36
7
#: accounting/templates/accounting/journal_statement_nature.jinja:8
#: accounting/templates/accounting/journal_statement_person.jinja:11
#: accounting/views.py:4
5
6
#: accounting/views.py:46
3
msgid
"Credit"
msgstr
"Crédit"
#: accounting/models.py:36
5
#: accounting/models.py:36
7
#: accounting/templates/accounting/journal_statement_nature.jinja:27
#: accounting/templates/accounting/journal_statement_person.jinja:39
#: accounting/views.py:4
5
6
#: accounting/views.py:46
3
msgid
"Debit"
msgstr
"Débit"
#: accounting/models.py:36
6
#: accounting/models.py:36
8
msgid
"Neutral"
msgstr
"Neutre"
#: accounting/models.py:39
2
#: accounting/models.py:39
4
msgid
"simplified accounting types"
msgstr
"type simplifié"
#: accounting/models.py:39
5
#: accounting/models.py:39
7
msgid
"simplified type"
msgstr
"type simplifié"
...
...
@@ -337,12 +341,11 @@ msgstr "Compte en banque : "
#: election/templates/election/election_detail.jinja:280
#: election/templates/election/election_detail.jinja:330
#: election/templates/election/election_detail.jinja:378
#: forum/templates/forum/macros.jinja:21
#: forum/templates/forum/macros.jinja:123
#: forum/templates/forum/macros.jinja:21 forum/templates/forum/macros.jinja:123
#: launderette/templates/launderette/launderette_admin.jinja:16
#: launderette/views.py:178 sas/templates/sas/album.jinja:26
#: sas/templates/sas/moderation.jinja:18 sas/templates/sas/picture.jinja:74
#: sas/templates/sas/picture.jinja:124
#: sas/templates/sas/picture.jinja
.py
:124
#: stock/templates/stock/stock_shopping_list.jinja:43
#: stock/templates/stock/stock_shopping_list.jinja:69
#: trombi/templates/trombi/detail.jinja:28
...
...
@@ -493,8 +496,8 @@ msgstr "Non"
#: accounting/templates/accounting/club_account_details.jinja:56
#: com/templates/com/news_admin_list.jinja:38
#: com/templates/com/news_admin_list.jinja:71
#:
core/templates/core/file.jinja:36
core/templates/core/page.jinja:28
#: com/templates/com/news_admin_list.jinja:71
core/templates/core/file.jinja:36
#: core/templates/core/page.jinja:28
msgid
"View"
msgstr
"Voir"
...
...
@@ -707,7 +710,7 @@ msgstr "Sauver"
#: accounting/templates/accounting/refound_account.jinja:4
#: accounting/templates/accounting/refound_account.jinja:8
#: accounting/views.py:7
19
#: accounting/views.py:7
26
msgid
"Refound account"
msgstr
"Remboursement de compte"
...
...
@@ -728,7 +731,7 @@ msgstr "Types simplifiés"
msgid
"New simplified type"
msgstr
"Nouveau type simplifié"
#: accounting/views.py:196 accounting/views.py:203 accounting/views.py:4
39
#: accounting/views.py:196 accounting/views.py:203 accounting/views.py:4
46
msgid
"Journal"
msgstr
"Classeur"
...
...
@@ -744,59 +747,67 @@ msgstr "Bilan par personne"
msgid
"Accounting statement"
msgstr
"Bilan comptable"
#: accounting/views.py:433 accounting/views.py:439
#: accounting/views.py:309
msgid
"The target must be set."
msgstr
"La cible doit être indiquée."
#: accounting/views.py:321
msgid
"The amount must be set."
msgstr
"Le montant doit être indiqué."
#: accounting/views.py:440 accounting/views.py:446
msgid
"Operation"
msgstr
"Opération"
#: accounting/views.py:4
49
#: accounting/views.py:4
56
msgid
"Financial proof: "
msgstr
"Justificatif de libellé : "
#: accounting/views.py:45
0
#: accounting/views.py:45
7
#, python-format
msgid
"Club: %(club_name)s"
msgstr
"Club : %(club_name)s"
#: accounting/views.py:45
1
#: accounting/views.py:45
8
#, python-format
msgid
"Label: %(op_label)s"
msgstr
"Libellé : %(op_label)s"
#: accounting/views.py:45
2
#: accounting/views.py:45
9
#, python-format
msgid
"Date: %(date)s"
msgstr
"Date : %(date)s"
#: accounting/views.py:45
8
#: accounting/views.py:4
6
5
#, python-format
msgid
"Amount: %(amount).2f €"
msgstr
"Montant : %(amount).2f €"
#: accounting/views.py:47
0
#: accounting/views.py:47
7
msgid
"Debtor"
msgstr
"Débiteur"
#: accounting/views.py:47
0
#: accounting/views.py:47
7
msgid
"Creditor"
msgstr
"Créditeur"
#: accounting/views.py:47
2
#: accounting/views.py:47
9
msgid
"Comment:"
msgstr
"Commentaire :"
#: accounting/views.py:49
1
#: accounting/views.py:49
8
msgid
"Signature:"
msgstr
"Signature :"
#: accounting/views.py:5
4
5
#: accounting/views.py:55
2
msgid
"General statement"
msgstr
"Bilan général"
#: accounting/views.py:5
48
#: accounting/views.py:5
55
msgid
"No label operations"
msgstr
"Opérations sans étiquette"
#: accounting/views.py:68
1
#: accounting/views.py:68
8
msgid
"Refound this account"
msgstr
"Rembourser ce compte"
...
...
@@ -861,8 +872,7 @@ msgstr "L'utilisateur est déjà membre de ce club"
msgid
"past member"
msgstr
"Anciens membres"
#: club/templates/club/club_list.jinja:4
#: club/templates/club/club_list.jinja:24
#: club/templates/club/club_list.jinja:4 club/templates/club/club_list.jinja:24
msgid
"Club list"
msgstr
"Liste des clubs"
...
...
@@ -924,14 +934,13 @@ msgstr "Du"
msgid
"To"
msgstr
"Au"
#: club/templates/club/club_sellings.jinja:5 club/views.py:84
#:
club/views.py:247
counter/templates/counter/counter_main.jinja:19
#: club/templates/club/club_sellings.jinja:5 club/views.py:84
club/views.py:247
#: counter/templates/counter/counter_main.jinja:19
#: counter/templates/counter/last_ops.jinja:35
msgid
"Sellings"
msgstr
"Ventes"
#: club/templates/club/club_sellings.jinja:9
#: club/templates/club/stats.jinja:19
#: club/templates/club/club_sellings.jinja:9 club/templates/club/stats.jinja:19
#: counter/templates/counter/cash_summary_list.jinja:15
msgid
"Show"
msgstr
"Montrer"
...
...
@@ -1191,9 +1200,8 @@ msgid "News admin"
msgstr
"Administration des nouvelles"
#: com/templates/com/news_admin_list.jinja:9
#: com/templates/com/news_detail.jinja:5
#: com/templates/com/news_detail.jinja:11 com/templates/com/news_list.jinja:4
#: com/templates/com/news_list.jinja:28
#: com/templates/com/news_detail.jinja:5 com/templates/com/news_detail.jinja:11
#: com/templates/com/news_list.jinja:4 com/templates/com/news_list.jinja:28
msgid
"News"
msgstr
"Nouvelles"
...
...
@@ -1880,8 +1888,7 @@ msgstr "S'enregister"
msgid
"View more"
msgstr
"Voir plus"
#: core/templates/core/base.jinja:62
#: forum/templates/forum/last_unread.jinja:16
#: core/templates/core/base.jinja:62 forum/templates/forum/last_unread.jinja:16
msgid
"Mark all as read"
msgstr
"Marquer tout commme lu"
...
...
@@ -1913,7 +1920,7 @@ msgstr "SAS"
#: core/templates/core/base.jinja:94 forum/templates/forum/forum.jinja:10
#: forum/templates/forum/last_unread.jinja:13
#: forum/templates/forum/main.jinja:6 forum/templates/forum/main.jinja:11
#: forum/templates/forum/main.jinja:6 forum/templates/forum/main.jinja
.py
:11
#: forum/templates/forum/main.jinja:14 forum/templates/forum/reply.jinja:15
#: forum/templates/forum/topic.jinja:30
msgid
"Forum"
...
...
@@ -2163,13 +2170,11 @@ msgstr "login"
msgid
"Lost password?"
msgstr
"Mot de passe perdu ?"
#: core/templates/core/macros.jinja:31
#: core/templates/core/user_detail.jinja:27
#: core/templates/core/macros.jinja:31 core/templates/core/user_detail.jinja:27
msgid
"Born: "
msgstr
"Né le : "
#: core/templates/core/macros.jinja:35
#: core/templates/core/user_detail.jinja:48
#: core/templates/core/macros.jinja:35 core/templates/core/user_detail.jinja:48
msgid
"Promo: "
msgstr
"Promo : "
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment