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