From e04c32d3d5702636c2ad0fc25d27532c9eb853b0 Mon Sep 17 00:00:00 2001 From: Niclas Zimmermann Date: Thu, 16 May 2013 12:28:50 +0200 Subject: [PATCH] =?utf8?q?DATEV-Check=20f=C3=BCr=20nur=20eine=20Buchung?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bisher hat der DATEV-Check nach Erstellung einer Buchung immer den ganzen Tag geprüft. Jetzt wird nur noch die Buchung selbst auf DATEV-Kompatibilität geprüft. --- SL/AP.pm | 1 + SL/AR.pm | 1 + SL/DATEV.pm | 17 +++++++++++++++++ SL/GL.pm | 1 + SL/IR.pm | 1 + SL/IS.pm | 1 + 6 files changed, 22 insertions(+) diff --git a/SL/AP.pm b/SL/AP.pm index 54abcd17e..171b82a11 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -416,6 +416,7 @@ sub post_transaction { dbh => $dbh, from => $transdate, to => $transdate, + trans_id => $form->{id}, ); $datev->export; diff --git a/SL/AR.pm b/SL/AR.pm index 795849583..dd5488ad7 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -331,6 +331,7 @@ sub post_transaction { dbh => $dbh, from => $transdate, to => $transdate, + trans_id => $form->{id}, ); $datev->export; diff --git a/SL/DATEV.pm b/SL/DATEV.pm index 406f09d76..dfd154236 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -193,6 +193,16 @@ sub to { return $self->{to}; } +sub trans_id { + my $self = shift; + + if (@_) { + $self->{trans_id} = $_[0]; + } + + return $self->{trans_id}; +} + sub accnofrom { my $self = shift; @@ -342,6 +352,10 @@ sub _get_transactions { my $form = $main::form; + my $trans_id_filter = ''; + + $trans_id_filter = 'AND ac.trans_id = ' . $self->trans_id if $self->trans_id; + my ($notsplitindex); $fromto =~ s/transdate/ac\.transdate/g; @@ -363,6 +377,7 @@ sub _get_transactions { LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE (ar.id IS NOT NULL) AND $fromto + $trans_id_filter $filter UNION ALL @@ -378,6 +393,7 @@ sub _get_transactions { LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE (ap.id IS NOT NULL) AND $fromto + $trans_id_filter $filter UNION ALL @@ -392,6 +408,7 @@ sub _get_transactions { LEFT JOIN chart c ON (ac.chart_id = c.id) WHERE (gl.id IS NOT NULL) AND $fromto + $trans_id_filter $filter ORDER BY trans_id, acc_trans_id|; diff --git a/SL/GL.pm b/SL/GL.pm index a42287735..864c02eab 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -198,6 +198,7 @@ sub post_transaction { dbh => $dbh, from => $transdate, to => $transdate, + trans_id => $form->{id}, ); $datev->export; diff --git a/SL/IR.pm b/SL/IR.pm index 73b3e14ed..35f5dcec4 100644 --- a/SL/IR.pm +++ b/SL/IR.pm @@ -768,6 +768,7 @@ sub post_invoice { dbh => $dbh, from => $transdate, to => $transdate, + trans_id => $form->{id}, ); $datev->export; diff --git a/SL/IS.pm b/SL/IS.pm index ce8db64b9..9ecc64818 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -1174,6 +1174,7 @@ sub post_invoice { dbh => $dbh, from => $transdate, to => $transdate, + trans_id => $form->{id}, ); $datev->export; -- 2.20.1