From: G. Richardson Date: Mon, 6 Feb 2017 09:12:39 +0000 (+0100) Subject: oneline_summary mit Rechnungsbeträgen X-Git-Tag: release-3.5.4~1527 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0abce1b8f3abc5d6b0980ded98c4706d8f94998c;p=kivitendo-erp.git oneline_summary mit Rechnungsbeträgen Bei Belegen wird der Bruttobetrag angezeigt. Bei Dialogbuchungen wird die Summe aller Haben-Buchungen als Betrag angezeigt. --- diff --git a/SL/DB/GLTransaction.pm b/SL/DB/GLTransaction.pm index c9f436056..2ad8e0c0d 100644 --- a/SL/DB/GLTransaction.pm +++ b/SL/DB/GLTransaction.pm @@ -4,6 +4,7 @@ use strict; use SL::DB::MetaSetup::GLTransaction; use SL::Locale::String qw(t8); +use List::Util qw(sum); # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. __PACKAGE__->meta->make_manager_class; @@ -36,7 +37,9 @@ sub displayable_type { sub oneline_summary { my ($self) = @_; - return sprintf("%s: %s %s (%s)", $self->abbreviation, $self->description, $self->reference, $_->transdate->to_kivitendo); + my $amount = sum map { $_->amount if $_->amount > 0 } @{$self->transactions}; + $amount = $::form->format_amount(\%::myconfig, $amount, 2); + return sprintf("%s: %s %s %s (%s)", $self->abbreviation, $self->description, $self->reference, $amount, $self->transdate->to_kivitendo); } sub link { diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 4caafc0b0..44b81dfd0 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -558,7 +558,8 @@ sub abbreviation { sub oneline_summary { my $self = shift; - return sprintf("%s: %s %s (%s)", $self->abbreviation, $self->invnumber, $self->customer->name, $self->transdate->to_kivitendo); + 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 { diff --git a/SL/DB/PurchaseInvoice.pm b/SL/DB/PurchaseInvoice.pm index 102cd8a52..631816591 100644 --- a/SL/DB/PurchaseInvoice.pm +++ b/SL/DB/PurchaseInvoice.pm @@ -91,7 +91,8 @@ 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); + return sprintf("%s: %s %s %s (%s)", $self->abbreviation, $self->invnumber, $self->vendor->name, + $::form->format_amount(\%::myconfig, $self->amount,2), $self->transdate->to_kivitendo); } sub link {