X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FGL.pm;h=20d469a63eb6c423b55e14ab122c2a80adb82c0c;hb=db4680753f5ec1de62bdc0557f850afd810444d1;hp=bd8113eaf06fcce7c668a0ddc58cfb4403d423c9;hpb=09372651092644b1b852b8fea775003d92e2d08c;p=kivitendo-erp.git diff --git a/SL/GL.pm b/SL/GL.pm index bd8113eaf..20d469a63 100644 --- a/SL/GL.pm +++ b/SL/GL.pm @@ -25,7 +25,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1335, USA. #====================================================================== # # General ledger backend code @@ -50,9 +51,10 @@ sub delete_transaction { my ($self, $myconfig, $form) = @_; $main::lxdebug->enter_sub(); - SL::DB->with_transaction(sub { + SL::DB->client->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 +218,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 +617,6 @@ sub all_transactions { ($form->{account_description}) = selectrow_query($form, $dbh, $query, $form->{accno}); } - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -627,8 +626,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 +698,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(); }