Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 48e0fd7d

Von Bernd Bleßmann vor 28 Tagen hinzugefügt

  • ID 48e0fd7dc35638a2c55fffa99c6c7190f0d31427
  • Vorgänger 4054cdd3
  • Nachfolger 7dd9c5f7

Zwischeninventur: DB + Rose

Unterschiede anzeigen:

SL/DB/Helper/ALL.pm
144 144
use SL::DB::ShopOrderItem;
145 145
use SL::DB::ShopPart;
146 146
use SL::DB::Status;
147
use SL::DB::StockCounting;
148
use SL::DB::StockCountingItem;
147 149
use SL::DB::Stocktaking;
148 150
use SL::DB::Tax;
149 151
use SL::DB::TaxKey;
SL/DB/Helper/Mappings.pm
223 223
  shop_parts                     => 'shop_part',
224 224
  status                         => 'status',
225 225
  stocktakings                   => 'stocktaking',
226
  stock_countings                => 'stock_counting',
227
  stock_counting_items           => 'stock_counting_item',
226 228
  tax                            => 'tax',
227 229
  taxkeys                        => 'tax_key',
228 230
  tax_zones                      => 'tax_zone',
SL/DB/Manager/StockCounting.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::StockCounting;
5

  
6
use strict;
7

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

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

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/Manager/StockCountingItem.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::StockCountingItem;
5

  
6
use strict;
7

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

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

  
12
__PACKAGE__->make_manager_methods;
13

  
14
1;
SL/DB/MetaSetup/StockCounting.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::StockCounting;
4

  
5
use strict;
6

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

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

  
11
__PACKAGE__->meta->columns(
12
  bin_id        => { type => 'integer' },
13
  description   => { type => 'text' },
14
  employee_id   => { type => 'integer', not_null => 1 },
15
  id            => { type => 'integer', not_null => 1, sequence => 'id' },
16
  itime         => { type => 'timestamp', default => 'now()' },
17
  mtime         => { type => 'timestamp' },
18
  name          => { type => 'text', not_null => 1 },
19
  part_id       => { type => 'integer' },
20
  partsgroup_id => { type => 'integer' },
21
  vendor_id     => { type => 'integer' },
22
);
23

  
24
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
25

  
26
__PACKAGE__->meta->unique_keys([ 'name' ]);
27

  
28
__PACKAGE__->meta->allow_inline_column_values(1);
29

  
30
__PACKAGE__->meta->foreign_keys(
31
  bin => {
32
    class       => 'SL::DB::Bin',
33
    key_columns => { bin_id => 'id' },
34
  },
35

  
36
  employee => {
37
    class       => 'SL::DB::Employee',
38
    key_columns => { employee_id => 'id' },
39
  },
40

  
41
  part => {
42
    class       => 'SL::DB::Part',
43
    key_columns => { part_id => 'id' },
44
  },
45

  
46
  partsgroup => {
47
    class       => 'SL::DB::PartsGroup',
48
    key_columns => { partsgroup_id => 'id' },
49
  },
50

  
51
  vendor => {
52
    class       => 'SL::DB::Vendor',
53
    key_columns => { vendor_id => 'id' },
54
  },
55
);
56

  
57
1;
58
;
SL/DB/MetaSetup/StockCountingItem.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::StockCountingItem;
4

  
5
use strict;
6

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

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

  
11
__PACKAGE__->meta->columns(
12
  bin_id                  => { type => 'integer', not_null => 1 },
13
  comment                 => { type => 'text' },
14
  correction_inventory_id => { type => 'integer' },
15
  counted_at              => { type => 'timestamp', default => 'now()', not_null => 1 },
16
  counting_id             => { type => 'integer', not_null => 1 },
17
  employee_id             => { type => 'integer', not_null => 1 },
18
  id                      => { type => 'integer', not_null => 1, sequence => 'id' },
19
  itime                   => { type => 'timestamp', default => 'now()', not_null => 1 },
20
  mtime                   => { type => 'timestamp' },
21
  part_id                 => { type => 'integer', not_null => 1 },
22
  qty                     => { type => 'numeric', not_null => 1, precision => 25, scale => 5 },
23
);
24

  
25
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
26

  
27
__PACKAGE__->meta->allow_inline_column_values(1);
28

  
29
__PACKAGE__->meta->foreign_keys(
30
  bin => {
31
    class       => 'SL::DB::Bin',
32
    key_columns => { bin_id => 'id' },
33
  },
34

  
35
  correction_inventory => {
36
    class       => 'SL::DB::Inventory',
37
    key_columns => { correction_inventory_id => 'id' },
38
  },
39

  
40
  counting => {
41
    class       => 'SL::DB::StockCounting',
42
    key_columns => { counting_id => 'id' },
43
  },
44

  
45
  employee => {
46
    class       => 'SL::DB::Employee',
47
    key_columns => { employee_id => 'id' },
48
  },
49

  
50
  part => {
51
    class       => 'SL::DB::Part',
52
    key_columns => { part_id => 'id' },
53
  },
54
);
55

  
56
1;
57
;
SL/DB/StockCounting.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::StockCounting;
5

  
6
use strict;
7

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

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
SL/DB/StockCountingItem.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::StockCountingItem;
5

  
6
use strict;
7

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

  
11
__PACKAGE__->meta->initialize;
12

  
13
1;
sql/Pg-upgrade2/stock_countings.sql
1
-- @tag: stock_countings
2
-- @description: Tabellen für (Zwischen-)zählungen / Inventuren
3
-- @depends: warehouse release_3_9_0
4

  
5
CREATE TABLE stock_countings (
6
       id            INTEGER        NOT NULL DEFAULT nextval('id'),
7
       employee_id   INTEGER        NOT NULL REFERENCES employee(id),
8
       name          TEXT           NOT NULL UNIQUE,
9
       description   TEXT,
10
       bin_id        INTEGER        REFERENCES bin(id),
11
       part_id       INTEGER        REFERENCES parts(id),
12
       partsgroup_id INTEGER        REFERENCES partsgroup(id),
13
       vendor_id     INTEGER        REFERENCES vendor(id),
14
       itime         TIMESTAMP      DEFAULT now(),
15
       mtime         TIMESTAMP,
16

  
17
       PRIMARY KEY (id)
18
);
19

  
20
CREATE TRIGGER mtime_stock_countings BEFORE UPDATE ON stock_countings FOR EACH ROW EXECUTE PROCEDURE set_mtime();
21

  
22
CREATE TABLE stock_counting_items (
23
       id                      INTEGER        NOT NULL DEFAULT nextval('id'),
24
       counting_id             INTEGER        NOT NULL REFERENCES stock_countings(id),
25
       bin_id                  INTEGER        NOT NULL REFERENCES bin(id),
26
       part_id                 INTEGER        NOT NULL REFERENCES parts(id),
27
       employee_id             INTEGER        NOT NULL REFERENCES employee(id),
28
       counted_at              TIMESTAMP      NOT NULL DEFAULT now(),
29
       qty                     NUMERIC(25,5)  NOT NULL,
30
       comment                 TEXT,
31
       correction_inventory_id INTEGER        REFERENCES inventory(id),
32
       itime                   TIMESTAMP      NOT NULL DEFAULT now(),
33
       mtime                   TIMESTAMP,
34

  
35
       PRIMARY KEY (id)
36
);
37

  
38
CREATE TRIGGER mtime_stock_counting_items BEFORE UPDATE ON stock_counting_items FOR EACH ROW EXECUTE PROCEDURE set_mtime();

Auch abrufbar als: Unified diff