Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2a9b1b12

Von Jan Büren vor etwa 2 Jahren hinzugefügt

  • ID 2a9b1b129a20c9619347066692fae0a5583ad0bf
  • Vorgänger 9aa4d575
  • Nachfolger d54196a3

update_exchangerate: Negative Wechselkurse nicht akzeptieren

Unterschiede anzeigen:

SL/Form.pm
1428 1428
                 { isa  => 'DBI::db'},
1429 1429
                 { type => SCALAR, callbacks  => { is_fx_currency     => sub { shift ne $_[1]->[0]->{defaultcurrency} } } }, # should be ISO three letter codes for currency identification (ISO 4217)
1430 1430
                 { type => SCALAR, callbacks  => { is_valid_kivi_date => sub { shift =~ m/\d+\d+\d+/ } } }, # we have three numers
1431
                 { type => SCALAR, callbacks  => { is_null_or_digit   => sub { shift =~ m/(^0$|\d+)/ } } }, # value buy fxrate
1432
                 { type => SCALAR, callbacks  => { is_null_or_digit   => sub { shift =~ m/(^0$|\d+)/ } } }, # value sell fxrate
1431
                 { type => SCALAR, callbacks  => { is_null_or_digit   => sub { $_[0] =~ m/(^0$|\d+)/ && $_[0] >= 0 } } }, # value buy fxrate
1432
                 { type => SCALAR, callbacks  => { is_null_or_digit   => sub { $_[0] =~ m/(^0$|\d+)/ && $_[0] >= 0 } } }, # value sell fxrate
1433 1433
                 { type => SCALAR, callbacks  => { is_current_form_id => sub { $_[0] == $_[1]->[0]->{id} } },              optional => 1 },
1434 1434
                 { type => SCALAR, callbacks  => { is_valid_fx_table  => sub { shift =~ m/(ar|ap|bank_transactions)/  } }, optional => 1 }
1435 1435
              );
......
1504 1504
  # callers wants a check if record has a exchange rate and should be fetched instead
1505 1505
  if ($record_table && $id) {
1506 1506
    my ($record_exchange_rate) = selectrow_query($self, $dbh, qq|SELECT exchangerate FROM $record_table WHERE id = ?|, $id);
1507
    if ($record_exchange_rate) {
1507
    if ($record_exchange_rate && $record_exchange_rate > 0) {
1508 1508

  
1509 1509
      $main::lxdebug->leave_sub();
1510 1510

  

Auch abrufbar als: Unified diff