X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/fd6f0f820608b7d85f8eb0881017bb390fd1e212..c278188fcf666c63180050059585657c952ed9bc:/SL/PriceSource.pm diff --git a/SL/PriceSource.pm b/SL/PriceSource.pm index 7ca287ded..681210c00 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 { @@ -156,9 +157,30 @@ L, L, L -=head1 BUGS +=head1 BUGS AND CAVEATS -None yet. :) +=over 4 + +=item * + +The current simple model of price sources providing a simple value in simple +cases doesn't work well in situations where prices are modified by other +properties. The same problem also causes headaches when trying to use price +sources to compute positions in assemblies. + +The solution should be to split price sources in simple ones, which do not +manage their interactions with record_items, but can be used in contexts +without record_items, and complex ones which do, but have to be fed a dummy +record_item. For the former there should be a wrapper that handles interactions +with units, price_factors etc.. + +=item * + +Currently it is only possible to provide additional prices, but not to restrict +prices. Potential scenarios include credit limit customers which do not receive +benefits from sales, or general ALLOW, DENY order calculation. + +=back =head1 AUTHOR