Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 5d5a1646

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

  • ID 5d5a164618fcb23f0e6460c886043a09520d0dcd
  • Vorgänger 05f6df1e
  • Nachfolger f1967be8

update_exchangerate für Zahlungen auch bei manueller Verbuchung

Unterschiede anzeigen:

SL/AP.pm
396 396

  
397 397
      # update exchange rate record
398 398
      if (($form->{currency} ne $form->{defaultcurrency}) && !$exchangerate) {
399
        $form->{script} = 'ap.pl';
399 400
        $form->update_exchangerate($dbh, $form->{currency},
400 401
                                   $form->{"datepaid_$i"},
401 402
                                   0, $form->{"exchangerate_$i"});
SL/Form.pm
1430 1430
                 { type => SCALAR, callbacks  => { is_valid_kivi_date => sub { shift =~ m/\d+\d+\d+/ } } }, # we have three numers
1431 1431
                 { type => SCALAR, callbacks  => { is_null_or_ar_int  => sub {    $_[0] == 0
1432 1432
                                                                               || $_[0] >  0
1433
                                                                               && $_[1]->[0]->{script} =~ m/ar\.pl|is\.pl/ } } }, # value buy fxrate
1433
                                                                               && $_[1]->[0]->{script} =~ m/cp\.pl|ar\.pl|is\.pl/ } } }, # value buy fxrate
1434 1434
                 { type => SCALAR, callbacks  => { is_null_or_ap_int  => sub {    $_[0] == 0
1435 1435
                                                                               || $_[0] >  0
1436
                                                                               && $_[1]->[0]->{script} =~ m/ap\.pl|ir\.pl/  } } }, # value sell fxrate
1436
                                                                               && $_[1]->[0]->{script} =~ m/cp\.pl|ap\.pl|ir\.pl/  } } }, # value sell fxrate
1437 1437
                 { type => SCALAR, callbacks  => { is_current_form_id => sub { $_[0] == $_[1]->[0]->{id} } },              optional => 1 },
1438 1438
                 { type => SCALAR, callbacks  => { is_valid_fx_table  => sub { shift =~ m/(ar|ap|bank_transactions)/  } }, optional => 1 }
1439 1439
              );
SL/IR.pm
698 698
    $paiddiff = 0;
699 699

  
700 700
    # update exchange rate for PAYMENTS
701
    $form->{script} = 'ir.pl';
701 702
    $form->update_exchangerate($dbh, $form->{currency}, $form->{"datepaid_$i"}, 0, $form->{"exchangerate_$i"})
702 703
      if ($form->{currency} ne $defaultcurrency) && !$exchangerate;
703 704
  }
SL/IS.pm
1420 1420
      # update exchange rate for PAYMENTS
1421 1421
      # exchangerate contains a new exchangerate of the payment date
1422 1422
      if (($form->{currency} ne $defaultcurrency) && !$exchangerate) {
1423
        $form->{script} = 'is.pl';
1423 1424
        $form->update_exchangerate($dbh, $form->{currency},
1424 1425
                                   $form->{"datepaid_$i"},
1425 1426
                                   $form->{"exchangerate_$i"}, 0);
bin/mozilla/cp.pl
235 235
  if (!$form->{forex}) {        # read exchangerate from input field (not hidden)
236 236
    $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate});
237 237
  }
238
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{datepaid}, $buysell);
238
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{datepaid}, $buysell)
239
    if $form->{defaultcurrency} ne $form->{currency} && $form->{datepaid};
239 240
  $form->{exchangerate} = $form->{forex} if $form->{forex};
240 241

  
241 242
  $amount = $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});

Auch abrufbar als: Unified diff