Skip to content

Commit

Permalink
Made it possible to reteroactively mark/unmark a recipt as digital (#219
Browse files Browse the repository at this point in the history
)

Co-authored-by: alfredfl <alfredfl@kth.se>
  • Loading branch information
MrAlLind and alfredfl authored Jan 23, 2025
1 parent b25ddb5 commit 2db7892
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions expenses/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def edit_expense(request, pk):

expense.description = request.POST['description']
expense.expense_date = request.POST['expense_date']
expense.is_digital = 'is-digital' in request.POST
expense.save()

new_ids = []
Expand Down
18 changes: 18 additions & 0 deletions templates/expenses/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,24 @@
<input type="date" model="expense_part.amount" value="{{ expense.expense_date|date:"c" }}" name="expense_date" required/>
</div>
</div>
<div class="form-entry">
<span class="description">
<label for="is-digital">
Digitalt:
</label>
<span class="hint"></span>
</span>
<div class="input">
<input
type="checkbox"
name="is-digital"
id="is-digital"
{% if expense.is_digital %} checked {% endif %}
style="margin-top: 0.7em; width: 1.4em; height: 1.4em;"
>
</div>
<p>Klicka i denna om originalformatet av kvittot är digitalt.</p>
</div>
</div>
<div class="clear"></div>
<h2>Kvittodelar</h2>
Expand Down

0 comments on commit 2db7892

Please sign in to comment.