X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fdatev.pl;h=5f8c61e4353d6a2697fd54d340d19726cf2c2f91;hb=34211d2356367e21aa8f624caa7b17ee4b8ec4ac;hp=62a1cf006bdefc084c43414ec606429ad1c7f6db;hpb=72539cb39a3d19f930a8e0e41e46bf41afe9a8f1;p=kivitendo-erp.git
diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl
index 62a1cf006..5f8c61e43 100644
--- a/bin/mozilla/datev.pl
+++ b/bin/mozilla/datev.pl
@@ -25,17 +25,25 @@
#
#======================================================================
+use POSIX qw(strftime getcwd);
+use Archive::Zip qw(:ERROR_CODES :CONSTANTS);
+
+use SL::Common;
use SL::DATEV;
1;
# 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);
@@ -76,17 +84,18 @@ sub export {
| . $locale->text("Mandantennummer") . qq| |
|
- | . $locale->text("Datenträgernummer") . qq| |
+ | . $locale->text("Medium Number") . qq| |
|
- |
- . $locale->text("Kontonummernerweiterung (KNE)") . qq| |
+ | . # OBE-Export noch nicht implementiert! | . $locale->text("Kontonummernerweiterung (KNE)") . qq| |
+ qq| |
|
| . $locale->text("Abrechnungsnummer") . qq| |
|
+
|
. $locale->text("Export Buchungsdaten") . qq| |
@@ -106,10 +115,6 @@ sub export {
-{path}>
-{login}>
-{password}>
-
@@ -124,6 +129,8 @@ sub export {
sub export2 {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
if ($form->{exporttype} == 0) {
&export_bewegungsdaten();
} else {
@@ -135,6 +142,8 @@ sub export2 {
sub export_bewegungsdaten {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
$form->{title} = $locale->text("DATEX - Export Assistent");
$form->{allemonate} =
@@ -173,6 +182,7 @@ sub export_bewegungsdaten {
. $locale->text('III') . qq|
|;
+ $form->{"jsscript"} = 1;
$form->header;
print qq|
@@ -209,9 +219,11 @@ sub export_bewegungsdaten {
| |
. $locale->text('Datum von') . qq| |
- |
+
+ |
| . $locale->text('bis') . qq| |
- |
+
+ |
@@ -221,6 +233,10 @@ sub export_bewegungsdaten {
+| . $form->write_trigger(\%myconfig, 2,
+ "transdatefrom", "BL", "trigger_transdatefrom",
+ "transdateto", "BL", "trigger_transdateto") . qq|
+
@@ -234,10 +250,6 @@ sub export_bewegungsdaten {
-{path}>
-{login}>
-{password}>
-
@@ -253,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;
@@ -300,10 +314,6 @@ sub export_stammdaten {
-{path}>
-{login}>
-{password}>
-
@@ -319,16 +329,84 @@ sub export_stammdaten {
sub export3 {
$lxdebug->enter_sub();
+ $auth->assert('datev_export');
+
+ DATEV::clean_temporary_directories();
+
DATEV->save_datev_stamm(\%myconfig, \%$form);
+ my $link = "datev.pl?action=download&download_token=";
+
if ($form->{kne}) {
- if (DATEV->kne_export(\%myconfig, \%$form)) {
- $form->redirect($locale->text('KNE Export erfolgreich!'));
+ 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 {
- if (DATEV->obe_export(\%myconfig, \%$form)) {
- $form->redirect($locale->text('OBE Export erfolgreich!'));
- }
+ # 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("