mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-22 02:18:21 +02:00
We store amounts in cents but users enter euros
This commit is contained in:
@ -1,10 +1,10 @@
|
||||
{% extends "base.html" %}
|
||||
{% load static %}
|
||||
{% load i18n %}
|
||||
{% load crispy_forms_tags %}
|
||||
{% load crispy_forms_tags pretty_money %}
|
||||
{% block content %}
|
||||
<p><a class="btn btn-default" href="{% url 'treasury:billing' %}">{% trans "Billings list" %}</a></p>
|
||||
<form method="post" action="" class="form-horizontal">
|
||||
<form method="post" action="">
|
||||
{% csrf_token %}
|
||||
{% crispy form %}
|
||||
{{ formset.management_form }}
|
||||
@ -21,7 +21,16 @@
|
||||
<tr class="row-formset">
|
||||
<td>{{ form.designation }}</td>
|
||||
<td>{{ form.quantity }} </td>
|
||||
<td>{{ form.amount }}</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input type="number" name="product_set-{{ forloop.counter0 }}-amount" min="0" step="0.01"
|
||||
id="id_product_set-{{ forloop.counter0 }}-amount"
|
||||
value="{{ form.instance.amount|cents_to_euros }}">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{{ form.billing }}
|
||||
{{ form.id }}
|
||||
</tr>
|
||||
@ -45,7 +54,15 @@
|
||||
<tr class="row-formset">
|
||||
<td>{{ formset.empty_form.designation }}</td>
|
||||
<td>{{ formset.empty_form.quantity }} </td>
|
||||
<td>{{ formset.empty_form.amount }}</td>
|
||||
<td>
|
||||
<div class="input-group">
|
||||
<input type="number" name="product_set-__prefix__-amount" min="0" step="0.01"
|
||||
id="id_product_set-__prefix__-amount">
|
||||
<div class="input-group-append">
|
||||
<span class="input-group-text">€</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
{{ formset.empty_form.billing }}
|
||||
{{ formset.empty_form.id }}
|
||||
</tr>
|
||||
|
Reference in New Issue
Block a user