Release 1.16.0

Arbeitsstunden-Modul hinzugefuegt

- Pflichtstunden pro Jahr inkl. Preis je fehlender Stunde

- Arbeitsarten, Arbeitseintraege und Mehrfachzuordnung von Mitgliedern

- Mitgliederuebersicht mit Berechnung fehlender Stunden und Aufschlag

- Datenbankschema fuer Arbeitsstunden erweitert

- Stable Tag und Changelog in README/readme.txt aktualisiert
This commit is contained in:
2026-04-16 21:34:09 +02:00
parent f399cc30bc
commit 7d3d543954
7 changed files with 992 additions and 5 deletions

View File

@@ -33,7 +33,11 @@ class Schema {
'meter_readings' => $wpdb->prefix . 'kgvvm_meter_readings',
'cost_years' => $wpdb->prefix . 'kgvvm_cost_years',
'cost_rates' => $wpdb->prefix . 'kgvvm_cost_rates',
'cost_entries' => $wpdb->prefix . 'kgvvm_cost_entries',
'cost_entries' => $wpdb->prefix . 'kgvvm_cost_entries',
'work_jobs' => $wpdb->prefix . 'kgvvm_work_jobs',
'work_year_config' => $wpdb->prefix . 'kgvvm_work_year_config',
'work_logs' => $wpdb->prefix . 'kgvvm_work_logs',
'work_log_members' => $wpdb->prefix . 'kgvvm_work_log_members',
);
return isset( $map[ $key ] ) ? $map[ $key ] : '';
@@ -205,6 +209,51 @@ class Schema {
KEY distribution_type (distribution_type)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'work_jobs' ) . " (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(190) NOT NULL,
description TEXT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY name (name)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'work_year_config' ) . " (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
entry_year SMALLINT UNSIGNED NOT NULL,
required_hours DECIMAL(8,2) NOT NULL DEFAULT 0.00,
price_per_missing_hour DECIMAL(12,2) NOT NULL DEFAULT 0.00,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY entry_year (entry_year)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'work_logs' ) . " (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
job_id BIGINT UNSIGNED NOT NULL DEFAULT 0,
work_date DATE NOT NULL,
note TEXT NULL,
created_at DATETIME NOT NULL,
updated_at DATETIME NOT NULL,
PRIMARY KEY (id),
KEY job_id (job_id),
KEY work_date (work_date)
) {$charset_collate};";
$sql[] = "CREATE TABLE " . self::table( 'work_log_members' ) . " (
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
log_id BIGINT UNSIGNED NOT NULL,
user_id BIGINT UNSIGNED NOT NULL,
hours DECIMAL(8,2) NOT NULL DEFAULT 0.00,
created_at DATETIME NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY log_user (log_id, user_id),
KEY user_id (user_id),
KEY log_id (log_id)
) {$charset_collate};";
foreach ( $sql as $statement ) {
dbDelta( $statement );
}
@@ -230,6 +279,10 @@ class Schema {
self::table( 'cost_years' ),
self::table( 'cost_rates' ),
self::table( 'cost_entries' ),
self::table( 'work_jobs' ),
self::table( 'work_year_config' ),
self::table( 'work_logs' ),
self::table( 'work_log_members' ),
);
foreach ( $tables as $table ) {
@@ -248,6 +301,10 @@ class Schema {
global $wpdb;
$tables = array(
self::table( 'work_log_members' ),
self::table( 'work_logs' ),
self::table( 'work_year_config' ),
self::table( 'work_jobs' ),
self::table( 'cost_entries' ),
self::table( 'cost_rates' ),
self::table( 'cost_years' ),