X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FInvoice.pm;h=ad590c79c68da15c6a44b413fdebb6f341376881;hb=19c89dfd42c7766b14de78718066270ad09e20de;hp=fab4974f3490acfba58a044a4b92472c5fb93f88;hpb=a529c3ba6234475a51d5d9f7112ef001c0826201;p=kivitendo-erp.git diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index fab4974f3..ad590c79c 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -555,6 +555,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,12 +578,18 @@ 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; } +sub mark_as_paid { + my ($self) = @_; + + $self->update_attributes(paid => $self->amount); +} + 1; __END__ @@ -760,6 +773,10 @@ Mandatory params are =back +=item C + +Marks the invoice as paid by setting its C member to the value of C. + =back =head1 TODO