X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fdatev.pl;h=9944abfba13e699fe72a2e19c69aaf32c5402082;hb=98662ad2b031a81c88ce6da0babf6f9d0b37059a;hp=72666769e7cbc6186825483d7f96c272039c35f7;hpb=4dbb09950c9f5596646537c12d991c99086fe7c1;p=kivitendo-erp.git
diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl
index 72666769e..9944abfba 100644
--- a/bin/mozilla/datev.pl
+++ b/bin/mozilla/datev.pl
@@ -22,29 +22,29 @@
#======================================================================
#
# Datev export module
-#
+#
#======================================================================
+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} } };
+# end of main
+sub continue { &{ $form->{nextsub} } }
sub export {
$lxdebug->enter_sub();
-
$form->{title} = $locale->text("DATEX - Export Assistent");
-
- DATEV->get_datev_stamm(\%myconfig, \%$form);
+ DATEV->get_datev_stamm(\%myconfig, \%$form);
$form->header;
-
+
print qq|
@@ -56,45 +56,49 @@ sub export {
$form->{title} |
- |.$locale->text("DATEV Angaben").qq| |
+ | . $locale->text("DATEV Angaben") . qq| |
@@ -112,7 +116,8 @@ sub export {
{password}>
-
+
@@ -124,37 +129,58 @@ sub export {
sub export2 {
$lxdebug->enter_sub();
- if ($form->{exporttype}==0) {
+ if ($form->{exporttype} == 0) {
&export_bewegungsdaten();
- } else {&export_stammdaten();}
+ } else {
+ &export_stammdaten();
+ }
$lxdebug->leave_sub();
}
sub export_bewegungsdaten {
$lxdebug->enter_sub();
-
$form->{title} = $locale->text("DATEX - Export Assistent");
- $form->{allemonate}=qq|
-
-
-
-
-
-
-
-
-
-
- |;
-
- $form->{allequartale}=qq|
-
-
- |;
+ $form->{allemonate} =
+ qq|
+
+
+
+
+
+
+
+
+
+
+ |;
+
+ $form->{allequartale} =
+ qq|
+
+
+ |;
+ $form->{"jsscript"} = 1;
$form->header;
-
+
print qq|
@@ -166,29 +192,34 @@ sub export_bewegungsdaten {
| $form->{title} |
- |.$locale->text("Zeitraum").qq| |
+ | . $locale->text("Zeitraum") . qq| |
|
@@ -198,6 +229,10 @@ sub export_bewegungsdaten {
+| . $form->write_trigger(\%myconfig, 2,
+ "transdatefrom", "BL", "trigger_transdatefrom",
+ "transdateto", "BL", "trigger_transdateto") . qq|
+
@@ -216,7 +251,8 @@ sub export_bewegungsdaten {
{password}>
-
+
@@ -229,12 +265,10 @@ sub export_bewegungsdaten {
sub export_stammdaten {
$lxdebug->enter_sub();
-
$form->{title} = $locale->text("DATEX - Export Assistent");
-
$form->header;
-
+
print qq|
@@ -244,18 +278,18 @@ sub export_stammdaten {
$form->{title} |
- |.$locale->text("Konten").qq| |
+ | . $locale->text("Konten") . qq| |
@@ -283,7 +317,8 @@ sub export_stammdaten {
{password}>
-
+
@@ -293,18 +328,70 @@ sub export_stammdaten {
$lxdebug->leave_sub();
}
-
sub export3 {
$lxdebug->enter_sub();
DATEV->save_datev_stamm(\%myconfig, \%$form);
-
+
+ my $link = $form->{"script"} . "?";
+ map({ $link .= "${_}=" . $form->escape($form->{$_}) . "&"; } qw(path login password));
+ $link .= "action=download";
+
if ($form->{kne}) {
- if (DATEV->kne_export(\%myconfig, \%$form)) {
- $form->redirect($locale->text('KNE Export erfolgreich!'))}
+ 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|);
+ } else {
+ $form->error("KNE-Export schlug fehl.");
+ }
} else {
- if (DATEV->obe_export(\%myconfig, \%$form)) {
- $form->redirect($locale->text('OBE Export erfolgreich!'));}
+ 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(" |