Revision b895ab3c
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1503 | 1503 |
$main::lxdebug->leave_sub(); |
1504 | 1504 |
} |
1505 | 1505 |
|
1506 |
sub get_exchangerate { |
|
1507 |
$main::lxdebug->enter_sub(); |
|
1508 |
|
|
1509 |
my ($self, $dbh, $curr, $transdate, $fld) = @_; |
|
1510 |
my ($query); |
|
1511 |
|
|
1512 |
unless ($transdate && $curr) { |
|
1513 |
$main::lxdebug->leave_sub(); |
|
1514 |
return 1; |
|
1515 |
} |
|
1516 |
|
|
1517 |
$query = qq|SELECT name AS curr FROM currencies WHERE id = (SELECT currency_id FROM defaults)|; |
|
1518 |
|
|
1519 |
my ($defaultcurrency) = selectrow_query($self, $dbh, $query); |
|
1520 |
|
|
1521 |
if ($curr eq $defaultcurrency) { |
|
1522 |
$main::lxdebug->leave_sub(); |
|
1523 |
return 1; |
|
1524 |
} |
|
1525 |
|
|
1526 |
$query = qq|SELECT e.$fld FROM exchangerate e |
|
1527 |
WHERE e.currency_id = (SELECT id FROM currencies WHERE name = ?) AND e.transdate = ?|; |
|
1528 |
my ($exchangerate) = selectrow_query($self, $dbh, $query, $curr, $transdate); |
|
1529 |
|
|
1530 |
|
|
1531 |
|
|
1532 |
$main::lxdebug->leave_sub(); |
|
1533 |
|
|
1534 |
return $exchangerate; |
|
1535 |
} |
|
1536 |
|
|
1537 | 1506 |
sub check_exchangerate { |
1538 | 1507 |
$main::lxdebug->enter_sub(); |
1539 | 1508 |
|
Auch abrufbar als: Unified diff
Form: get_exchangerate entfernt