X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/800378d4dca02bfcf5537ee29307eb946a3dc73e..a143bb853debae00c61b9666e8843cfafda6e3b7:/SL/AP.pm diff --git a/SL/AP.pm b/SL/AP.pm index ae75dc909..ef3109f8f 100644 --- a/SL/AP.pm +++ b/SL/AP.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. #====================================================================== # # Accounts Payables database backend routines @@ -403,7 +404,8 @@ sub delete_transaction { SL::DB->client->with_transaction(sub { my $query = qq|DELETE FROM ap WHERE id = ?|; do_query($form, SL::DB->client->dbh, $query, $form->{id}); - }); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); @@ -564,7 +566,7 @@ sub get_transdate { my ($self, $myconfig, $form) = @_; # connect to database - my $dbh = $form->dbconnect($myconfig); + my $dbh = SL::DB->client->dbh; my $query = "SELECT COALESCE(" . @@ -573,8 +575,6 @@ sub get_transdate { " current_date)"; ($form->{transdate}) = $dbh->selectrow_array($query); - $dbh->disconnect; - $main::lxdebug->leave_sub(); }