X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FMetaSetup%2FGLTransaction.pm;fp=SL%2FDB%2FMetaSetup%2FGLTransaction.pm;h=c8019ebcf10a3951bad953283143ab2ce105d4a6;hb=b8b112a39bd601b0bc717646d78de470631da22a;hp=da199016281fc8df5d22dae761e05aa87120a969;hpb=c09313030ba77f61771483e69179fd916d9328cd;p=kivitendo-erp.git diff --git a/SL/DB/MetaSetup/GLTransaction.pm b/SL/DB/MetaSetup/GLTransaction.pm index da1990162..c8019ebcf 100644 --- a/SL/DB/MetaSetup/GLTransaction.pm +++ b/SL/DB/MetaSetup/GLTransaction.pm @@ -6,44 +6,52 @@ use strict; use base qw(SL::DB::Object); -__PACKAGE__->meta->setup( - table => 'gl', - - columns => [ - id => { type => 'integer', not_null => 1, sequence => 'glid' }, - reference => { type => 'text' }, - description => { type => 'text' }, - transdate => { type => 'date', default => 'now' }, - gldate => { type => 'date', default => 'now' }, - employee_id => { type => 'integer' }, - notes => { type => 'text' }, - department_id => { type => 'integer' }, - taxincluded => { type => 'boolean' }, - itime => { type => 'timestamp', default => 'now()' }, - mtime => { type => 'timestamp' }, - type => { type => 'text' }, - storno => { type => 'boolean', default => 'false' }, - storno_id => { type => 'integer' }, - ob_transaction => { type => 'boolean' }, - cb_transaction => { type => 'boolean' }, - ], - - primary_key_columns => [ 'id' ], - - allow_inline_column_values => 1, - - foreign_keys => [ - department => { - class => 'SL::DB::Department', - key_columns => { department_id => 'id' }, - }, - - storno_obj => { - class => 'SL::DB::GLTransaction', - key_columns => { storno_id => 'id' }, - }, - ], +__PACKAGE__->meta->table('gl'); + +__PACKAGE__->meta->columns( + id => { type => 'integer', not_null => 1, sequence => 'glid' }, + reference => { type => 'text' }, + description => { type => 'text' }, + transdate => { type => 'date', default => 'now' }, + gldate => { type => 'date', default => 'now' }, + employee_id => { type => 'integer' }, + notes => { type => 'text' }, + department_id => { type => 'integer' }, + taxincluded => { type => 'boolean' }, + itime => { type => 'timestamp', default => 'now()' }, + mtime => { type => 'timestamp' }, + type => { type => 'text' }, + storno => { type => 'boolean', default => 'false' }, + storno_id => { type => 'integer' }, + ob_transaction => { type => 'boolean' }, + cb_transaction => { type => 'boolean' }, ); +__PACKAGE__->meta->primary_key_columns([ 'id' ]); + +__PACKAGE__->meta->allow_inline_column_values(1); + +__PACKAGE__->meta->foreign_keys( + department => { + class => 'SL::DB::Department', + key_columns => { department_id => 'id' }, + }, + + storno_obj => { + class => 'SL::DB::GLTransaction', + key_columns => { storno_id => 'id' }, + }, +); + +__PACKAGE__->meta->relationships( + gl => { + class => 'SL::DB::GLTransaction', + column_map => { id => 'storno_id' }, + type => 'one to many', + }, +); + +# __PACKAGE__->meta->initialize; + 1; ;