Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Sith
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
42
Issues
42
List
Boards
Labels
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AE
Sith
Commits
f42daa01
Commit
f42daa01
authored
Oct 28, 2019
by
Sli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'add-account-amount' into 'master'
Add the account amount to the eboutic See merge request
!254
parents
42055b90
29ee1b05
Pipeline
#2128
passed with stage
in 33 minutes and 50 seconds
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
54 additions
and
8 deletions
+54
-8
eboutic/templates/eboutic/eboutic_main.jinja
eboutic/templates/eboutic/eboutic_main.jinja
+13
-1
eboutic/templates/eboutic/eboutic_makecommand.jinja
eboutic/templates/eboutic/eboutic_makecommand.jinja
+13
-1
eboutic/views.py
eboutic/views.py
+8
-0
locale/fr/LC_MESSAGES/django.po
locale/fr/LC_MESSAGES/django.po
+20
-6
No files found.
eboutic/templates/eboutic/eboutic_main.jinja
View file @
f42daa01
...
...
@@ -31,10 +31,22 @@
{{
add_product
(
i.product_id
,
'+'
)
}}
{{
i.product_name
}}
:
{{
"%0.2f"
|
format
(
i.product_unit_price
*
i.quantity
)
}}
€
</li>
{%
endfor
%}
</ul>
<p><strong>
{%
trans
%}
Total:
{%
endtrans
%}{{
"%0.2f"
|
format
(
basket.get_total
())
}}
€
</strong></p>
<p>
<strong>
{%
trans
%}
Basket amount:
{%
endtrans
%}{{
"%0.2f"
|
format
(
basket.get_total
())
}}
€
</strong>
{%
if
customer_amount
!=
None
%}
<br>
{%
trans
%}
Current account amount:
{%
endtrans
%}
<strong>
{{
"%0.2f"
|
format
(
customer_amount
)
}}
€
</strong>
<br>
{%
trans
%}
Remaining account amount:
{%
endtrans
%}
<strong>
{{
"%0.2f"
|
format
(
customer_amount
-
basket.get_total
())
}}
€
</strong>
{%
endif
%}
</p>
<form
method=
"post"
action=
"
{{
url
(
'eboutic:command'
)
}}
"
>
{%
csrf_token
%}
<p>
<input
type=
"submit"
value=
"
{%
trans
%}
Proceed to command
{%
endtrans
%}
"
/>
</p>
</form>
</div>
<div>
...
...
eboutic/templates/eboutic/eboutic_makecommand.jinja
View file @
f42daa01
...
...
@@ -27,13 +27,25 @@
{%
endfor
%}
<tbody>
</table>
<p><strong>
Total:
</strong>
{{
basket.get_total
()
}}
€
</p>
<p>
<strong>
{%
trans
%}
Basket amount:
{%
endtrans
%}{{
"%0.2f"
|
format
(
basket.get_total
())
}}
€
</strong>
{%
if
customer_amount
!=
None
%}
<br>
{%
trans
%}
Current account amount:
{%
endtrans
%}
<strong>
{{
"%0.2f"
|
format
(
customer_amount
)
}}
€
</strong>
<br>
{%
trans
%}
Remaining account amount:
{%
endtrans
%}
<strong>
{{
"%0.2f"
|
format
(
customer_amount
-
basket.get_total
())
}}
€
</strong>
{%
endif
%}
</p>
{%
if
settings.SITH_EBOUTIC_CB_ENABLED
%}
<form
method=
"post"
action=
"
{{
settings.SITH_EBOUTIC_ET_URL
}}
"
>
<p>
{%
for
(
field_name
,
field_value
)
in
et_request.items
()
-
%}
<input
type=
"hidden"
name=
"
{{
field_name
}}
"
value=
"
{{
field_value
}}
"
>
{%
endfor
%}
<input
type=
"submit"
value=
"
{%
trans
%}
Pay with credit card
{%
endtrans
%}
"
/>
</p>
</form>
{%
endif
%}
{%
if
basket.items.
filter
(
type_id
=
settings.SITH_COUNTER_PRODUCTTYPE_REFILLING
)
.
exists
()
%}
...
...
eboutic/views.py
View file @
f42daa01
...
...
@@ -107,6 +107,10 @@ class EbouticMain(TemplateView):
kwargs
[
"basket"
]
=
self
.
basket
kwargs
[
"eboutic"
]
=
Counter
.
objects
.
filter
(
type
=
"EBOUTIC"
)
.
first
()
kwargs
[
"categories"
]
=
ProductType
.
objects
.
all
()
if
hasattr
(
self
.
request
.
user
,
"customer"
):
kwargs
[
"customer_amount"
]
=
self
.
request
.
user
.
customer
.
amount
else
:
kwargs
[
"customer_amount"
]
=
None
if
not
self
.
request
.
user
.
was_subscribed
:
kwargs
[
"categories"
]
=
kwargs
[
"categories"
]
.
exclude
(
id
=
settings
.
SITH_PRODUCTTYPE_SUBSCRIPTION
...
...
@@ -150,6 +154,10 @@ class EbouticCommand(TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
kwargs
=
super
(
EbouticCommand
,
self
)
.
get_context_data
(
**
kwargs
)
if
hasattr
(
self
.
request
.
user
,
"customer"
):
kwargs
[
"customer_amount"
]
=
self
.
request
.
user
.
customer
.
amount
else
:
kwargs
[
"customer_amount"
]
=
None
kwargs
[
"et_request"
]
=
OrderedDict
()
kwargs
[
"et_request"
][
"PBX_SITE"
]
=
settings
.
SITH_EBOUTIC_PBX_SITE
kwargs
[
"et_request"
][
"PBX_RANG"
]
=
settings
.
SITH_EBOUTIC_PBX_RANG
...
...
locale/fr/LC_MESSAGES/django.po
View file @
f42daa01
...
...
@@ -6,7 +6,7 @@
msgid
""
msgstr
""
"Report-Msgid-Bugs-To:
\n
"
"POT-Creation-Date: 2019-10-21
10:28
+0200
\n
"
"POT-Creation-Date: 2019-10-21
22:04
+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
"
...
...
@@ -733,7 +733,6 @@ msgstr "Nature de l'opération"
#: club/templates/club/club_sellings.jinja:14
#: counter/templates/counter/counter_click.jinja:90
#: counter/templates/counter/counter_main.jinja:28
#: eboutic/templates/eboutic/eboutic_main.jinja:34
msgid
"Total: "
msgstr
"Total : "
...
...
@@ -4320,7 +4319,22 @@ msgstr "id du type du produit"
msgid
"basket"
msgstr
"panier"
#: eboutic/templates/eboutic/eboutic_main.jinja:35
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:31
msgid
"Basket amount: "
msgstr
"Valeur du panier : "
#: eboutic/templates/eboutic/eboutic_main.jinja:37
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:33
msgid
"Current account amount: "
msgstr
"Solde actuel : "
#: eboutic/templates/eboutic/eboutic_main.jinja:39
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:35
msgid
"Remaining account amount: "
msgstr
"Solde restant : "
#: eboutic/templates/eboutic/eboutic_main.jinja:45
msgid
"Proceed to command"
msgstr
"Procéder à la commande"
...
...
@@ -4328,18 +4342,18 @@ msgstr "Procéder à la commande"
msgid
"Basket state"
msgstr
"État du panier"
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:
36
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:
42
msgid
"Pay with credit card"
msgstr
"Payer avec une carte bancaire"
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:4
0
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:4
6
msgid
""
"AE account payment disabled because your basket contains refilling items."
msgstr
""
"Paiement par compte AE désactivé parce que votre panier contient des bons de "
"rechargement."
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:
45
#: eboutic/templates/eboutic/eboutic_makecommand.jinja:
51
msgid
"Pay with Sith account"
msgstr
"Payer avec un compte AE"
...
...
@@ -4355,7 +4369,7 @@ msgstr "Le paiement a été effectué"
msgid
"Return to eboutic"
msgstr
"Retourner à l'eboutic"
#: eboutic/views.py:21
7
#: eboutic/views.py:21
9
msgid
"You do not have enough money to buy the basket"
msgstr
"Vous n'avez pas assez d'argent pour acheter le panier"
...
...
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