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