From 44d9e8d8edc43629258c7580be0e4201e69a7de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Mon, 22 Aug 2016 17:57:08 +0200 Subject: [PATCH] Affichage majoration sur les historiques --- kfet/static/kfet/css/history.css | 4 ++++ kfet/templates/kfet/account_read.html | 5 +++++ kfet/templates/kfet/kpsul.html | 6 +++++- kfet/views.py | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/kfet/static/kfet/css/history.css b/kfet/static/kfet/css/history.css index 6e0d1585..dbd36a92 100644 --- a/kfet/static/kfet/css/history.css +++ b/kfet/static/kfet/css/history.css @@ -66,6 +66,10 @@ padding-left:15px; } +#history .ope .addcost { + padding-left:20px; +} + #history .ope .canceled { padding-left:20px; } diff --git a/kfet/templates/kfet/account_read.html b/kfet/templates/kfet/account_read.html index fca732fc..2c9537ba 100644 --- a/kfet/templates/kfet/account_read.html +++ b/kfet/templates/kfet/account_read.html @@ -68,6 +68,11 @@ {% if ope.type == "deposit" %}Charge{% else %}Retrait{% endif %} {% endif %} + {% if ope.addcost_for %} + + {{ ope.addcost_amount|ukf:ope.group.is_cof }}UKF pour {{ ope.addcost_for.trigramme }} + + {% endif %} {% if ope.canceled_at %} {% if perms.kfet.is_team and ope.canceled_by %} diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index 26312ea9..342f3fa7 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -946,7 +946,7 @@ $(document).ready(function() { var history_container = $('#history'); var history_operationgroup_html = '
'; - var history_operation_html = '
'; + var history_operation_html = '
'; function getOpeHtml(ope, is_cof=false, trigramme='') { var ope_html = $(history_operation_html); @@ -974,6 +974,10 @@ $(document).ready(function() { .find('.infos1').text(infos1).end() .find('.infos2').text(infos2).end(); + if (ope['addcost_for__trigramme']) { + ope_html.find('.addcost').text('('+amountToUKF(ope['addcost_amount'],is_cof)+'UKF pour '+ope['addcost_for__trigramme']+')') + } + if (ope['canceled_at']) { ope_html.addClass('canceled'); if (ope['canceled_by__trigramme']) { diff --git a/kfet/views.py b/kfet/views.py index 7e5f38d3..68d4bb13 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -713,7 +713,7 @@ def kpsul_perform_operations(request): ope_data = { 'id': operation.pk, 'type': operation.type, 'amount': operation.amount, 'addcost_amount': operation.addcost_amount, - 'addcost_for': is_addcost and addcost_for.trigramme or None, + 'addcost_for__trigramme': is_addcost and addcost_for.trigramme or None, 'is_checkout': operation.is_checkout, 'article__name': operation.article and operation.article.name or None, 'article_nb': operation.article_nb,