BudgetingApp/app/templates/split_line.html
2024-12-25 21:20:27 +02:00

72 lines
No EOL
3.2 KiB
HTML

{% extends 'base.html' %}
{% block title %}Split Line{% endblock title %}
{% block content %}
<main>
<div class="container mt-5">
<div class="card">
<div class="card-header bg-primary text-white">
Split Line
</div>
<!-- Display Details Section -->
<div class="card-body">
<h5 class="card-title">Details</h5>
<div class="table-responsive">
<table class="table table-borderless">
<tbody>
<tr>
<th scope="row">Total Amount:</th>
<td>{{ li.amount }}</td>
</tr>
<tr>
<th scope="row">Vendor:</th>
<td>{{ li.get_vendor().name }}</td>
</tr>
<tr>
<th scope="row">Date:</th>
<td>{{ li.display_date() }}</td>
</tr>
<tr>
<th><a class="btn btn-primary" href="{{url_for('import_file_selector', line_item_id=li.id)}}">Import File</a></th>
</tr>
</tbody>
</table>
</div>
</div>
<div class="card-body">
<form action="{{ url_for('split_line_endpoint') }}" method="POST">
<div class="table-responsive">
<table class="table table-bordered">
<input type="hidden" name="parent-id" value="{{li.id}}"/>
<input type="hidden" name="date" value="{{li.date}}"/>
<tbody id="table-body">
{% if existing_child_lines %}
<tr>
<th>Amount</th>
<th>Vendor</th>
<th>Confirmation Code</th>
<th>Note</th>
</tr>
{% for line in existing_child_lines %}
<tr>
<td>{{line.amount}}</td>
<td>{{line.get_vendor()}}</td>
<td>{{line.confirmation_code}}</td>
<td>{{line.note}}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</div>
<button type="button" class="btn btn-primary" id="add-line-button">Add Another Line?</button>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
<script src="{{url_for('.static', filename='split_line.js')}}"></script>
</main>
{% endblock content %}