X-Git-Url: http://wagnertech.de/git?p=kivitendo-erp.git;a=blobdiff_plain;f=SL%2FHelper%2FMT940.pm;fp=SL%2FHelper%2FMT940.pm;h=0000000000000000000000000000000000000000;hp=5c8865d028bd202d3991c4b055e44abc6569b40b;hb=53593baa211863fbf66540cf1bcc36c8fb37257f;hpb=deb4d2dbb676d7d6f69dfe7815d6e0cb09bd4a44 diff --git a/SL/Helper/MT940.pm b/SL/Helper/MT940.pm deleted file mode 100644 index 5c8865d02..000000000 --- a/SL/Helper/MT940.pm +++ /dev/null @@ -1,31 +0,0 @@ -package SL::Helper::MT940; - -use strict; - -sub convert_mt940_data { - my ($mt940_data) = @_; - - # takes the data from an uploaded mt940 file, converts it to csv via aqbanking and returns the converted data - # The uploaded file data is stored as a session file, just like the aqbanking settings file. - - my $import_filename = 'bank_transfer.940'; - my $sfile = SL::SessionFile->new($import_filename, mode => '>'); - $sfile->fh->print($mt940_data); - $sfile->fh->close; - - my $aqbin = $::lx_office_conf{applications}->{aqbanking}; - die "Can't find aqbanking-cli, please check your configuration file.\n" unless -f $aqbin; - my $cmd = "$aqbin --cfgdir=\"" . $sfile->get_path . "\" import --importer=\"swift\" --profile=\"SWIFT-MT940\" -f " . $sfile->get_path . "/$import_filename | $aqbin --cfgdir=\"" . $sfile->get_path . "\" listtrans --exporter=\"csv\" --profile=\"AqMoney2\" "; - - my $converted_data = '"empty";"local_bank_code";"local_account_number";"remote_bank_code";"remote_account_number";"transdate";"valutadate";"amount";"currency";"remote_name";"remote_name_1";"purpose";"purpose1";"purpose2";"purpose3";"purpose4";"purpose5";"purpose6";"purpose7";"purpose8";"purpose9";"purpose10";"purpose11"' . "\n"; - - open my $mt, "-|", "$cmd" || die "Problem with executing aqbanking\n"; - my $headerline = <$mt>; # discard original aqbanking header line - while (<$mt>) { - $converted_data .= $_; - }; - close $mt; - return $converted_data; -}; - -1;