mirror of
https://github.com/ae-utbm/sith.git
synced 2025-07-10 11:59:23 +00:00
Add basic close journal functions
This commit is contained in:
@ -11,16 +11,41 @@
|
||||
<li>{{ k }} - {{ v }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">New journal</a></p>
|
||||
<ul>
|
||||
{% if not object.has_open_journal() %}
|
||||
<p><a href="{{ url('accounting:journal_new') }}?parent={{ object.id }}">New journal</a></p>
|
||||
{% else %}
|
||||
<p>You can not create new journal while you still have one opened</p>
|
||||
{% endif %}
|
||||
<table>
|
||||
<tr>
|
||||
<td>Name</td>
|
||||
<td>Start</td>
|
||||
<td>End</td>
|
||||
<td>Amount</td>
|
||||
<td>Effective amount</td>
|
||||
<td>Closed</td>
|
||||
</tr>
|
||||
{% for j in object.journals.all() %}
|
||||
<li>
|
||||
<a href="{{ url('accounting:journal_details', j_id=j.id) }}">{{ j }}</a> -
|
||||
<a href="{{ url('accounting:journal_edit', j_id=j.id) }}">Edit</a>
|
||||
|
||||
</li>
|
||||
<tr>
|
||||
<td>{{ j.name }}</td>
|
||||
<td>{{ j.start_date }}</td>
|
||||
{% if j.end_date %}
|
||||
<td>{{ j.end_date }}</td>
|
||||
{% else %}
|
||||
<td> - </td>
|
||||
{% endif %}
|
||||
<td>{{ j.amount }} €</td>
|
||||
<td>{{ j.effective_amount }} €</td>
|
||||
{% if j.closed %}
|
||||
<td>Yes</td>
|
||||
{% else %}
|
||||
<td>No</td>
|
||||
{% endif %}
|
||||
<td> <a href="{{ url('accounting:journal_details', j_id=j.id) }}">View</a>
|
||||
<a href="{{ url('accounting:journal_edit', j_id=j.id) }}">Edit</a> </td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</table>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
@ -8,7 +8,11 @@
|
||||
{{ object.name }}
|
||||
</p>
|
||||
<p><strong>Amount: </strong>{{ object.amount }} € - <strong>Effective amount: </strong>{{ object.effective_amount }} €</p>
|
||||
{% if object.closed %}
|
||||
<p>Journal is closed, you can not create operation</p>
|
||||
{% else %}
|
||||
<p><a href="{{ url('accounting:op_new') }}?parent={{ object.id }}">New operation</a></p>
|
||||
{% endif %}
|
||||
<table>
|
||||
<tr>
|
||||
<td>Nb</td>
|
||||
@ -16,7 +20,7 @@
|
||||
<td>Label</td>
|
||||
<td>Amount</td>
|
||||
<td>Payment mode</td>
|
||||
<!-- <td>Target</td> -->
|
||||
<!-- TODO: <td>Target</td> -->
|
||||
<td>Code</td>
|
||||
<td>Nature</td>
|
||||
<td>Done</td>
|
||||
@ -38,7 +42,11 @@
|
||||
<td>No</td>
|
||||
{% endif %}
|
||||
<td>{{ o.remark }}</td>
|
||||
<td><a href="{{ url('accounting:op_edit', op_id=o.id) }}">Edit</a></td>
|
||||
<td>
|
||||
{% if not o.journal.closed %}
|
||||
<a href="{{ url('accounting:op_edit', op_id=o.id) }}">Edit</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
Reference in New Issue
Block a user