]> wagnertech.de Git - mfinanz.git/blob - SL/BackgroundJob/UpdateExchangerates/SimpleTest.pm
kivitendo 3.9.2-0.2
[mfinanz.git] / SL / BackgroundJob / UpdateExchangerates / SimpleTest.pm
1 package SL::BackgroundJob::UpdateExchangerates::SimpleTest;
2
3 use strict;
4 use utf8;
5
6 use parent qw(SL::BackgroundJob::UpdateExchangerates::Base);
7
8
9 sub update_rates {
10   my ($self, $rates) = @_;
11
12   foreach my $rate (@$rates) {
13     my $from = $self->translate_currency_name($rate->{from}->name);
14     my $to   = $self->translate_currency_name($rate->{to}->name);
15     if ( $from eq 'EUR' && $to eq 'USD') {
16       $rate->{rate} = 0.9205 if $rate->{dir} eq 'buy';
17       $rate->{rate} = 0.9202 if $rate->{dir} eq 'sell';
18     }
19   }
20 }
21
22 1;