]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Beim Aufrufen der Masken für Dialogbuchen, Debitoren- und Kreditorenrechnungen wird...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 15 Jan 2007 11:02:45 +0000 (11:02 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 15 Jan 2007 11:02:45 +0000 (11:02 +0000)
SL/AP.pm
SL/AR.pm
SL/GL.pm
bin/mozilla/ap.pl
bin/mozilla/ar.pl

index b0e04403277095ecb6fc02a0a8c418ef440f4d75..6925c20d13ff4e8c855822019fa7459ee38ed39f 100644 (file)
--- a/SL/AP.pm
+++ b/SL/AP.pm
@@ -470,5 +470,25 @@ sub ap_transactions {
   $main::lxdebug->leave_sub();
 }
 
   $main::lxdebug->leave_sub();
 }
 
+sub get_transdate {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $form) = @_;
+
+  # connect to database
+  my $dbh = $form->dbconnect($myconfig);
+
+  my $query =
+    "SELECT COALESCE(" .
+    "  (SELECT transdate FROM gl WHERE id = " .
+    "    (SELECT MAX(id) FROM gl) LIMIT 1), " .
+    "  current_date)";
+  ($form->{transdate}) = $dbh->selectrow_array($query);
+
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+}
+
 1;
 
 1;
 
index 3240fb77c8e5b5ae0ba3a640597183efb4e1725d..5c588f37db8e4e93cb811bcad20cb6a3f5e8b79c 100644 (file)
--- a/SL/AR.pm
+++ b/SL/AR.pm
@@ -475,5 +475,25 @@ sub ar_transactions {
   $main::lxdebug->leave_sub();
 }
 
   $main::lxdebug->leave_sub();
 }
 
+sub get_transdate {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig, $form) = @_;
+
+  # connect to database
+  my $dbh = $form->dbconnect($myconfig);
+
+  my $query =
+    "SELECT COALESCE(" .
+    "  (SELECT transdate FROM gl WHERE id = " .
+    "    (SELECT MAX(id) FROM gl) LIMIT 1), " .
+    "  current_date)";
+  ($form->{transdate}) = $dbh->selectrow_array($query);
+
+  $dbh->disconnect;
+
+  $main::lxdebug->leave_sub();
+}
+
 1;
 
 1;
 
index c8c1ffeae9439f2ed09191a6a929229a89bed529..2b9a67a403ae4c366651770d933b111b7cb533a1 100644 (file)
--- a/SL/GL.pm
+++ b/SL/GL.pm
@@ -646,13 +646,14 @@ sub transaction {
 
     $sth->finish;
   } else {
 
     $sth->finish;
   } else {
-    $query = "SELECT current_date AS transdate, closedto, revtrans
-              FROM defaults";
-    $sth = $dbh->prepare($query);
-    $sth->execute || $form->dberror($query);
-
-    ($form->{transdate}, $form->{closedto}, $form->{revtrans}) =
-      $sth->fetchrow_array;
+    $query = "SELECT closedto, revtrans FROM defaults";
+    ($form->{closedto}, $form->{revtrans}) = $dbh->selectrow_array($query);
+    $query =
+      "SELECT COALESCE(" .
+      "  (SELECT transdate FROM gl WHERE id = " .
+      "    (SELECT MAX(id) FROM gl) LIMIT 1), " .
+      "  current_date)";
+    ($form->{transdate}) = $dbh->selectrow_array($query);
 
     # get tax description
     $query = qq| SELECT * FROM tax t order by t.taxkey|;
 
     # get tax description
     $query = qq| SELECT * FROM tax t order by t.taxkey|;
index b8d677735a783948b56d7ef0a63b2720f4f4e987..a18c638a74e6d25a6d2346f7378369d724314fbe 100644 (file)
@@ -79,6 +79,7 @@ sub add {
     unless $form->{callback};
 
   &create_links;
     unless $form->{callback};
 
   &create_links;
+  AP->get_transdate(\%myconfig, $form);
   &display_form;
 
   $lxdebug->leave_sub();
   &display_form;
 
   $lxdebug->leave_sub();
index 3b4540457d2ebe1c896af59fde1d83db05806979..4fb3d5171a97acd3240f8f282a047ce94651f8f0 100644 (file)
@@ -79,6 +79,7 @@ sub add {
     unless $form->{callback};
 
   &create_links;
     unless $form->{callback};
 
   &create_links;
+  AR->get_transdate(\%myconfig, $form);
   &display_form;
 
   $lxdebug->leave_sub();
   &display_form;
 
   $lxdebug->leave_sub();