use Carp;
use List::Util qw(sum min);
-use SL::DB::Default;
-use SL::DB::PriceFactor;
-use SL::DB::Unit;
sub calculate_prices_and_taxes {
my ($self, %params) = @_;
+ require SL::DB::PriceFactor;
+ require SL::DB::Unit;
+
my %units_by_name = map { ( $_->name => $_ ) } @{ SL::DB::Manager::Unit->get_all };
my %price_factors_by_id = map { ( $_->id => $_ ) } @{ SL::DB::Manager::PriceFactor->get_all };
sub _get_exchangerate {
my ($self, $data, %params) = @_;
+ require SL::DB::Default;
my $currency = $self->currency_id ? $self->currency->name || '' : '';
if ($currency ne SL::DB::Default->get_default_currency) {