From 69e31dd3fe8ba3fcb7ba947281441efeef71142c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 10 Nov 2014 18:46:46 +0100 Subject: [PATCH] =?utf8?q?weitere=20Verbesserungen=20f=C3=BCr=20die=20help?= =?utf8?q?er-funktion?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Die Funktion sollte unabhängig vom Variablen-Namen sein, damit dies langfristig einfacher wartbar ist. --- SL/DB/OrderItem.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/DB/OrderItem.pm b/SL/DB/OrderItem.pm index 0c28a5243..5e8aad0cc 100644 --- a/SL/DB/OrderItem.pm +++ b/SL/DB/OrderItem.pm @@ -37,14 +37,13 @@ sub shipped_qty { sub delivered_qty { my ($self) = @_; - $self->_delivered_qty; - return $self->{delivered_qty}; + return $self->_delivered_qty; } sub _delivered_qty { my ($self) = @_; - return if $self->{delivered_qty}; + return $self->{delivered_qty} if $self->{delivered_qty}; my $d_orders = $self->order->linked_records(direction => 'to', to => 'SL::DB::DeliveryOrder'); @@ -54,6 +53,8 @@ sub _delivered_qty { require SL::AM; $self->{delivered_qty} = sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi_delivered); + + return $self->{delivered_qty}; } sub value_of_goods { -- 2.20.1