From: G. Richardson Date: Sun, 29 Jan 2017 14:34:02 +0000 (+0100) Subject: Oneline summary for GLTransaction/Invoice/PurchaseInvoice X-Git-Tag: release-3.5.4~1618 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=a5e4f9ca835489c2250db39f2c3abe6ac4ba04e6;p=kivitendo-erp.git Oneline summary for GLTransaction/Invoice/PurchaseInvoice to be used e.g. in Fibu Quicksearch --- diff --git a/SL/DB/GLTransaction.pm b/SL/DB/GLTransaction.pm index 67a4d3aca..3b9612e9e 100644 --- a/SL/DB/GLTransaction.pm +++ b/SL/DB/GLTransaction.pm @@ -30,6 +30,11 @@ sub abbreviation { return $abbreviation; } +sub oneline_summary { + my ($self) = @_; + return sprintf("%s: %s %s (%s)", $self->abbreviation, $self->description, $self->reference, $_->transdate->to_kivitendo); +} + sub link { my ($self) = @_; diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 0ef8d614e..4caafc0b0 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -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; } diff --git a/SL/DB/PurchaseInvoice.pm b/SL/DB/PurchaseInvoice.pm index 08be07f33..102cd8a52 100644 --- a/SL/DB/PurchaseInvoice.pm +++ b/SL/DB/PurchaseInvoice.pm @@ -88,6 +88,12 @@ sub abbreviation { }; +sub oneline_summary { + my $self = shift; + + return sprintf("%s: %s %s (%s)", $self->abbreviation, $self->invnumber, $self->vendor->name, $self->transdate->to_kivitendo); +} + sub link { my ($self) = @_;