Finished months balance except the below tables
This commit is contained in:
@@ -191,15 +191,184 @@
|
||||
.readonly-field {
|
||||
background-color: #e9ecef;
|
||||
color: #6c757d;
|
||||
}
|
||||
/* ---- 6-month overview card ---- */
|
||||
.overview-card {
|
||||
background-color: #ffffff;
|
||||
padding: 16px 20px;
|
||||
margin: 20px 0;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.overview-header {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
align-items: flex-end;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.overview-header label {
|
||||
font-size: 0.9rem;
|
||||
color: #555;
|
||||
}
|
||||
|
||||
.overview-header select {
|
||||
padding: 6px 8px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #ccc;
|
||||
}
|
||||
|
||||
.overview-header button {
|
||||
padding: 7px 14px;
|
||||
border-radius: 4px;
|
||||
border: none;
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.overview-header button:hover {
|
||||
background-color: #0056b3;
|
||||
}
|
||||
|
||||
.overview-title {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8px;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.overview-subtitle {
|
||||
font-size: 0.9rem;
|
||||
color: #555;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.overview-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.overview-table th,
|
||||
.overview-table td {
|
||||
padding: 6px 8px;
|
||||
border-bottom: 1px solid #eee;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.overview-table thead th {
|
||||
background-color: #007bff;
|
||||
color: #fff;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.overview-table thead th:first-child {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.overview-table tbody tr:hover {
|
||||
background-color: #f8f9ff;
|
||||
}
|
||||
|
||||
.overview-table .number-cell {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.overview-table .summary-row {
|
||||
background-color: #f0f4ff;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<!-- This link should ONLY wrap the text below -->
|
||||
<a href="{% url 'clients_list' %}" class="btn btn-outline-primary">
|
||||
⇦ Go to Clients
|
||||
</a>
|
||||
|
||||
<!-- 6-Month overview card (OUTSIDE any <a>) -->
|
||||
<div class="overview-card">
|
||||
<div class="overview-title">Helium Input – 6 Month Overview</div>
|
||||
|
||||
<form method="get" class="overview-header">
|
||||
<div>
|
||||
<label for="overview-year">Year</label><br>
|
||||
<select name="overview_year" id="overview-year">
|
||||
{% for y in available_years %}
|
||||
<option value="{{ y }}"
|
||||
{% if overview and overview.year == y %}selected{% endif %}>
|
||||
{{ y }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="overview-start-month">Start month</label><br>
|
||||
<select name="overview_start_month" id="overview-start-month">
|
||||
{% for m, label in month_choices %}
|
||||
<option value="{{ m }}"
|
||||
{% if overview and overview.start_month == m %}selected{% endif %}>
|
||||
{{ m }} - {{ label }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<button type="submit">Show overview</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% if overview %}
|
||||
<div class="overview-subtitle">
|
||||
Period:
|
||||
<strong>{{ overview.start_month }}–{{ overview.end_month }} / {{ overview.year }}</strong>
|
||||
</div>
|
||||
|
||||
<table class="overview-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Month</th>
|
||||
{% for g in overview.groups %}
|
||||
<th>{{ g.label }}</th>
|
||||
{% endfor %}
|
||||
<th>Month total</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for row in overview.rows %}
|
||||
<tr>
|
||||
<td>
|
||||
{{ row.month_number }} - {{ row.month_label|slice:":3" }}
|
||||
</td>
|
||||
{% for value in row.values %}
|
||||
<td class="number-cell">{{ value|floatformat:2 }}</td>
|
||||
{% endfor %}
|
||||
<td class="number-cell">{{ row.total|floatformat:2 }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
<tr class="summary-row">
|
||||
<td>Summe</td>
|
||||
{% for total in overview.group_totals %}
|
||||
<td class="number-cell">{{ total|floatformat:2 }}</td>
|
||||
{% endfor %}
|
||||
<td class="number-cell">{{ overview.grand_total|floatformat:2 }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<div class="overview-subtitle">
|
||||
No data yet – choose a year and start month and click “Show overview”.
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
<h2>Helium Input</h2>
|
||||
<div class="table-container">
|
||||
<button class="add-row-btn" id="add-row-one">Add Row</button>
|
||||
@@ -218,7 +387,8 @@
|
||||
<col style="width: 5%"> <!-- L-He -->
|
||||
<col style="width: 5%"> <!-- L-He zus. -->
|
||||
<col style="width: 6%"> <!-- L-He ges. -->
|
||||
<col style="width: 6%"> <!-- Date Joined -->
|
||||
<col style="width: 7%"> <!-- Date -->
|
||||
<col style="width: 5%"> <!-- Month -->
|
||||
<col style="width: 8%"> <!-- Actions -->
|
||||
</colgroup>
|
||||
<thead>
|
||||
@@ -236,7 +406,8 @@
|
||||
<th>L-He</th>
|
||||
<th>L-He zus.</th>
|
||||
<th>L-He ges.</th>
|
||||
<th>Date Joined</th>
|
||||
<th>Date</th>
|
||||
<th>Month</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -256,7 +427,16 @@
|
||||
<td>{{ entry.lhe|floatformat:6 }}</td>
|
||||
<td>{{ entry.lhe_zus|floatformat:3 }}</td>
|
||||
<td>{{ entry.lhe_ges|floatformat:6 }}</td>
|
||||
<td>{{ entry.date_joined|date:"Y-m-d" }}</td>
|
||||
<td>
|
||||
{% if entry.date %}
|
||||
{{ entry.date|date:"d.m.Y" }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{% if entry.date %}
|
||||
{{ entry.date|date:"m" }} {# e.g. 01–12 #}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="actions">
|
||||
<button class="edit-btn-one">Edit</button>
|
||||
<button class="delete-btn-one">Delete</button>
|
||||
@@ -645,6 +825,7 @@
|
||||
<td>${response.lhe_zus}</td>
|
||||
<td>${response.lhe_ges}</td>
|
||||
<td>${response.date || ''}</td>
|
||||
<td>${response.month || ''}</td>
|
||||
<td class="actions">
|
||||
<button class="edit-btn-one">Edit</button>
|
||||
<button class="delete-btn-one">Delete</button>
|
||||
@@ -805,6 +986,7 @@
|
||||
row.find('td:eq(11)').text(response.lhe_zus);
|
||||
row.find('td:eq(12)').text(response.lhe_ges);
|
||||
row.find('td:eq(13)').text(response.date || '');
|
||||
row.find('td:eq(14)').text(response.month || '');
|
||||
$('#edit-popup-one').fadeOut();
|
||||
} else {
|
||||
alert('Error: ' + (response.message || 'Failed to update entry'));
|
||||
|
||||
Reference in New Issue
Block a user