X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FDB%2FBuchungsgruppe.pm;fp=SL%2FDB%2FBuchungsgruppe.pm;h=cad8bb628605d0a6ad2403d0872ff4fc83984b29;hp=9074fb90bfd41ed4a9bbea001b94bbaf3a8c7237;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/SL/DB/Buchungsgruppe.pm b/SL/DB/Buchungsgruppe.pm index 9074fb90b..cad8bb628 100644 --- a/SL/DB/Buchungsgruppe.pm +++ b/SL/DB/Buchungsgruppe.pm @@ -6,16 +6,10 @@ use SL::DB::MetaSetup::Buchungsgruppe; use SL::DB::Manager::Buchungsgruppe; use SL::DB::Helper::ActsAsList; -__PACKAGE__->meta->add_relationship( - inventory_account => { - type => 'many to one', - class => 'SL::DB::Chart', - column_map => { inventory_accno_id => 'id' }, - }, -); - __PACKAGE__->meta->initialize; +sub inventory_account { goto &inventory_accno; } + sub validate { my ($self) = @_; @@ -24,9 +18,9 @@ sub validate { if( $self->inventory_accno_id ) { require SL::DB::Chart; my $inventory_accno = SL::DB::Manager::Chart->find_by( id => $self->inventory_accno_id ); - push(@errors, $::locale->text('Buchungsgruppe #1 needs a valid inventory account', $self->description)) unless $inventory_accno; + push(@errors, $::locale->text('Booking group #1 needs a valid inventory account', $self->description)) unless $inventory_accno; } else { - push @errors, $::locale->text('The Buchungsgruppe needs an inventory account.'); + push @errors, $::locale->text('The booking group needs an inventory account.'); }; return @errors;