Oneline summary for GLTransaction/Invoice/PurchaseInvoice
[kivitendo-erp.git] / SL / DB / Invoice.pm
index fab4974..4caafc0 100644 (file)
@@ -555,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;
 }
@@ -577,6 +583,12 @@ sub link {
   return $html;
 }
 
+sub mark_as_paid {
+  my ($self) = @_;
+
+  $self->update_attributes(paid => $self->amount);
+}
+
 1;
 
 __END__
@@ -760,6 +772,10 @@ Mandatory params are
 
 =back
 
+=item C<mark_as_paid>
+
+Marks the invoice as paid by setting its C<paid> member to the value of C<amount>.
+
 =back
 
 =head1 TODO