X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/53beea8bb782b8ddf13d291bb274cff31456dc21..7ab5a4f6d5d38a7e24f314bccbccb8f9beb95843:/SL/AP.pm diff --git a/SL/AP.pm b/SL/AP.pm index b0e044032..072c66529 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -470,5 +470,25 @@ sub ap_transactions { $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 ap WHERE id = " . + " (SELECT MAX(id) FROM ap) LIMIT 1), " . + " current_date)"; + ($form->{transdate}) = $dbh->selectrow_array($query); + + $dbh->disconnect; + + $main::lxdebug->leave_sub(); +} + 1;