Revision 401fc133
Von Bernd Bleßmann vor fast 8 Jahren hinzugefügt
SL/Controller/BankImport.pm | ||
---|---|---|
6 | 6 |
use SL::Locale::String qw(t8); |
7 | 7 |
use SL::DB::CsvImportProfile; |
8 | 8 |
use SL::Helper::MT940; |
9 |
use SL::SessionFile::Random; |
|
9 | 10 |
|
10 | 11 |
use Rose::Object::MakeMethods::Generic |
11 | 12 |
( |
... | ... | |
28 | 29 |
|
29 | 30 |
my $converted_data = SL::Helper::MT940::convert_mt940_data($::form->{file}); |
30 | 31 |
|
31 |
# store the converted data in a session file with a name expected by the profile type "bank_transactions"
|
|
32 |
my $file = SL::SessionFile->new("csv-import-bank_transactions.csv", mode => '>');
|
|
32 |
# store the converted data in a session file and create a temporary profile with it's name
|
|
33 |
my $file = SL::SessionFile::Random->new(mode => '>');
|
|
33 | 34 |
$file->fh->print($converted_data); |
34 | 35 |
$file->fh->close; |
36 |
$self->profile->set('file_name', $file->file_name); |
|
37 |
$self->profile($self->profile->clone_and_reset_deep)->save; |
|
35 | 38 |
|
36 | 39 |
die t8("The MT940 import needs an import profile called MT940") unless $self->profile; |
37 | 40 |
|
Auch abrufbar als: Unified diff
BankImport: Csv-Datei mit zufälligem Dateinamen speichern und im Profil übergeben
siehe auch commit "CsvImport: zufälligen Dateinamen für jeden Import. Ablegen in
temporärem Profil"