X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/09372651092644b1b852b8fea775003d92e2d08c..d9ab23fa13ade3503b0a95cdafaa4bc755d94dba:/SL/GL.pm diff --git a/SL/GL.pm b/SL/GL.pm index bd8113eaf..1d3065c2a 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -52,7 +52,8 @@ sub delete_transaction { SL::DB->with_transaction(sub { do_query($form, SL::DB->client->dbh, qq|DELETE FROM gl WHERE id = ?|, conv_i($form->{id})); - }); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); } @@ -216,8 +217,7 @@ sub all_transactions { my ($self, $myconfig, $form) = @_; $main::lxdebug->enter_sub(); - # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; my ($query, $sth, $source, $null, $space); my ($glwhere, $arwhere, $apwhere) = ("1 = 1", "1 = 1", "1 = 1"); @@ -616,8 +616,6 @@ sub all_transactions { ($form->{account_description}) = selectrow_query($form, $dbh, $query, $form->{accno}); } - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -627,8 +625,7 @@ sub transaction { my ($query, $sth, $ref, @values); - # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; $query = qq|SELECT closedto, revtrans FROM defaults|; ($form->{closedto}, $form->{revtrans}) = selectrow_query($form, $dbh, $query); @@ -700,8 +697,6 @@ sub transaction { ORDER BY c.accno|; $form->{chart} = selectall_hashref_query($form, $dbh, $query, conv_date($form->{transdate})); - $dbh->disconnect; - $main::lxdebug->leave_sub(); }