This commit is contained in:
2026-04-14 10:52:49 +02:00
parent 0a5f7be8a0
commit c453f617e8
6 changed files with 151 additions and 97 deletions
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -146,7 +146,7 @@
<body>
<a href="{% url 'clients_list' %}" class="btn btn-outline-primary">
&#8678; Go to Clients
&#8678; Zur Startseite
</a>
<h2>Betriebskosten</h2>
+6 -6
View File
@@ -33,13 +33,13 @@
<option value="12" {% if interval_start_month == 12 %}selected{% endif %}>12</option>
</select>
<button type="submit">Apply Interval</button>
<button type="submit">Intervall anwenden</button>
</form>
<!-- Year Filter -->
<div class="year-filter">
<label for="year-select">Year:</label>
<label for="year-select">Jahr:</label>
<select id="year-select" onchange="window.location.href='?year='+this.value">
{% for year in available_years %}
<option value="{{ year }}" {% if year == current_year %}selected{% endif %}>
@@ -86,12 +86,12 @@
<!-- Navigation Buttons -->
<div class="navigation-buttons">
<a href="{% url 'table_one' %}" class="nav-button">Go to Helium Input</a>
<a href="{% url 'table_two' %}" class="nav-button">Go to Helium Output</a>
<a href="/admin/" class="nav-button admin-button">Go to Admin Panel</a>
<a href="{% url 'table_one' %}" class="nav-button">Heliumrückgabe</a>
<a href="{% url 'table_two' %}" class="nav-button">Heliumausgabe</a>
<a href="/admin/" class="nav-button admin-button">Admin</a>
<a href="{% url 'betriebskosten_list' %}" class="nav-button">Betriebskosten</a>
<a href="{% url 'monthly_sheet' year=2024 month=1 %}" class="nav-button">Monthly Sheets</a>
<a href="{% url 'monthly_sheet' year=2024 month=1 %}" class="nav-button">Monatsbilanz</a>
<a href="{% url 'halfyear_balance' %}" class="nav-button">Halbjahres Bilanz</a>
<!-- ✅ NEW -->
+92 -38
View File
@@ -4,27 +4,43 @@
<div class="spreadsheet-container">
<!-- Navigation Header -->
<div class="sheet-navigation">
{# Previous month link #}
{% with pm=prev_month %}
{% if pm.year and pm.month %}
<a href="{% url 'monthly_sheet' pm.year pm.month %}">← Previous</a>
{% else %}
<span class="disabled-link">← Previous</span>
{% endif %}
{% endwith %}
<div class="nav-left">
<a href="{% url 'clients_list' %}" class="main-page-link">🏠 Hauptseite</a>
<h2>{{ year }} - {{ month_name }} (Sheet {{ month }}/6)</h2>
{% with pm=prev_month %}
{% if pm.year and pm.month %}
<a href="{% url 'monthly_sheet' pm.year pm.month %}">← Vorherigen Monat</a>
{% else %}
<span class="disabled-link">← Vorherigen Monat</span>
{% endif %}
{% endwith %}
</div>
{# Next month link #}
{% with nm=next_month %}
{% if nm.year and nm.month %}
<a href="{% url 'monthly_sheet' nm.year nm.month %}">Next →</a>
{% else %}
<span class="disabled-link">Next →</span>
{% endif %}
{% endwith %}
<div class="nav-center">
<h2>{{ year }} - {{ month_name }} (Sheet {{ month }}/6)</h2>
</div>
<a href="{% url 'summary_sheet' year month %}">Go to Summary</a>
<div class="nav-right">
{% with nm=next_month %}
{% if nm.year and nm.month %}
<a href="{% url 'monthly_sheet' nm.year nm.month %}">Nächsten Monat →</a>
{% else %}
<span class="disabled-link">Nächsten Monat →</span>
{% endif %}
{% endwith %}
<div class="sheet-jump-box">
<label for="jump-year">Jahr:</label>
<input type="number" id="jump-year" min="2000" max="2100" value="{{ year }}">
<label for="jump-month">Monat:</label>
<input type="number" id="jump-month" min="1" max="12" value="{{ month }}">
<button type="button" id="jump-sheet-btn" class="btn btn-primary">Anwenden</button>
</div>
</div>
</div>
<!-- Top Tables Container -->
@@ -32,11 +48,11 @@
<div class="top-tables">
<!-- Left Table (18 rows × clients) -->
<div class="table-container top-left-table">
<h3>Table 1: Top Left</h3>
<h3>Table 1: Oben Links</h3>
<table class="spreadsheet-table">
<thead>
<tr>
<th>Row Label</th>
<th>Zeilenbezeichnung</th>
{% for header in top_left_headers %}
<th>{{ header }}</th>
{% endfor %}
@@ -129,11 +145,11 @@
<!-- Right Table (24 rows × 6 clients) -->
<!-- Update the top-right table section in monthly_sheet.html -->
<div class="table-container top-right-table">
<h3>Table 2: Top Right</h3>
<h3>Table 2: Oben Rechts</h3>
<table class="spreadsheet-table">
<thead>
<tr>
<th>Row Label</th>
<th>Zeilenbezeichnung</th>
{% for header in top_right_headers %}
<th>{{ header }}</th>
{% endfor %}
@@ -236,11 +252,11 @@
</table>
</div>
<div class="table-container overall-summary-table">
<h3>Gesamtsumme (Top Left + Top Right)</h3>
<h3>Gesamtsumme (Oben Links+Rechts)</h3>
<table class="spreadsheet-table">
<thead>
<tr>
<th>Row Label</th>
<th>Zeilenbezeichnung</th>
<th>Σ</th>
</tr>
</thead>
@@ -264,7 +280,7 @@
<!-- Bottom Tables -->
<div class="bottom-tables">
<div class="table-container bottom-table-1">
<h3>Bottom Table 1 Gasspeicher</h3>
<h3>Untere Tabelle 1 Gasspeicher</h3>
@@ -373,7 +389,7 @@
<div class="table-container bottom-table-2">
<h3>Bottom Table 2 Verbraucherbestand L-He</h3>
<h3>Untere Tabelle 2 Verbraucherbestand L-He</h3>
<table class="spreadsheet-table">
<tbody>
@@ -450,7 +466,7 @@
</div>
<div class="table-container bottom-table-3">
<h3>Bottom Table 3 Bilanz</h3>
<h3>Untere Tabelle 3 Bilanz</h3>
<table class="spreadsheet-table">
<thead>
@@ -621,17 +637,7 @@
</div>
<!-- Save Button -->
<div class="action-bar">
<button id="save-all-btn" class="btn btn-primary">Save All Cells</button>
<div id="save-status"></div>
<div class="legend">
<small>
<span style="background-color: #d1ecf1; padding: 2px 5px;">Saved cells</span>
<span style="background-color: #d4edda; padding: 2px 5px;">Calculated cells</span>
</small>
</div>
</div>
</div>
<!-- Hidden form for cell data -->
@@ -645,16 +651,48 @@
padding: 20px;
}
.nav-left,
.nav-center,
.nav-right {
display: flex;
align-items: center;
gap: 12px;
}
.nav-center h2 {
margin: 0;
}
.main-page-link {
font-weight: bold;
text-decoration: none;
color: #007bff;
}
.sheet-jump-box {
display: flex;
align-items: center;
gap: 8px;
margin-left: 10px;
}
.sheet-jump-box input {
width: 80px;
padding: 6px;
}
.sheet-navigation {
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
margin-bottom: 20px;
padding: 10px;
background-color: #f8f9fa;
border-radius: 5px;
flex-wrap: wrap;
}
.sheet-navigation h2 {
margin: 0;
}
@@ -821,6 +859,22 @@
<script>
$(document).ready(function() {
$('#jump-sheet-btn').on('click', function() {
const year = parseInt($('#jump-year').val(), 10);
const month = parseInt($('#jump-month').val(), 10);
if (isNaN(year) || isNaN(month)) {
alert('Bitte Jahr und Monat eingeben.');
return;
}
if (month < 1 || month > 12) {
alert('Monat muss zwischen 1 und 12 liegen.');
return;
}
window.location.href = '/sheet/' + year + '/' + month + '/';
});
// ---------- Helpers ----------
+25 -25
View File
@@ -286,21 +286,21 @@
<!-- This link should ONLY wrap the text below -->
<a href="{% url 'clients_list' %}" class="btn btn-outline-primary">
&#8678; Go to Clients
&#8678; Zur Startseite
</a>
<!-- 6-Month overview card (OUTSIDE any <a>) -->
<div class="overview-card">
<div class="overview-title">Helium Input 6 Month Overview</div>
<div class="overview-title">Heliumrückgabe Überblick über 6 Monate</div>
{% if overview %}
<div class="overview-subtitle">
Period:
Interval
<strong>
{{ overview.start_month }}/{{ overview.start_year }}
{{ overview.end_month }}/{{ overview.end_year }}
</strong>
(selected on the main page)
(ausgewählt am Start Seite)
</div>
<table class="overview-table">
@@ -310,7 +310,7 @@
{% for g in overview.groups %}
<th>{{ g.label }}</th>
{% endfor %}
<th>Month total</th>
<th>Monat total</th>
</tr>
</thead>
<tbody>
@@ -342,7 +342,7 @@
<h2>Helium Input</h2>
<div class="table-container">
<button class="add-row-btn" id="add-row-one">Add Row</button>
<button class="add-row-btn" id="add-row-one">Eingabe hinzufügen</button>
<table id="table-one">
<colgroup>
<col style="width: 3%"> <!-- # -->
@@ -367,7 +367,7 @@
<th>#</th>
<th>ID</th>
<th>Institute</th>
<th>Client</th>
<th>Kunde</th>
<th>Druck</th>
<th>Reinheit</th>
<th>Druckkorrektur</th>
@@ -377,8 +377,8 @@
<th>L-He</th>
<th>L-He zus.</th>
<th>L-He ges.</th>
<th>Date</th>
<th>Month</th>
<th>Datum</th>
<th>Monat</th>
<th>Actions</th>
</tr>
</thead>
@@ -409,8 +409,8 @@
{% endif %}
</td>
<td class="actions">
<button class="edit-btn-one">Edit</button>
<button class="delete-btn-one">Delete</button>
<button class="edit-btn-one">Bearbeiten</button>
<button class="delete-btn-one">Löschen</button>
</td>
</tr>
{% endfor %}
@@ -522,7 +522,7 @@
<!-- Client Selection -->
<label for="edit-client-id">Kunde:</label>
<select id="edit-client-id" disabled>
<option value="">Select Institute first</option>
<option value="">Institut erstmal auswählen</option>
{% for client in clients %}
<option value="{{ client.id }}" data-institute="{{ client.institute.id }}">{{ client.name }}</option>
{% endfor %}
@@ -708,19 +708,19 @@
const instituteId = $('#add-institute-id').val();
if (!instituteId) {
alert('Please select an institute');
alert('Institut erstmal auswählen');
return;
}
if (!clientId) {
alert('Please select a client');
alert('Kunde erstmal auswählen');
return;
}
// Validate date first
let dateInput = $('#add-date').val();
if (!dateInput) {
alert('Please select a date');
alert('Datum erstmal auswählen');
return;
}
@@ -732,17 +732,17 @@
let gesFlaschInhalt = parseFloat($('#add-constant-300').val()) || 300.0;
if (isNaN(pressure) || pressure < 0) {
alert('Please enter a valid pressure value');
alert('Bitte geben Sie einen gültigen Druckwert ein.');
return;
}
if (isNaN(purity) || purity < 0 || purity > 100) {
alert('Please enter a valid purity value (0-100)');
alert('Bitte geben Sie einen gültigen Reinheitswert ein (0-100).');
return;
}
if (isNaN(druckkorrektur) || druckkorrektur < 0) {
alert('Please enter a valid Druckkorrektur value');
alert('Bitte geben Sie einen gültigen Druckkorrekturwert ein');
return;
}
@@ -875,12 +875,12 @@
const instituteId = $('#edit-institute-id').val();
if (!instituteId) {
alert('Please select an institute');
alert('Institut erstmal auswählen');
return;
}
if (!clientId) {
alert('Please select a client');
alert('Kunde erstmal auswählen');
return;
}
@@ -892,17 +892,17 @@
let gesFlaschInhalt = parseFloat($('#edit-constant-300').val()) || 300.0;
if (isNaN(pressure) || pressure < 0) {
alert('Please enter a valid pressure value');
alert('Bitte geben Sie einen gültigen Druckwert ein.');
return;
}
if (isNaN(purity) || purity < 0 || purity > 100) {
alert('Please enter a valid purity value (0-100)');
alert('Bitte geben Sie einen gültigen Reinheitswert ein (0-100).');
return;
}
if (isNaN(druckkorrektur) || druckkorrektur < 0) {
alert('Please enter a valid Druckkorrektur value');
alert('Bitte geben Sie einen gültigen Druckkorrekturwert ein');
return;
}
@@ -937,7 +937,7 @@
// Validate inputs
if (!formData.date) {
alert('Please select a date');
alert('Bitte wählen Sie ein Datum.');
return;
}
@@ -993,7 +993,7 @@
}
},
error: function () {
alert('Failed to delete entry. Please try again.');
alert('Eintrag konnte nicht gelöscht werden. Bitte versuchen Sie es erneut.');
}
});
});
+27 -27
View File
@@ -190,28 +190,28 @@
<div class="d-flex justify-content-start mb-2">
<!-- "Go to Clients" button at top-left -->
<a href="{% url 'clients_list' %}" class="btn btn-outline-primary">
&#8678; Go to Clients
&#8678; Zur Startseite
</a>
</div>
<h2>LHe Dewar Output</h2>
<div class="table-container">
<button class="add-row-btn" id="add-row-two">Add Output</button>
<button class="add-row-btn" id="add-row-two">Eingabe hinzufügen</button>
<table id="table-two">
<thead>
<tr>
<th>#</th>
<th>ID</th>
<th>Institute</th>
<th>Client</th>
<th>Date</th>
<th>Institut</th>
<th>Kunde</th>
<th>Datum</th>
<th>Warm</th>
<th>LHe Delivery</th>
<th>LHe Anlieferung</th>
<th>Vor</th>
<th>Nach</th>
<th>LHe Output</th>
<th>Notes</th>
<th>LHe Ausgabe</th>
<th>Notizen</th>
<th>Actions</th>
</tr>
</thead>
@@ -230,8 +230,8 @@
<td>{% if entry.lhe_output is not None %}{{ entry.lhe_output|floatformat:1 }}{% endif %}</td>
<td>{{ entry.notes }}</td>
<td class="actions">
<button class="edit-btn-two">Edit</button>
<button class="delete-btn-two">Delete</button>
<button class="edit-btn-two">Bearbeiten</button>
<button class="delete-btn-two">Löschen</button>
</td>
</tr>
{% endfor %}
@@ -245,24 +245,24 @@
<h3>LHe Dewar Output</h3>
<!-- Institute Selection -->
<label for="add-institute-id">Institute:</label>
<label for="add-institute-id">Institut:</label>
<select id="add-institute-id">
<option value="">Select Institute</option>
<option value="">Institut auswählen</option>
{% for institute in institutes %}
<option value="{{ institute.id }}">{{ institute.name }}</option>
{% endfor %}
</select>
<!-- Client Selection (will be populated based on institute) -->
<label for="add-client-id">Client:</label>
<label for="add-client-id">Kunde:</label>
<select id="add-client-id" disabled>
<option value="">Select Institute first</option>
<option value="">Institut erstaml auswählen</option>
{% for client in clients %}
<option value="{{ client.id }}" data-institute="{{ client.institute.id }}">{{ client.name }}</option>
{% endfor %}
</select>
<label for="add-date">Date:</label>
<label for="add-date">Datum:</label>
<input type="date" id="add-date">
<!-- Changed from checkbox to number input -->
@@ -273,7 +273,7 @@
<div class="input-with-label">
<label for="add-lhe-delivery">LHe Anlieferung:</label>
<input type="text" id="add-lhe-delivery" placeholder="Enter delivery amount">
<input type="text" id="add-lhe-delivery" placeholder="Wert eingeben">
</div>
<div class="input-with-label">
@@ -291,8 +291,8 @@
<input type="number" id="add-lhe-output" readonly>
</div>
<label for="add-notes">Notes:</label>
<textarea id="add-notes" placeholder="Additional notes"></textarea>
<label for="add-notes">Notizen:</label>
<textarea id="add-notes" placeholder="Notizen"></textarea>
<div class="popup-buttons">
<button class="save-btn" id="save-add-two">Save</button>
@@ -310,16 +310,16 @@
<!-- Institute Selection -->
<label for="edit-institute-id">Institute:</label>
<select id="edit-institute-id">
<option value="">Select Institute</option>
<option value="">Institut Auswälen</option>
{% for institute in institutes %}
<option value="{{ institute.id }}">{{ institute.name }}</option>
{% endfor %}
</select>
<!-- Client Selection (will be populated based on institute) -->
<label for="edit-client-id">Client:</label>
<label for="edit-client-id">Kunde:</label>
<select id="edit-client-id" disabled>
<option value="">Select Institute first</option>
<option value="">Institut erstmal Auswälen</option>
{% for client in clients %}
<option value="{{ client.id }}" data-institute="{{ client.institute.id }}">{{ client.name }}</option>
{% endfor %}
@@ -336,7 +336,7 @@
<div class="input-with-label">
<label for="edit-lhe-delivery">LHe Anlieferung:</label>
<input type="text" id="edit-lhe-delivery" placeholder="Enter delivery amount">
<input type="text" id="edit-lhe-delivery" placeholder="Wert eingeben">
</div>
<div class="input-with-label">
@@ -399,7 +399,7 @@
function filterClients(instituteId, targetSelect, allOptions) {
if (!instituteId) {
// Show only the default option if no institute selected
targetSelect.html('<option value="">Select Institute first</option>');
targetSelect.html('<option value="">erstmal Institut auswählen</option>');
targetSelect.prop('disabled', true);
} else {
// Restore all options first
@@ -412,7 +412,7 @@
targetSelect.find('option').hide();
// Always show the "Select Client" option
targetSelect.find('option[value=""]').show().text('Select Client');
targetSelect.find('option[value=""]').show().text('Kunde Auswählen');
// Show only clients from selected institute
const clientsFromInstitute = targetSelect.find(`option[data-institute="${instituteId}"]`);
@@ -473,7 +473,7 @@
$('#add-row-two').on('click', function () {
// Reset form
$('#add-institute-id').val('');
$('#add-client-id').html('<option value="">Select Institute first</option>');
$('#add-client-id').html('<option value="">Erstaml institut auswählen</option>');
$('#add-client-id').prop('disabled', true);
$('#add-date').val('');
$('#add-is-warm').val('0');
@@ -645,12 +645,12 @@
const instituteId = $('#edit-institute-id').val();
if (!instituteId) {
alert('Please select an institute');
alert('Institut erstmal auswählen');
return;
}
if (!clientId) {
alert('Please select a client');
alert('Kunde erstmal auswählen');
return;
}