X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FHelper%2FMT940.pm;h=c25fd5962d14c3856d07a720fe6742b4a7f68af8;hb=a44b04878198d94a18adf3867c4ba227a0d9d3ff;hp=63f637eed56b31ef213574253e5f8971dd19ee80;hpb=e0cc4726f00812a8aa1f6f60bad56b1cf71152e5;p=kivitendo-erp.git diff --git a/SL/Helper/MT940.pm b/SL/Helper/MT940.pm index 63f637eed..c25fd5962 100644 --- a/SL/Helper/MT940.pm +++ b/SL/Helper/MT940.pm @@ -15,14 +15,20 @@ sub convert_mt940_data { $sfile->fh->print($mt940_data); $sfile->fh->close; + # create needed dir structure for aqbanking 5.x and 6.x my $todir = $sfile->get_path . '/imexporters/csv/profiles'; mkpath $todir; + die "Cannot create $todir" unless -d $todir; + File::Copy::copy('users/aqbanking.conf', $todir.'/kivi.conf'); + die "Cannot create local aqbanking conf " unless -f $todir.'/kivi.conf'; + + mkpath $sfile->get_path . '/settings6/aqbanking'; 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=kivi 2> /dev/null "; + $sfile->get_path . "/$import_filename | $aqbin --cfgdir=\"" . $sfile->get_path . "\" export --profile=kivi 2> /dev/null "; 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";'.