X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fdatev.pl;h=06393376766dd599aa976a4601bc9903899d8edd;hb=ab1df08bfae3ef3361c7b5e4e16d91ae3cb34961;hp=62a1cf006bdefc084c43414ec606429ad1c7f6db;hpb=081a4f9736f3bc345872be8f61632cbed4a8d9b3;p=kivitendo-erp.git
diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl
index 62a1cf006..063933767 100644
--- a/bin/mozilla/datev.pl
+++ b/bin/mozilla/datev.pl
@@ -25,13 +25,19 @@
#
#======================================================================
+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();
@@ -76,17 +82,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,7 +113,6 @@ sub export {
-{path}>
{login}>
{password}>
@@ -173,6 +179,7 @@ sub export_bewegungsdaten {
. $locale->text('III') . qq|
|;
+ $form->{"jsscript"} = 1;
$form->header;
print qq|
@@ -209,9 +216,11 @@ sub export_bewegungsdaten {
| |
. $locale->text('Datum von') . qq| |
- |
+
+ |
| . $locale->text('bis') . qq| |
- |
+
+ |
@@ -221,6 +230,10 @@ sub export_bewegungsdaten {
+| . $form->write_trigger(\%myconfig, 2,
+ "transdatefrom", "BL", "trigger_transdatefrom",
+ "transdateto", "BL", "trigger_transdateto") . qq|
+
@@ -234,7 +247,6 @@ sub export_bewegungsdaten {
-{path}>
{login}>
{password}>
@@ -300,7 +312,6 @@ sub export_stammdaten {
-{path}>
{login}>
{password}>
@@ -321,14 +332,65 @@ sub export3 {
DATEV->save_datev_stamm(\%myconfig, \%$form);
+ my $link = $form->{"script"} . "?";
+ map({ $link .= "${_}=" . $form->escape($form->{$_}) . "&"; } qw(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("