X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fdatev.pl;h=f3dbc2eb82bea431afafd5befe337076bd39e65c;hb=85d2b8bb3ea47265821098bd4cab73c681d09e92;hp=8f0bdd8c50ea223345d4b7b5fb9d6b60f27ae5bc;hpb=57bf9c89a037036fcf433de39643778854defe51;p=kivitendo-erp.git diff --git a/bin/mozilla/datev.pl b/bin/mozilla/datev.pl index 8f0bdd8c5..f3dbc2eb8 100644 --- a/bin/mozilla/datev.pl +++ b/bin/mozilla/datev.pl @@ -42,303 +42,46 @@ require "bin/mozilla/common.pl"; sub continue { call_sub($main::form->{"nextsub"}); } sub export { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - $main::auth->assert('datev_export'); + DATEV->get_datev_stamm(\%::myconfig, $::form); + $::form->header; + print $::form->parse_html_template('datev/export'); - $form->{title} = $locale->text("DATEX - Export Assistent"); - - DATEV->get_datev_stamm(\%myconfig, \%$form); - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text("DATEV Angaben") . qq|
- - - - - - - - - - - - - - - - - - - - - - - - | . # OBE-Export noch nicht implementiert! - qq| - - - - - - - - - - - - - -
| . $locale->text("Beraternummer") . qq|| . $locale->text("DFV-Kennzeichen") . qq|
| . $locale->text("Beratername") . qq|| . $locale->text("Password") . qq|
| . $locale->text("Mandantennummer") . qq|| . $locale->text("Medium Number") . qq|
| . $locale->text("Kontonummernerweiterung (KNE)") . qq|| . $locale->text("Abrechnungsnummer") . qq|
| - . $locale->text("Export Buchungsdaten") . qq| | - . $locale->text("Export Stammdaten") . qq|
-

- - - -
- -
- - - -|; - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export2 { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - my $form = $main::form; - - $main::auth->assert('datev_export'); - - if ($form->{exporttype} == 0) { - &export_bewegungsdaten(); + if ($::form->{exporttype} == 0) { + export_bewegungsdaten(); } else { - &export_stammdaten(); + export_stammdaten(); } - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export_bewegungsdaten { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('datev_export'); - - $form->{title} = $locale->text("DATEX - Export Assistent"); - - $form->{allemonate} = - qq| - - - - - - - - - - - |; - - $form->{allequartale} = - qq| - - - |; - $form->{"jsscript"} = 1; - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text("Zeitraum") . qq|
- - - - - - - - - - - - - - - - - - - -
 | - . $locale->text('Monat') . qq|
 | - . $locale->text('Quartal') . qq|
 | - . $locale->text('Datum von') . qq| - | . $locale->text('bis') . qq| -
-

- -| . $form->write_trigger(\%myconfig, 2, - "transdatefrom", "BL", "trigger_transdatefrom", - "transdateto", "BL", "trigger_transdateto") . qq| - - - - - - - - - - - - - - -
- -
- - - -|; + $::form->header; + print $::form->parse_html_template('datev/export_bewegungsdaten'); - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export_stammdaten { - $main::lxdebug->enter_sub(); + $::lxdebug->enter_sub; + $::auth->assert('datev_export'); - my $form = $main::form; - my $locale = $main::locale; + $::form->header; + print $::form->parse_html_template('datev/export_stammdaten'); - $main::auth->assert('datev_export'); - - $form->{title} = $locale->text("DATEX - Export Assistent"); - - $form->header; - - print qq| - - -
{script}> - - - - - - - - - - - - - - -
$form->{title}
| . $locale->text("Konten") . qq|
- - - - - - - - - -
| . $locale->text('Von Konto: ') . qq|
| . $locale->text('Bis Konto: ') . qq|
-

- - - - - - - - - - - - - -
- -
- - - -|; - - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub export3 { @@ -363,6 +106,8 @@ sub export3 { print(qq|
| . $locale->text('KNE-Export erfolgreich!') . qq|

Download|); + print $form->parse_html_template('datev/net_gross_difference') if @{ $form->{net_gross_differences} }; + } else { $form->error("KNE-Export schlug fehl."); } @@ -393,7 +138,7 @@ sub download { $main::auth->assert('datev_export'); my $tmp_name = Common->tmpname(); - my $zip_name = strftime("lx-office-datev-export-%Y%m%d.zip", localtime(time())); + my $zip_name = strftime("kivitendo-datev-export-%Y%m%d.zip", localtime(time())); my $cwd = getcwd(); @@ -419,11 +164,13 @@ sub download { chdir($cwd); open(IN, $tmp_name) || die("open $tmp_name"); - print("Content-Type: application/zip\n"); - print("Content-Disposition: attachment; filename=\"${zip_name}\"\n\n"); - while () { - print($_); - } + $::locale->with_raw_io(\*STDOUT, sub { + print("Content-Type: application/zip\n"); + print("Content-Disposition: attachment; filename=\"${zip_name}\"\n\n"); + while () { + print($_); + } + }); close(IN); unlink($tmp_name);