From 401fc1332354d92fc62784d39cd3e98ff755cee1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 20 Feb 2017 21:09:03 +0100 Subject: [PATCH] =?utf8?q?BankImport:=20Csv-Datei=20mit=20zuf=C3=A4lligem?= =?utf8?q?=20Dateinamen=20speichern=20und=20im=20Profil=20=C3=BCbergeben?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit siehe auch commit "CsvImport: zufälligen Dateinamen für jeden Import. Ablegen in temporärem Profil" --- SL/Controller/BankImport.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SL/Controller/BankImport.pm b/SL/Controller/BankImport.pm index 7e08fc603..bc65d17b7 100644 --- a/SL/Controller/BankImport.pm +++ b/SL/Controller/BankImport.pm @@ -6,6 +6,7 @@ use parent qw(SL::Controller::Base); use SL::Locale::String qw(t8); use SL::DB::CsvImportProfile; use SL::Helper::MT940; +use SL::SessionFile::Random; use Rose::Object::MakeMethods::Generic ( @@ -28,10 +29,12 @@ sub action_import_mt940 { my $converted_data = SL::Helper::MT940::convert_mt940_data($::form->{file}); - # store the converted data in a session file with a name expected by the profile type "bank_transactions" - my $file = SL::SessionFile->new("csv-import-bank_transactions.csv", mode => '>'); + # store the converted data in a session file and create a temporary profile with it's name + my $file = SL::SessionFile::Random->new(mode => '>'); $file->fh->print($converted_data); $file->fh->close; + $self->profile->set('file_name', $file->file_name); + $self->profile($self->profile->clone_and_reset_deep)->save; die t8("The MT940 import needs an import profile called MT940") unless $self->profile; -- 2.20.1