X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=c824624514041b16b2eb52e6f345aa9ff15bba09;hb=c13f301e71da717b09f3c7364a9f0c87c4f7a4ea;hp=0ef8d614e842f68c3d7927c94ea8890e17ba916e;hpb=b186a8eb0ff43ca1d67e7416f1eef2d11bf4501a;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 0ef8d614e..c82462451 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -60,6 +60,12 @@ __PACKAGE__->meta->add_relationship( sort_by => 'acc_trans_id ASC', }, }, + dunnings => { + type => 'one to many', + class => 'SL::DB::Dunning', + column_map => { id => 'trans_id' }, + manager_args => { with_objects => [ 'dunnings' ] } + }, ); __PACKAGE__->meta->initialize; @@ -555,6 +561,13 @@ sub abbreviation { return t8('Invoice (one letter abbreviation)'); } +sub oneline_summary { + my $self = shift; + + return sprintf("%s: %s %s %s (%s)", $self->abbreviation, $self->invnumber, $self->customer->name, + $::form->format_amount(\%::myconfig, $self->amount,2), $self->transdate->to_kivitendo); +} + sub date { goto &transdate; } @@ -571,8 +584,8 @@ sub link { my ($self) = @_; my $html; - $html = SL::Presenter->get->sales_invoice($self, display => 'inline') if $self->invoice; - $html = SL::Presenter->get->ar_transaction($self, display => 'inline') if !$self->invoice; + $html = $self->presenter->sales_invoice(display => 'inline') if $self->invoice; + $html = $self->presenter->ar_transaction(display => 'inline') if !$self->invoice; return $html; }