Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 48e0fd7d

Von Bernd Bleßmann vor 8 Monaten hinzugefügt

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

Zwischeninventur: DB + Rose

Unterschiede anzeigen:

SL/DB/Helper/ALL.pm
use SL::DB::ShopOrderItem;
use SL::DB::ShopPart;
use SL::DB::Status;
use SL::DB::StockCounting;
use SL::DB::StockCountingItem;
use SL::DB::Stocktaking;
use SL::DB::Tax;
use SL::DB::TaxKey;
SL/DB/Helper/Mappings.pm
shop_parts => 'shop_part',
status => 'status',
stocktakings => 'stocktaking',
stock_countings => 'stock_counting',
stock_counting_items => 'stock_counting_item',
tax => 'tax',
taxkeys => 'tax_key',
tax_zones => 'tax_zone',
SL/DB/Manager/StockCounting.pm
# 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::StockCounting;
use strict;
use parent qw(SL::DB::Helper::Manager);
sub object_class { 'SL::DB::StockCounting' }
__PACKAGE__->make_manager_methods;
1;
SL/DB/Manager/StockCountingItem.pm
# 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::StockCountingItem;
use strict;
use parent qw(SL::DB::Helper::Manager);
sub object_class { 'SL::DB::StockCountingItem' }
__PACKAGE__->make_manager_methods;
1;
SL/DB/MetaSetup/StockCounting.pm
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::StockCounting;
use strict;
use parent qw(SL::DB::Object);
__PACKAGE__->meta->table('stock_countings');
__PACKAGE__->meta->columns(
bin_id => { type => 'integer' },
description => { type => 'text' },
employee_id => { type => 'integer', not_null => 1 },
id => { type => 'integer', not_null => 1, sequence => 'id' },
itime => { type => 'timestamp', default => 'now()' },
mtime => { type => 'timestamp' },
name => { type => 'text', not_null => 1 },
part_id => { type => 'integer' },
partsgroup_id => { type => 'integer' },
vendor_id => { type => 'integer' },
);
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
__PACKAGE__->meta->unique_keys([ 'name' ]);
__PACKAGE__->meta->allow_inline_column_values(1);
__PACKAGE__->meta->foreign_keys(
bin => {
class => 'SL::DB::Bin',
key_columns => { bin_id => 'id' },
},
employee => {
class => 'SL::DB::Employee',
key_columns => { employee_id => 'id' },
},
part => {
class => 'SL::DB::Part',
key_columns => { part_id => 'id' },
},
partsgroup => {
class => 'SL::DB::PartsGroup',
key_columns => { partsgroup_id => 'id' },
},
vendor => {
class => 'SL::DB::Vendor',
key_columns => { vendor_id => 'id' },
},
);
1;
;
SL/DB/MetaSetup/StockCountingItem.pm
# This file has been auto-generated. Do not modify it; it will be overwritten
# by rose_auto_create_model.pl automatically.
package SL::DB::StockCountingItem;
use strict;
use parent qw(SL::DB::Object);
__PACKAGE__->meta->table('stock_counting_items');
__PACKAGE__->meta->columns(
bin_id => { type => 'integer', not_null => 1 },
comment => { type => 'text' },
correction_inventory_id => { type => 'integer' },
counted_at => { type => 'timestamp', default => 'now()', not_null => 1 },
counting_id => { type => 'integer', not_null => 1 },
employee_id => { type => 'integer', not_null => 1 },
id => { type => 'integer', not_null => 1, sequence => 'id' },
itime => { type => 'timestamp', default => 'now()', not_null => 1 },
mtime => { type => 'timestamp' },
part_id => { type => 'integer', not_null => 1 },
qty => { type => 'numeric', not_null => 1, precision => 25, scale => 5 },
);
__PACKAGE__->meta->primary_key_columns([ 'id' ]);
__PACKAGE__->meta->allow_inline_column_values(1);
__PACKAGE__->meta->foreign_keys(
bin => {
class => 'SL::DB::Bin',
key_columns => { bin_id => 'id' },
},
correction_inventory => {
class => 'SL::DB::Inventory',
key_columns => { correction_inventory_id => 'id' },
},
counting => {
class => 'SL::DB::StockCounting',
key_columns => { counting_id => 'id' },
},
employee => {
class => 'SL::DB::Employee',
key_columns => { employee_id => 'id' },
},
part => {
class => 'SL::DB::Part',
key_columns => { part_id => 'id' },
},
);
1;
;
SL/DB/StockCounting.pm
# 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::StockCounting;
use strict;
use SL::DB::MetaSetup::StockCounting;
use SL::DB::Manager::StockCounting;
__PACKAGE__->meta->initialize;
1;
SL/DB/StockCountingItem.pm
# 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::StockCountingItem;
use strict;
use SL::DB::MetaSetup::StockCountingItem;
use SL::DB::Manager::StockCountingItem;
__PACKAGE__->meta->initialize;
1;
sql/Pg-upgrade2/stock_countings.sql
-- @tag: stock_countings
-- @description: Tabellen für (Zwischen-)zählungen / Inventuren
-- @depends: warehouse release_3_9_0
CREATE TABLE stock_countings (
id INTEGER NOT NULL DEFAULT nextval('id'),
employee_id INTEGER NOT NULL REFERENCES employee(id),
name TEXT NOT NULL UNIQUE,
description TEXT,
bin_id INTEGER REFERENCES bin(id),
part_id INTEGER REFERENCES parts(id),
partsgroup_id INTEGER REFERENCES partsgroup(id),
vendor_id INTEGER REFERENCES vendor(id),
itime TIMESTAMP DEFAULT now(),
mtime TIMESTAMP,
PRIMARY KEY (id)
);
CREATE TRIGGER mtime_stock_countings BEFORE UPDATE ON stock_countings FOR EACH ROW EXECUTE PROCEDURE set_mtime();
CREATE TABLE stock_counting_items (
id INTEGER NOT NULL DEFAULT nextval('id'),
counting_id INTEGER NOT NULL REFERENCES stock_countings(id),
bin_id INTEGER NOT NULL REFERENCES bin(id),
part_id INTEGER NOT NULL REFERENCES parts(id),
employee_id INTEGER NOT NULL REFERENCES employee(id),
counted_at TIMESTAMP NOT NULL DEFAULT now(),
qty NUMERIC(25,5) NOT NULL,
comment TEXT,
correction_inventory_id INTEGER REFERENCES inventory(id),
itime TIMESTAMP NOT NULL DEFAULT now(),
mtime TIMESTAMP,
PRIMARY KEY (id)
);
CREATE TRIGGER mtime_stock_counting_items BEFORE UPDATE ON stock_counting_items FOR EACH ROW EXECUTE PROCEDURE set_mtime();

Auch abrufbar als: Unified diff