From: Sven Schöling Date: Thu, 16 Apr 2015 12:19:30 +0000 (+0200) Subject: PriceSource: Implementoren zwischen price/discount cachen. X-Git-Tag: release-3.3.0beta~147 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1c311d64f260430ee33bc8aeda03aeb5f437d9a9;p=kivitendo-erp.git PriceSource: Implementoren zwischen price/discount cachen. --- diff --git a/SL/PriceSource.pm b/SL/PriceSource.pm index 7ca287ded..c8cdc6cd1 100644 --- a/SL/PriceSource.pm +++ b/SL/PriceSource.pm @@ -4,6 +4,7 @@ use strict; use parent 'SL::DB::Object'; use Rose::Object::MakeMethods::Generic ( scalar => [ qw(record_item record) ], + 'array --get_set_init' => [ qw(all_price_sources) ], ); use List::UtilsBy qw(min_by max_by); @@ -11,12 +12,12 @@ use SL::PriceSource::ALL; use SL::PriceSource::Price; use SL::Locale::String; -sub all_price_sources { +sub init_all_price_sources { my ($self) = @_; - map { + [ map { $_->new(record_item => $self->record_item, record => $self->record) - } SL::PriceSource::ALL->all_enabled_price_sources + } SL::PriceSource::ALL->all_enabled_price_sources ] } sub price_from_source {