Commit b057dbfd authored by tleb's avatar tleb

Initial add account amount in eboutic

parent 6d0eba6b
......@@ -31,10 +31,19 @@
{{ 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>
<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>
</p>
<form method="post" action="{{ url('eboutic:command') }}">
{% csrf_token %}
<p>
<input type="submit" value="{% trans %}Proceed to command{% endtrans %}" />
</p>
</form>
</div>
<div>
......
......@@ -27,7 +27,13 @@
{% endfor %}
<tbody>
</table>
<p><strong>Total: </strong>{{ basket.get_total() }}</p>
<p>
<strong>{% trans %}Basket amount: {% endtrans %}{{ "%0.2f"|format(basket.get_total()) }}</strong>
<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>
</p>
{% if settings.SITH_EBOUTIC_CB_ENABLED %}
<form method="post" action="{{ settings.SITH_EBOUTIC_ET_URL }}">
{% for (field_name,field_value) in et_request.items() -%}
......
......@@ -107,6 +107,7 @@ class EbouticMain(TemplateView):
kwargs["basket"] = self.basket
kwargs["eboutic"] = Counter.objects.filter(type="EBOUTIC").first()
kwargs["categories"] = ProductType.objects.all()
kwargs["customer_amount"] = self.request.user.customer.amount
if not self.request.user.was_subscribed:
kwargs["categories"] = kwargs["categories"].exclude(
id=settings.SITH_PRODUCTTYPE_SUBSCRIPTION
......@@ -150,6 +151,7 @@ class EbouticCommand(TemplateView):
def get_context_data(self, **kwargs):
kwargs = super(EbouticCommand, self).get_context_data(**kwargs)
kwargs["customer_amount"] = self.request.user.customer.amount
kwargs["et_request"] = OrderedDict()
kwargs["et_request"]["PBX_SITE"] = settings.SITH_EBOUTIC_PBX_SITE
kwargs["et_request"]["PBX_RANG"] = settings.SITH_EBOUTIC_PBX_RANG
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment