X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fdatev.pl;h=5f8c61e4353d6a2697fd54d340d19726cf2c2f91;hb=b3bde077a6df1550915b1433b2cabb4cf74ab681;hp=9944abfba13e699fe72a2e19c69aaf32c5402082;hpb=a14a3ff56b00e22c39a2cfb0e465f8c7764a4cd4;p=kivitendo-erp.git
diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl
index 9944abfba..5f8c61e43 100644
--- a/bin/mozilla/datev.pl
+++ b/bin/mozilla/datev.pl
@@ -35,11 +35,15 @@ use SL::DATEV;
# end of main
-sub continue { &{ $form->{nextsub} } }
+require "bin/mozilla/common.pl";
+
+sub continue { call_sub($form->{"nextsub"}); }
sub export {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
$form->{title} = $locale->text("DATEX - Export Assistent");
DATEV->get_datev_stamm(\%myconfig, \%$form);
@@ -80,7 +84,7 @@ sub export {
| . $locale->text("Mandantennummer") . qq| |
|
- | . $locale->text("Datenträgernummer") . qq| |
+ | . $locale->text("Medium Number") . qq| |
|
@@ -111,10 +115,6 @@ sub export {
-{path}>
-{login}>
-{password}>
-
@@ -129,6 +129,8 @@ sub export {
sub export2 {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
if ($form->{exporttype} == 0) {
&export_bewegungsdaten();
} else {
@@ -140,6 +142,8 @@ sub export2 {
sub export_bewegungsdaten {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
$form->{title} = $locale->text("DATEX - Export Assistent");
$form->{allemonate} =
@@ -246,10 +250,6 @@ sub export_bewegungsdaten {
-{path}>
-{login}>
-{password}>
-
@@ -265,6 +265,8 @@ sub export_bewegungsdaten {
sub export_stammdaten {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
$form->{title} = $locale->text("DATEX - Export Assistent");
$form->header;
@@ -312,10 +314,6 @@ sub export_stammdaten {
-{path}>
-{login}>
-{password}>
-
@@ -331,30 +329,35 @@ sub export_stammdaten {
sub export3 {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
+ DATEV::clean_temporary_directories();
+
DATEV->save_datev_stamm(\%myconfig, \%$form);
- my $link = $form->{"script"} . "?";
- map({ $link .= "${_}=" . $form->escape($form->{$_}) . "&"; } qw(path login password));
- $link .= "action=download";
+ my $link = "datev.pl?action=download&download_token=";
if ($form->{kne}) {
- my @filenames = DATEV->kne_export(\%myconfig, \%$form);
- if (@filenames) {
- print(qq|
| . $locale->text('KNE-Export erfolgreich!') . qq|
|);
- $link .= "&filenames=" . $form->escape(join(":", @filenames));
- print(qq|
Download|);
+ my $result = DATEV->kne_export(\%myconfig, \%$form);
+ if ($result && @{ $result->{filenames} }) {
+ $link .= Q($result->{download_token});
+
+ print(qq|
| . $locale->text('KNE-Export erfolgreich!') . qq|
Download|);
+
} else {
$form->error("KNE-Export schlug fehl.");
}
} else {
- my @filenames = DATEV->obe_export(\%myconfig, \%$form);
- if (@filenames) {
- print(qq|
| . $locale->text('OBE-Export erfolgreich!') . qq|
|);
- $link .= "&filenames=" . $form->escape(join(":", @filenames));
- print(qq|
Download|);
- } else {
- $form->error("OBE-Export schlug fehl.");
- }
+ # OBE-Export nicht implementiert.
+
+ # my @filenames = DATEV->obe_export(\%myconfig, \%$form);
+ # if (@filenames) {
+ # print(qq|
| . $locale->text('OBE-Export erfolgreich!') . qq|
|);
+ # $link .= "&filenames=" . $form->escape(join(":", @filenames));
+ # print(qq|
Download|);
+ # } else {
+ # $form->error("OBE-Export schlug fehl.");
+ # }
}
print("