X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FForm.pm;h=5c7d062ab4ff77b52b8b3391ed2759e821744516;hb=c7b0defb2a90a8eaa28b9e58ac3c108c27375a77;hp=60b3c9af8777ddfa5c6262ec2ec8ab36407fc0d3;hpb=53cbf0de16033a5d035feb9dc678e3cecb4d39b9;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 60b3c9af8..5c7d062ab 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1535,18 +1535,18 @@ sub save_exchangerate { my ($self, $myconfig, $currency, $transdate, $rate, $fld) = @_; - my $dbh = $self->dbconnect($myconfig); - - my ($buy, $sell); - - $buy = $rate if $fld eq 'buy'; - $sell = $rate if $fld eq 'sell'; + SL::DB->client->with_transaction(sub { + my $dbh = SL::DB->client->dbh; + my ($buy, $sell); - $self->update_exchangerate($dbh, $currency, $transdate, $buy, $sell); + $buy = $rate if $fld eq 'buy'; + $sell = $rate if $fld eq 'sell'; - $dbh->disconnect; + $self->update_exchangerate($dbh, $currency, $transdate, $buy, $sell); + 1; + }) or do { die SL::DB->client->error }; $main::lxdebug->leave_sub(); }