From 5ad3a4a583cf8f29d914553feb869b65b9316b67 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 6 Oct 2008 10:39:17 +0000 Subject: [PATCH] =?utf8?q?Beim=20DATEV-Export=20das=20Jahr=20in=20der=20Da?= =?utf8?q?tei=20angeben,=20das=20durch=20den=20ausgew=C3=A4hlten=20Zeitrau?= =?utf8?q?m=20gegeben=20ist,=20und=20nicht=20das=20aktuelle=20Jahr.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DATEV.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/SL/DATEV.pm b/SL/DATEV.pm index 384ee3f98..29ef34f8e 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -207,13 +207,14 @@ sub get_dates { } elsif ($zeitraum eq "zeit") { - $fromto .= - "'" . $transdatefrom . "' and transdate <= '" . $transdateto . "'"; + $fromto .= "'" . $transdatefrom . "' and transdate <= '" . $transdateto . "'"; + my ($yy, $mm, $dd) = $main::locale->parse_date(\%main::myconfig, $transdatefrom); + $jahr = $yy; } $main::lxdebug->leave_sub(); - return $fromto; + return ($fromto, $jahr); } sub _get_transactions { @@ -368,13 +369,16 @@ sub _get_transactions { sub make_kne_data_header { $main::lxdebug->enter_sub(); - my ($myconfig, $form, $fromto) = @_; + my ($myconfig, $form, $fromto, $start_jahr) = @_; # connect to database my $dbh = $form->dbconnect($myconfig); - my @a = localtime; - $jahr = $a[5]; + my $jahr = $start_jahr; + if (!$jahr) { + my @a = localtime; + $jahr = $a[5]; + } #Header $anwendungsnr = ($fromto) ? "\x31\x31" : "\x31\x33"; @@ -621,7 +625,7 @@ sub kne_buchungsexport { Buchungssätze verarbeitet: |; - $fromto = + ($fromto, $start_jahr) = &get_dates($form->{zeitraum}, $form->{monat}, $form->{quartal}, $form->{transdatefrom}, $form->{transdateto}); @@ -638,7 +642,7 @@ sub kne_buchungsexport { my $ed_filename = $export_path . $filename; push(@filenames, $filename); open(ED, "> $ed_filename") or die "can't open outputfile: $!\n"; - $header = &make_kne_data_header($myconfig, $form, $fromto); + $header = &make_kne_data_header($myconfig, $form, $fromto, $start_jahr); $remaining_bytes -= length($header); while (scalar(@{ $form->{DATEV} }) > 0) { -- 2.20.1