X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FGLTransaction.pm;h=a92271f125a6dd8fb709e4a55c39833f318f1891;hb=2ef19c818a05b2baa2552ae5b4edbcc16bcfc986;hp=52c8b6e2e28aff250d9ed84000134546d66b862a;hpb=0395c0364adb8fde7442c6b11ab064e406fd7776;p=kivitendo-erp.git diff --git a/SL/DB/GLTransaction.pm b/SL/DB/GLTransaction.pm index 52c8b6e2e..a92271f12 100644 --- a/SL/DB/GLTransaction.pm +++ b/SL/DB/GLTransaction.pm @@ -3,7 +3,8 @@ package SL::DB::GLTransaction; use strict; use SL::DB::MetaSetup::GLTransaction; - +use SL::Locale::String qw(t8); +use List::Util qw(sum); # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. __PACKAGE__->meta->make_manager_class; @@ -28,7 +29,32 @@ sub abbreviation { my $abbreviation = $::locale->text('GL Transaction (abbreviation)'); $abbreviation .= "(" . $::locale->text('Storno (one letter abbreviation)') . ")" if $self->storno; return $abbreviation; +} + +sub displayable_type { + return t8('GL Transaction'); +} +sub oneline_summary { + my ($self) = @_; + my $amount = sum map { $_->amount if $_->amount > 0 } @{$self->transactions}; + $amount = $::form->format_amount(\%::myconfig, $amount, 2); + return sprintf("%s: %s %s %s (%s)", $self->abbreviation, $self->description, $self->reference, $amount, $self->transdate->to_kivitendo); } +sub link { + my ($self) = @_; + + my $html; + $html = $self->presenter->gl_transaction(display => 'inline'); + + return $html; +} + +sub invnumber { + return $_[0]->reference; +} + +sub date { goto &gldate } + 1;