Bump version to 1.17.8

- Feat: Verbrauchsauswertung – Ablesung korrigieren (Datum, Zählerstand,
  Korrekturnotiz) und löschen direkt aus der Tabelle (manage_kleingarten)
- Feat: Inventarverwaltung – Gegenstände erfassen, bearbeiten, löschen;
  Ausleihe und Rückgabe je Mitglied mit Notiz und Fälligkeitsdatum tracken;
  Export/Import integriert (InventoryRepository, Schema, Validator, DataTransfer)
- Feat: Jahresabrechnung Sperrstatus – Festschreiben/Freigeben mit
  serverseitiger Prüfung aller Schreibzugriffe auf Kosten und Preise
This commit is contained in:
2026-04-19 21:59:40 +02:00
parent bc89452b5e
commit 6aa31147df
27 changed files with 1219 additions and 21 deletions

45
includes/Schema.php Normal file → Executable file
View File

@@ -27,6 +27,8 @@ class Schema {
'parcels' => $wpdb->prefix . 'kgvvm_parcels',
'meters' => $wpdb->prefix . 'kgvvm_meters',
'tenants' => $wpdb->prefix . 'kgvvm_tenants',
'inventory_items' => $wpdb->prefix . 'kgvvm_inventory_items',
'inventory_loans' => $wpdb->prefix . 'kgvvm_inventory_loans',
'parcel_members' => $wpdb->prefix . 'kgvvm_parcel_members',
'parcel_tenants' => $wpdb->prefix . 'kgvvm_parcel_tenants',
'chat_messages' => $wpdb->prefix . 'kgvvm_chat_messages',
@@ -126,6 +128,42 @@ class Schema {
KEY is_active (is_active)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'inventory_items' ) . " (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(190) NOT NULL,
total_quantity INT UNSIGNED NOT NULL DEFAULT 0,
available_quantity INT UNSIGNED NOT NULL DEFAULT 0,
storage_location VARCHAR(190) NULL,
description TEXT NULL,
is_active TINYINT(1) NOT NULL DEFAULT 1,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
KEY name (name),
KEY is_active (is_active)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'inventory_loans' ) . " (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
item_id BIGINT UNSIGNED NOT NULL,
user_id BIGINT UNSIGNED NOT NULL,
borrowed_quantity INT UNSIGNED NOT NULL,
borrowed_at DATETIME NOT NULL,
due_date DATE NULL,
returned_at DATETIME NULL,
note TEXT NULL,
return_note TEXT NULL,
status VARCHAR(20) NOT NULL DEFAULT 'open',
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
KEY item_id (item_id),
KEY user_id (user_id),
KEY status (status),
KEY borrowed_at (borrowed_at),
KEY due_date (due_date)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'parcel_members' ) . " (
parcel_id BIGINT UNSIGNED NOT NULL,
user_id BIGINT UNSIGNED NOT NULL,
@@ -175,6 +213,9 @@ class Schema {
entry_year SMALLINT UNSIGNED NOT NULL,
power_price_per_kwh DECIMAL(12,4) NULL,
water_price_per_m3 DECIMAL(12,4) NULL,
statement_is_locked TINYINT(1) NOT NULL DEFAULT 0,
statement_locked_at DATETIME NULL,
statement_locked_by BIGINT UNSIGNED NOT NULL DEFAULT 0,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
@@ -282,6 +323,8 @@ class Schema {
self::table( 'parcels' ),
self::table( 'meters' ),
self::table( 'tenants' ),
self::table( 'inventory_items' ),
self::table( 'inventory_loans' ),
self::table( 'parcel_members' ),
self::table( 'parcel_tenants' ),
self::table( 'chat_messages' ),
@@ -317,6 +360,8 @@ class Schema {
self::table( 'work_logs' ),
self::table( 'work_year_config' ),
self::table( 'work_jobs' ),
self::table( 'inventory_loans' ),
self::table( 'inventory_items' ),
self::table( 'cost_entries' ),
self::table( 'cost_rates' ),
self::table( 'cost_years' ),