Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision f9ae0935

Von Kivitendo Admin vor mehr als 1 Jahr hinzugefügt

  • ID f9ae093591a401159a9ff2e387f4dcf3bdb81234
  • Vorgänger 11c0a336
  • Nachfolger 1e218446

Konten ausziffern - Datenbank und Rose initialisieren

Unterschiede anzeigen:

SL/DB/Cleared.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Cleared;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::Cleared;
9
use SL::DB::Manager::Cleared;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/ClearedGroup.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::ClearedGroup;
5

  
6
use strict;
7

  
8
use SL::DB::MetaSetup::ClearedGroup;
9
use SL::DB::Manager::ClearedGroup;
10

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/Helper/ALL.pm
29 29
use SL::DB::Business;
30 30
use SL::DB::BusinessModel;
31 31
use SL::DB::Chart;
32
use SL::DB::Cleared;
33
use SL::DB::ClearedGroup;
32 34
use SL::DB::Contact;
33 35
use SL::DB::ContactDepartment;
34 36
use SL::DB::ContactTitle;
SL/DB/Helper/Mappings.pm
112 112
  business                       => 'business',
113 113
  business_models                => 'business_model',
114 114
  chart                          => 'chart',
115
  cleared                        => 'cleared',
116
  cleared_group                  => 'ClearedGroup',
115 117
  contact_departments            => 'contact_department',
116 118
  contact_titles                 => 'contact_title',
117 119
  contacts                       => 'contact',
SL/DB/Manager/Cleared.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::Cleared;
5

  
6
use strict;
7

  
8
use parent qw(SL::DB::Helper::Manager);
9

  
10
sub object_class { 'SL::DB::Cleared' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/ClearedGroup.pm
1
# This file has been auto-generated only because it didn't exist.
2
# Feel free to modify it at will; it will not be overwritten automatically.
3

  
4
package SL::DB::Manager::ClearedGroup;
5

  
6
use strict;
7

  
8
use parent qw(SL::DB::Helper::Manager);
9

  
10
sub object_class { 'SL::DB::ClearedGroup' }
11

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/MetaSetup/Chart.pm
12 12
  accno          => { type => 'text', not_null => 1 },
13 13
  category       => { type => 'character', length => 1 },
14 14
  charttype      => { type => 'character', default => 'A', length => 1 },
15
  clearing       => { type => 'boolean', default => 'false', not_null => 1 },
15 16
  datevautomatik => { type => 'boolean', default => 'false' },
16 17
  description    => { type => 'text' },
17 18
  id             => { type => 'integer', not_null => 1, sequence => 'id' },
SL/DB/MetaSetup/Cleared.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::Cleared;
4

  
5
use strict;
6

  
7
use parent qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->table('cleared');
10

  
11
__PACKAGE__->meta->columns(
12
  acc_trans_id     => { type => 'bigint', not_null => 1 },
13
  cleared_group_id => { type => 'integer', not_null => 1 },
14
);
15

  
16
__PACKAGE__->meta->primary_key_columns([ 'cleared_group_id', 'acc_trans_id' ]);
17

  
18
__PACKAGE__->meta->unique_keys(
19
  [ 'acc_trans_id' ],
20
  [ 'acc_trans_id', 'cleared_group_id' ],
21
);
22

  
23
__PACKAGE__->meta->foreign_keys(
24
  acc_transaction => {
25
    class       => 'SL::DB::AccTransaction',
26
    key_columns => { acc_trans_id => 'acc_trans_id' },
27
    rel_type    => 'one to one',
28
  },
29

  
30
  cleared_group => {
31
    class       => 'SL::DB::ClearedGroup',
32
    key_columns => { cleared_group_id => 'id' },
33
  },
34
);
35

  
36
1;
37
;
SL/DB/MetaSetup/ClearedGroup.pm
1
# This file has been auto-generated. Do not modify it; it will be overwritten
2
# by rose_auto_create_model.pl automatically.
3
package SL::DB::ClearedGroup;
4

  
5
use strict;
6

  
7
use parent qw(SL::DB::Object);
8

  
9
__PACKAGE__->meta->table('cleared_group');
10

  
11
__PACKAGE__->meta->columns(
12
  employee_id => { type => 'integer', not_null => 1 },
13
  id          => { type => 'serial', not_null => 1 },
14
  itime       => { type => 'timestamp', default => 'now()' },
15
);
16

  
17
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
18

  
19
__PACKAGE__->meta->allow_inline_column_values(1);
20

  
21
__PACKAGE__->meta->foreign_keys(
22
  employee => {
23
    class       => 'SL::DB::Employee',
24
    key_columns => { employee_id => 'id' },
25
  },
26
);
27

  
28
1;
29
;
sql/Pg-upgrade2/charts_cleared.sql
1
-- @tag: charts_cleared
2
-- @description: Ausziffern für Konten ermöglichen
3
-- @depends: release_3_8_0
4
-- @ignore: 0
5

  
6
CREATE TABLE cleared_group (
7
  id SERIAL PRIMARY KEY,
8
  employee_id INTEGER NOT NULL REFERENCES employee(id),
9
  itime timestamp DEFAULT now()
10
);
11

  
12
-- deleting an acc_trans record shouldn't be possible unless all cleared entries have been deleted
13
-- deleting the cleared_group should remove all cleared entries
14
CREATE TABLE cleared (
15
  acc_trans_id      bigint UNIQUE NOT NULL REFERENCES acc_trans(acc_trans_id),
16
  cleared_group_id  int    NOT NULL REFERENCES cleared_group(id) ON DELETE CASCADE,
17
  primary key (cleared_group_id, acc_trans_id)
18
);
19

  
20
-- which charts should be activated for clearing
21
ALTER TABLE chart ADD COLUMN clearing BOOLEAN DEFAULT false NOT NULL;

Auch abrufbar als: Unified diff