X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/90e59318411f63c95a7e803b4383d75ec72427a8..7ca30d76589b74e1b84c1a182550e33ebf618372:/SL/DB/Invoice.pm diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 753ca3c5a..4caafc0b0 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -165,7 +165,6 @@ sub new_from { $terms = $source->customer->payment_terms if !defined $terms && $source->customer; my %args = ( map({ ( $_ => $source->$_ ) } qw(customer_id taxincluded shippingpoint shipvia notes intnotes salesman_id cusordnumber ordnumber department_id - shipto_id cp_id language_id taxzone_id globalproject_id transaction_description currency_id delivery_term_id), @columns), transdate => DateTime->today_local, gldate => DateTime->today_local, @@ -556,6 +555,12 @@ sub abbreviation { return t8('Invoice (one letter abbreviation)'); } +sub oneline_summary { + my $self = shift; + + return sprintf("%s: %s %s (%s)", $self->abbreviation, $self->invnumber, $self->customer->name, $self->transdate->to_kivitendo); +} + sub date { goto &transdate; } @@ -578,6 +583,12 @@ sub link { return $html; } +sub mark_as_paid { + my ($self) = @_; + + $self->update_attributes(paid => $self->amount); +} + 1; __END__ @@ -761,6 +772,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