Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
Re2o
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levy--Falk Hugo
Re2o
Commits
5c8e90fd
Commit
5c8e90fd
authored
Oct 02, 2018
by
Maxime Bombar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[cotisations] Replace Float by Decimal everywhere
parent
f6dc63aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
forms.py
cotisations/forms.py
+1
-1
models.py
cotisations/models.py
+1
-1
models.py
cotisations/payment_methods/balance/models.py
+2
-2
No files found.
cotisations/forms.py
View file @
5c8e90fd
...
@@ -233,7 +233,7 @@ class RechargeForm(FormRevMixin, Form):
...
@@ -233,7 +233,7 @@ class RechargeForm(FormRevMixin, Form):
"""
"""
Form used to refill a user's balance
Form used to refill a user's balance
"""
"""
value
=
forms
.
Float
Field
(
value
=
forms
.
Decimal
Field
(
label
=
_
(
"Amount"
),
label
=
_
(
"Amount"
),
min_value
=
0.01
,
min_value
=
0.01
,
validators
=
[]
validators
=
[]
...
...
cotisations/models.py
View file @
5c8e90fd
...
@@ -83,7 +83,7 @@ class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
...
@@ -83,7 +83,7 @@ class BaseInvoice(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model):
)
.
aggregate
(
)
.
aggregate
(
total
=
models
.
Sum
(
total
=
models
.
Sum
(
models
.
F
(
'prix'
)
*
models
.
F
(
'number'
),
models
.
F
(
'prix'
)
*
models
.
F
(
'number'
),
output_field
=
models
.
Float
Field
()
output_field
=
models
.
Decimal
Field
()
)
)
)[
'total'
]
or
0
)[
'total'
]
or
0
...
...
cotisations/payment_methods/balance/models.py
View file @
5c8e90fd
...
@@ -73,7 +73,7 @@ class BalancePayment(PaymentMethodMixin, models.Model):
...
@@ -73,7 +73,7 @@ class BalancePayment(PaymentMethodMixin, models.Model):
"""
"""
user
=
invoice
.
user
user
=
invoice
.
user
total_price
=
invoice
.
prix_total
()
total_price
=
invoice
.
prix_total
()
if
float
(
user
.
solde
)
-
float
(
total_price
)
<
self
.
minimum_balance
:
if
user
.
solde
-
total_price
<
self
.
minimum_balance
:
messages
.
error
(
messages
.
error
(
request
,
request
,
_
(
"Your balance is too low for this operation."
)
_
(
"Your balance is too low for this operation."
)
...
@@ -106,7 +106,7 @@ class BalancePayment(PaymentMethodMixin, models.Model):
...
@@ -106,7 +106,7 @@ class BalancePayment(PaymentMethodMixin, models.Model):
balance.
balance.
"""
"""
return
(
return
(
float
(
user
.
solde
)
-
float
(
price
)
>=
self
.
minimum_balance
,
user
.
solde
-
price
>=
self
.
minimum_balance
,
_
(
"Your balance is too low for this operation."
)
_
(
"Your balance is too low for this operation."
)
)
)
...
...
Write
Preview
Markdown
is supported
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