Revision dc3382e8
Von Bernd Bleßmann vor etwa 7 Jahren hinzugefügt
SL/DB/Helper/ALL.pm | ||
---|---|---|
123 | 123 |
use SL::DB::ShopOrderItem; |
124 | 124 |
use SL::DB::ShopPart; |
125 | 125 |
use SL::DB::Status; |
126 |
use SL::DB::Stocktaking; |
|
126 | 127 |
use SL::DB::Tax; |
127 | 128 |
use SL::DB::TaxKey; |
128 | 129 |
use SL::DB::TaxZone; |
SL/DB/Helper/Mappings.pm | ||
---|---|---|
203 | 203 |
shop_order_items => 'shop_order_item', |
204 | 204 |
shop_parts => 'shop_part', |
205 | 205 |
status => 'status', |
206 |
stocktakings => 'stocktaking', |
|
206 | 207 |
tax => 'tax', |
207 | 208 |
taxkeys => 'tax_key', |
208 | 209 |
tax_zones => 'tax_zone', |
SL/DB/Manager/Stocktaking.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::Stocktaking; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use parent qw(SL::DB::Helper::Manager); |
|
9 |
|
|
10 |
sub object_class { 'SL::DB::Stocktaking' } |
|
11 |
|
|
12 |
__PACKAGE__->make_manager_methods; |
|
13 |
|
|
14 |
1; |
SL/DB/MetaSetup/Stocktaking.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::Stocktaking; |
|
4 |
|
|
5 |
use strict; |
|
6 |
|
|
7 |
use parent qw(SL::DB::Object); |
|
8 |
|
|
9 |
__PACKAGE__->meta->table('stocktakings'); |
|
10 |
|
|
11 |
__PACKAGE__->meta->columns( |
|
12 |
bestbefore => { type => 'date' }, |
|
13 |
bin_id => { type => 'integer', not_null => 1 }, |
|
14 |
chargenumber => { type => 'text', default => '', not_null => 1 }, |
|
15 |
comment => { type => 'text' }, |
|
16 |
cutoff_date => { type => 'date', not_null => 1 }, |
|
17 |
employee_id => { type => 'integer', not_null => 1 }, |
|
18 |
id => { type => 'integer', not_null => 1, sequence => 'id' }, |
|
19 |
inventory_id => { type => 'integer' }, |
|
20 |
itime => { type => 'timestamp', default => 'now()' }, |
|
21 |
mtime => { type => 'timestamp' }, |
|
22 |
parts_id => { type => 'integer', not_null => 1 }, |
|
23 |
qty => { type => 'numeric', not_null => 1, precision => 25, scale => 5 }, |
|
24 |
warehouse_id => { type => 'integer', not_null => 1 }, |
|
25 |
); |
|
26 |
|
|
27 |
__PACKAGE__->meta->primary_key_columns([ 'id' ]); |
|
28 |
|
|
29 |
__PACKAGE__->meta->allow_inline_column_values(1); |
|
30 |
|
|
31 |
__PACKAGE__->meta->foreign_keys( |
|
32 |
bin => { |
|
33 |
class => 'SL::DB::Bin', |
|
34 |
key_columns => { bin_id => 'id' }, |
|
35 |
}, |
|
36 |
|
|
37 |
employee => { |
|
38 |
class => 'SL::DB::Employee', |
|
39 |
key_columns => { employee_id => 'id' }, |
|
40 |
}, |
|
41 |
|
|
42 |
inventory => { |
|
43 |
class => 'SL::DB::Inventory', |
|
44 |
key_columns => { inventory_id => 'id' }, |
|
45 |
}, |
|
46 |
|
|
47 |
parts => { |
|
48 |
class => 'SL::DB::Part', |
|
49 |
key_columns => { parts_id => 'id' }, |
|
50 |
}, |
|
51 |
|
|
52 |
warehouse => { |
|
53 |
class => 'SL::DB::Warehouse', |
|
54 |
key_columns => { warehouse_id => 'id' }, |
|
55 |
}, |
|
56 |
); |
|
57 |
|
|
58 |
1; |
|
59 |
; |
SL/DB/Stocktaking.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::Stocktaking; |
|
5 |
|
|
6 |
use strict; |
|
7 |
|
|
8 |
use SL::DB::MetaSetup::Stocktaking; |
|
9 |
use SL::DB::Manager::Stocktaking; |
|
10 |
|
|
11 |
__PACKAGE__->meta->initialize; |
|
12 |
|
|
13 |
1; |
sql/Pg-upgrade2/stocktakings.sql | ||
---|---|---|
1 |
-- @tag: stocktakings |
|
2 |
-- @description: Tabelle für in einer Inventur gezählte Artikel |
|
3 |
-- @depends: warehouse |
|
4 |
|
|
5 |
|
|
6 |
CREATE TABLE stocktakings ( |
|
7 |
id INTEGER NOT NULL DEFAULT nextval('id'), |
|
8 |
inventory_id INTEGER REFERENCES inventory(id), |
|
9 |
warehouse_id INTEGER NOT NULL REFERENCES warehouse(id), |
|
10 |
bin_id INTEGER NOT NULL REFERENCES bin(id), |
|
11 |
parts_id INTEGER NOT NULL REFERENCES parts(id), |
|
12 |
employee_id INTEGER NOT NULL REFERENCES employee(id), |
|
13 |
qty NUMERIC(25,5) NOT NULL , |
|
14 |
comment TEXT, |
|
15 |
chargenumber TEXT NOT NULL DEFAULT '', |
|
16 |
bestbefore DATE, |
|
17 |
cutoff_date DATE NOT NULL, |
|
18 |
itime TIMESTAMP DEFAULT now(), |
|
19 |
mtime TIMESTAMP, |
|
20 |
|
|
21 |
PRIMARY KEY (id) |
|
22 |
); |
|
23 |
|
|
24 |
CREATE TRIGGER mtime_stocktakings BEFORE UPDATE ON stocktakings FOR EACH ROW EXECUTE PROCEDURE set_mtime(); |
Auch abrufbar als: Unified diff
Inventur: neue Tabelle für gezählte Artikel. DB-Upgrade und Rose