From 02d27081a16d051afe653466c214ea9b06c02cff Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Thu, 8 Sep 2016 16:49:20 +0200 Subject: [PATCH] CP: single-dbh disconnects --- SL/CP.pm | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/SL/CP.pm b/SL/CP.pm index 508dada31..dd882ab10 100644 --- a/SL/CP.pm +++ b/SL/CP.pm @@ -67,8 +67,7 @@ sub paymentaccounts { my ($self, $myconfig, $form) = @_; - # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; my $ARAP = $form->{ARAP} eq "AR" ? "AR" : "AP"; @@ -98,8 +97,6 @@ sub paymentaccounts { $query = qq|SELECT closedto FROM defaults|; ($form->{closedto}) = selectrow_query($form, $dbh, $query); - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -108,7 +105,7 @@ sub get_openvc { my ($self, $myconfig, $form) = @_; - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; my $arap = ($form->{vc} eq 'customer') ? 'ar' : 'ap'; my $vc = $form->{vc} eq "customer" ? "customer" : "vendor"; @@ -128,11 +125,6 @@ sub get_openvc { $form->{"all_$form->{vc}"} = selectall_hashref_query($form, $dbh, $query); } - # aufruf für all_deparments rausgenommen, da die abteilungen nur - # beim buchen der belege (rechnung, fibu) geändert werden und danach - # NICHT mehr überschrieben werden - $dbh->disconnect; - $main::lxdebug->leave_sub(); } @@ -142,7 +134,7 @@ sub get_openinvoices { my ($self, $myconfig, $form) = @_; # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; my $vc = $form->{vc} eq "customer" ? "customer" : "vendor"; @@ -187,8 +179,6 @@ sub get_openinvoices { SQL ($form->{openinvoices_other_currencies}) = selectfirst_array_query($form, $dbh, $query, conv_i($form->{"${vc}_id"}), "$form->{currency}"); - $dbh->disconnect; - $main::lxdebug->leave_sub(); } -- 2.20.1