Revision 69e31dd3
Von Jan Büren vor etwa 10 Jahren hinzugefügt
SL/DB/OrderItem.pm | ||
---|---|---|
37 | 37 |
sub delivered_qty { |
38 | 38 |
my ($self) = @_; |
39 | 39 |
|
40 |
$self->_delivered_qty; |
|
41 |
return $self->{delivered_qty}; |
|
40 |
return $self->_delivered_qty; |
|
42 | 41 |
} |
43 | 42 |
|
44 | 43 |
sub _delivered_qty { |
45 | 44 |
my ($self) = @_; |
46 | 45 |
|
47 |
return if $self->{delivered_qty}; |
|
46 |
return $self->{delivered_qty} if $self->{delivered_qty};
|
|
48 | 47 |
|
49 | 48 |
my $d_orders = $self->order->linked_records(direction => 'to', to => 'SL::DB::DeliveryOrder'); |
50 | 49 |
|
... | ... | |
54 | 53 |
|
55 | 54 |
require SL::AM; |
56 | 55 |
$self->{delivered_qty} = sum(map { AM->convert_unit($_->unit => $self->unit) * $_->qty } @doi_delivered); |
56 |
|
|
57 |
return $self->{delivered_qty}; |
|
57 | 58 |
} |
58 | 59 |
|
59 | 60 |
sub value_of_goods { |
Auch abrufbar als: Unified diff
weitere Verbesserungen für die helper-funktion
Die Funktion sollte unabhängig vom Variablen-Namen sein, damit dies
langfristig einfacher wartbar ist.