X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FMetaSetup%2FPeriodicInvoicesConfig.pm;fp=SL%2FDB%2FMetaSetup%2FPeriodicInvoicesConfig.pm;h=414918a64dd741cfdc96027334cf0a872c814343;hb=b8b112a39bd601b0bc717646d78de470631da22a;hp=8860e8c8054104ec6563ac5335839b18d1747775;hpb=c09313030ba77f61771483e69179fd916d9328cd;p=kivitendo-erp.git diff --git a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm index 8860e8c80..414918a64 100644 --- a/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm +++ b/SL/DB/MetaSetup/PeriodicInvoicesConfig.pm @@ -6,43 +6,47 @@ use strict; use base qw(SL::DB::Object); -__PACKAGE__->meta->setup( - table => 'periodic_invoices_configs', - - columns => [ - id => { type => 'integer', not_null => 1, sequence => 'id' }, - oe_id => { type => 'integer', not_null => 1 }, - periodicity => { type => 'varchar', length => 10, not_null => 1 }, - print => { type => 'boolean', default => 'false' }, - printer_id => { type => 'integer' }, - copies => { type => 'integer' }, - active => { type => 'boolean', default => 'true' }, - start_date => { type => 'date' }, - ar_chart_id => { type => 'integer', not_null => 1 }, - terminated => { type => 'boolean', default => 'false' }, - end_date => { type => 'date' }, - extend_automatically_by => { type => 'integer' }, - ], - - primary_key_columns => [ 'id' ], - - foreign_keys => [ - ar_chart => { - class => 'SL::DB::Chart', - key_columns => { ar_chart_id => 'id' }, - }, - - order => { - class => 'SL::DB::Order', - key_columns => { oe_id => 'id' }, - }, - - printer => { - class => 'SL::DB::Printer', - key_columns => { printer_id => 'id' }, - }, - ], +__PACKAGE__->meta->table('periodic_invoices_configs'); + +__PACKAGE__->meta->columns( + id => { type => 'integer', not_null => 1, sequence => 'id' }, + oe_id => { type => 'integer', not_null => 1 }, + periodicity => { type => 'varchar', length => 10, not_null => 1 }, + print => { type => 'boolean', default => 'false' }, + printer_id => { type => 'integer' }, + copies => { type => 'integer' }, + active => { type => 'boolean', default => 'true' }, + terminated => { type => 'boolean', default => 'false' }, + start_date => { type => 'date' }, + end_date => { type => 'date' }, + ar_chart_id => { type => 'integer', not_null => 1 }, + extend_automatically_by => { type => 'integer' }, ); +__PACKAGE__->meta->primary_key_columns([ 'id' ]); + +__PACKAGE__->meta->foreign_keys( + ar_chart => { + class => 'SL::DB::Chart', + key_columns => { ar_chart_id => 'id' }, + }, + + oe => { + class => 'SL::DB::Order', + key_columns => { oe_id => 'id' }, + }, +); + +__PACKAGE__->meta->relationships( + ars => { + map_class => 'SL::DB::PeriodicInvoice', + map_from => 'config', + map_to => 'ar', + type => 'many to many', + }, +); + +# __PACKAGE__->meta->initialize; + 1; ;