projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
GDPDU locales
[kivitendo-erp.git]
/
SL
/
Form.pm
diff --git
a/SL/Form.pm
b/SL/Form.pm
index
60b3c9a
..
5c7d062
100644
(file)
--- a/
SL/Form.pm
+++ b/
SL/Form.pm
@@
-1535,18
+1535,18
@@
sub save_exchangerate {
my ($self, $myconfig, $currency, $transdate, $rate, $fld) = @_;
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();
}
$main::lxdebug->leave_sub();
}