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', default => '0' },
- 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 => [
- storno_obj => {
- class => 'SL::DB::GLTransaction',
- key_columns => { storno_id => 'id' },
- },
- ],
+__PACKAGE__->meta->table('gl');
+
+__PACKAGE__->meta->columns(
+ cb_transaction => { type => 'boolean' },
+ department_id => { type => 'integer' },
+ description => { type => 'text' },
+ employee_id => { type => 'integer' },
+ gldate => { type => 'date', default => 'now' },
+ id => { type => 'integer', not_null => 1, sequence => 'glid' },
+ itime => { type => 'timestamp', default => 'now()' },
+ mtime => { type => 'timestamp' },
+ notes => { type => 'text' },
+ ob_transaction => { type => 'boolean' },
+ reference => { type => 'text' },
+ storno => { type => 'boolean', default => 'false' },
+ storno_id => { type => 'integer' },
+ taxincluded => { type => 'boolean' },
+ transdate => { type => 'date', default => 'now' },
+ type => { type => 'text' },
+);
+
+__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' },
+ },
+
+ employee => {
+ class => 'SL::DB::Employee',
+ key_columns => { employee_id => 'id' },
+ },
+
+ storno_obj => {
+ class => 'SL::DB::GLTransaction',
+ key_columns => { storno_id => 'id' },
+ },
);
1;