Revision f6d8dbb1
Von Jan Büren vor etwa 2 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
1431 | 1431 |
{ isa => 'DBI::db'}, |
1432 | 1432 |
{ type => SCALAR, callbacks => { is_fx_currency => sub { shift ne $_[1]->[0]->{defaultcurrency} } } }, # should be ISO three letter codes for currency identification (ISO 4217) |
1433 | 1433 |
{ type => SCALAR, callbacks => { is_valid_kivi_date => sub { shift =~ m/\d+\d+\d+/ } } }, # we have three numers |
1434 |
{ type => SCALAR, callbacks => { is_null_or_digit => sub { shift =~ m/(^0$|\d+)/ } } }, # value buy fxrate
|
|
1435 |
{ type => SCALAR, callbacks => { is_null_or_digit => sub { shift =~ m/(^0$|\d+)/ } } }, # value sell fxrate
|
|
1434 |
{ type => SCALAR, callbacks => { is_null_or_digit => sub { $_[0] =~ m/(^0$|\d+)/ && $_[0] >= 0 } } }, # value buy fxrate
|
|
1435 |
{ type => SCALAR, callbacks => { is_null_or_digit => sub { $_[0] =~ m/(^0$|\d+)/ && $_[0] >= 0 } } }, # value sell fxrate
|
|
1436 | 1436 |
{ type => SCALAR, callbacks => { is_current_form_id => sub { $_[0] == $_[1]->[0]->{id} } }, optional => 1 }, |
1437 | 1437 |
{ type => SCALAR, callbacks => { is_valid_fx_table => sub { shift =~ m/(ar|ap|bank_transactions)/ } }, optional => 1 } |
1438 | 1438 |
); |
... | ... | |
1507 | 1507 |
# callers wants a check if record has a exchange rate and should be fetched instead |
1508 | 1508 |
if ($record_table && $id) { |
1509 | 1509 |
my ($record_exchange_rate) = selectrow_query($self, $dbh, qq|SELECT exchangerate FROM $record_table WHERE id = ?|, $id); |
1510 |
if ($record_exchange_rate) { |
|
1510 |
if ($record_exchange_rate && $record_exchange_rate > 0) {
|
|
1511 | 1511 |
|
1512 | 1512 |
$main::lxdebug->leave_sub(); |
1513 | 1513 |
|
Auch abrufbar als: Unified diff
update_exchangerate: Negative Wechselkurse nicht akzeptieren