From 0abce1b8f3abc5d6b0980ded98c4706d8f94998c Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 6 Feb 2017 10:12:39 +0100 Subject: [PATCH] =?utf8?q?oneline=5Fsummary=20mit=20Rechnungsbetr=C3=A4gen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bei Belegen wird der Bruttobetrag angezeigt. Bei Dialogbuchungen wird die Summe aller Haben-Buchungen als Betrag angezeigt. --- SL/DB/GLTransaction.pm | 5 ++++- SL/DB/Invoice.pm | 3 ++- SL/DB/PurchaseInvoice.pm | 3 ++- 3 files changed, 8 insertions(+), 3 deletions(-) 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 { -- 2.20.1