X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FBankImport.pm;h=1b20deca3b8a2705506c38b1aba1dedc044ab44b;hb=502a10d47975bb857364282ac2bfe7f995b21a86;hp=04d72d368a03b11f3bc0bf048663a35a4deeeabc;hpb=789de0c020f6aa3c289c1c74c3df98f076b3eef6;p=kivitendo-erp.git diff --git a/SL/Controller/BankImport.pm b/SL/Controller/BankImport.pm index 04d72d368..1b20deca3 100644 --- a/SL/Controller/BankImport.pm +++ b/SL/Controller/BankImport.pm @@ -16,7 +16,7 @@ use SL::SessionFile::Random; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(file_name transactions statistics) ], + scalar => [ qw(file_name transactions statistics charset) ], 'scalar --get_set_init' => [ qw(bank_accounts) ], ); @@ -43,6 +43,7 @@ sub action_import_mt940_preview { $file->fh->print($::form->{file}); $file->fh->close; + $self->charset($::form->{charset}); $self->file_name($file->file_name); $self->parse_and_analyze_transactions; @@ -56,6 +57,7 @@ sub action_import_mt940 { die "missing file for action import_mt940" unless $::form->{file_name}; $self->file_name($::form->{file_name}); + $self->charset($::form->{charset}); $self->parse_and_analyze_transactions; $self->import_transactions; @@ -71,7 +73,7 @@ sub parse_and_analyze_transactions { my $currency_id = SL::DB::Default->get->currency_id; - $self->transactions([ sort { $a->{transdate} cmp $b->{transdate} } SL::MT940->parse($self->file_name) ]); + $self->transactions([ sort { $a->{transdate} cmp $b->{transdate} } SL::MT940->parse($self->file_name, charset => $self->charset) ]); foreach my $transaction (@{ $self->transactions }) { $transaction->{bank_account} = $self->bank_accounts->{ make_bank_account_idx($transaction->{local_bank_code}, $transaction->{local_account_number}) };