DATEV-Check für nur eine Buchung
authorNiclas Zimmermann <niclas@kivitendo-premium.de>
Thu, 16 May 2013 10:28:50 +0000 (12:28 +0200)
committerNiclas Zimmermann <niclas@kivitendo-premium.de>
Thu, 16 May 2013 10:28:50 +0000 (12:28 +0200)
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
SL/AR.pm
SL/DATEV.pm
SL/GL.pm
SL/IR.pm
SL/IS.pm

index 54abcd1..171b82a 100644 (file)
--- 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;
index 7958495..dd5488a 100644 (file)
--- 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;
index 406f09d..dfd1542 100644 (file)
@@ -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|;
index a422877..864c02e 100644 (file)
--- 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;
index 73b3e14..35f5dce 100644 (file)
--- 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;
index ce8db64..9ecc648 100644 (file)
--- 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;