X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=d6ec6c8535bbfc23504262b8639ee83bb5fffd6e;hb=d1d70f4ad540f4d57d1b577b337b6db38074e223;hp=44b81dfd09cd9ebc46dfa07eb830597297565578;hpb=0abce1b8f3abc5d6b0980ded98c4706d8f94998c;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 44b81dfd0..d6ec6c853 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; @@ -578,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; } @@ -714,7 +720,7 @@ See L. =item C Returns 1 or 0, depending on whether the invoice is closed or not. Currently -invoices that are overpaid also count as closed. +invoices that are overpaid also count as closed and credit notes in general. =item C