use SL::DB::TaxKey;
use SL::DB::TaxZone;
use SL::DB::TaxzoneChart;
+use SL::DB::TimeRecording;
+use SL::DB::TimeRecordingType;
use SL::DB::TodoUserConfig;
use SL::DB::TransferType;
use SL::DB::Translation;
taxkeys => 'tax_key',
tax_zones => 'tax_zone',
taxzone_charts => 'taxzone_chart',
+ time_recording_types => 'time_recording_type',
+ time_recordings => 'time_recording',
todo_user_config => 'todo_user_config',
transfer_type => 'transfer_type',
translation => 'translation',
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::Manager::TimeRecording;
+
+use strict;
+
+use parent qw(SL::DB::Helper::Manager);
+
+sub object_class { 'SL::DB::TimeRecording' }
+
+__PACKAGE__->make_manager_methods;
+
+1;
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::Manager::TimeRecordingType;
+
+use strict;
+
+use parent qw(SL::DB::Helper::Manager);
+
+sub object_class { 'SL::DB::TimeRecordingType' }
+
+__PACKAGE__->make_manager_methods;
+
+1;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::TimeRecording;
+
+use strict;
+
+use parent qw(SL::DB::Object);
+
+__PACKAGE__->meta->table('time_recordings');
+
+__PACKAGE__->meta->columns(
+ customer_id => { type => 'integer', not_null => 1 },
+ description => { type => 'text', not_null => 1 },
+ employee_id => { type => 'integer', not_null => 1 },
+ end_time => { type => 'timestamp' },
+ id => { type => 'serial', not_null => 1 },
+ itime => { type => 'timestamp', default => 'now()', not_null => 1 },
+ mtime => { type => 'timestamp', default => 'now()', not_null => 1 },
+ project_id => { type => 'integer' },
+ staff_member_id => { type => 'integer', not_null => 1 },
+ start_time => { type => 'timestamp', not_null => 1 },
+ type_id => { type => 'integer' },
+);
+
+__PACKAGE__->meta->primary_key_columns([ 'id' ]);
+
+__PACKAGE__->meta->allow_inline_column_values(1);
+
+__PACKAGE__->meta->foreign_keys(
+ customer => {
+ class => 'SL::DB::Customer',
+ key_columns => { customer_id => 'id' },
+ },
+
+ employee => {
+ class => 'SL::DB::Employee',
+ key_columns => { employee_id => 'id' },
+ },
+
+ project => {
+ class => 'SL::DB::Project',
+ key_columns => { project_id => 'id' },
+ },
+
+ staff_member => {
+ class => 'SL::DB::Employee',
+ key_columns => { staff_member_id => 'id' },
+ },
+
+ type => {
+ class => 'SL::DB::TimeRecordingType',
+ key_columns => { type_id => 'id' },
+ },
+);
+
+1;
+;
--- /dev/null
+# This file has been auto-generated. Do not modify it; it will be overwritten
+# by rose_auto_create_model.pl automatically.
+package SL::DB::TimeRecordingType;
+
+use strict;
+
+use parent qw(SL::DB::Object);
+
+__PACKAGE__->meta->table('time_recording_types');
+
+__PACKAGE__->meta->columns(
+ abbreviation => { type => 'text', not_null => 1 },
+ description => { type => 'text' },
+ id => { type => 'serial', not_null => 1 },
+ obsolete => { type => 'boolean', default => 'false', not_null => 1 },
+ position => { type => 'integer', not_null => 1 },
+);
+
+__PACKAGE__->meta->primary_key_columns([ 'id' ]);
+
+1;
+;
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::TimeRecording;
+
+use strict;
+
+use SL::DB::MetaSetup::TimeRecording;
+use SL::DB::Manager::TimeRecording;
+
+__PACKAGE__->meta->initialize;
+
+1;
--- /dev/null
+# This file has been auto-generated only because it didn't exist.
+# Feel free to modify it at will; it will not be overwritten automatically.
+
+package SL::DB::TimeRecordingType;
+
+use strict;
+
+use SL::DB::MetaSetup::TimeRecordingType;
+use SL::DB::Manager::TimeRecordingType;
+
+__PACKAGE__->meta->initialize;
+
+1;
--- /dev/null
+-- @tag: time_recordings
+-- @description: Tabellen zur Zeiterfassung
+-- @depends: release_3_5_6_1
+
+CREATE TABLE time_recording_types (
+ id SERIAL,
+ abbreviation TEXT NOT NULL,
+ description TEXT,
+ position INTEGER NOT NULL,
+ obsolete BOOLEAN NOT NULL DEFAULT false,
+ PRIMARY KEY (id)
+);
+
+CREATE TABLE time_recordings (
+ id SERIAL,
+ customer_id INTEGER NOT NULL,
+ project_id INTEGER,
+ start_time TIMESTAMP NOT NULL,
+ end_time TIMESTAMP,
+ type_id INTEGER,
+ description TEXT NOT NULL,
+ staff_member_id INTEGER NOT NULL,
+ employee_id INTEGER NOT NULL,
+ itime TIMESTAMP NOT NULL DEFAULT now(),
+ mtime TIMESTAMP NOT NULL DEFAULT now(),
+
+ PRIMARY KEY (id),
+ FOREIGN KEY (customer_id) REFERENCES customer (id),
+ FOREIGN KEY (staff_member_id) REFERENCES employee (id),
+ FOREIGN KEY (employee_id) REFERENCES employee (id),
+ FOREIGN KEY (project_id) REFERENCES project (id),
+ FOREIGN KEY (type_id) REFERENCES time_recording_types (id)
+);
+
+CREATE TRIGGER mtime_time_recordings BEFORE UPDATE ON time_recordings FOR EACH ROW EXECUTE PROCEDURE set_mtime();