]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Falsches Buchungsdatum bei stornierten Dialogbuchungen
authorG. Richardson <information@lx-office-hosting.de>
Mon, 23 Jan 2012 13:12:14 +0000 (14:12 +0100)
committerG. Richardson <information@lx-office-hosting.de>
Mon, 23 Jan 2012 13:12:14 +0000 (14:12 +0100)
Storniert man eine Dialogbuchung wurde für die Stornobuchung als Buchungsdatum
nicht das aktuelle Tagesdatum sondern das Buchungsdatum der zu stornierenden
Buchung übernommen. Vor dem Speichern des Stornos wird deswegen jetzt gldate
geleert und dann automatisch mit dem korrekten Tagesdatum gefüllt.

Kontrolle im Datenbestand wo das vorkommt:

select reference,gldate,transdate,storno from gl where date_trunc('day',itime) != gldate;

SL/GL.pm

index e1cb7bc5bb7e8070f8bee4e100d8bcfee8775978..f538bc3590f191957ea286c2d402914c9145cbe8 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -720,7 +720,7 @@ sub storno {
   $storno_row->{storno}    = 't';
   $storno_row->{reference} = 'Storno-' . $storno_row->{reference};
 
-  delete @$storno_row{qw(itime mtime)};
+  delete @$storno_row{qw(itime mtime gldate)};
 
   $query = sprintf 'INSERT INTO gl (%s) VALUES (%s)', join(', ', keys %$storno_row), join(', ', map '?', values %$storno_row);
   do_query($form, $dbh, $query, (values %$storno_row));
@@ -733,7 +733,7 @@ sub storno {
   my $rowref = selectall_hashref_query($form, $dbh, $query, $id);
 
   for my $row (@$rowref) {
-    delete @$row{qw(itime mtime acc_trans_id)};
+    delete @$row{qw(itime mtime acc_trans_id gldate)};
     $query = sprintf 'INSERT INTO acc_trans (%s) VALUES (%s)', join(', ', keys %$row), join(', ', map '?', values %$row);
     $row->{trans_id}   = $new_id;
     $row->{amount}    *= -1;