Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 341d9fbb

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

  • ID 341d9fbbf3037cb8f75bbd564a5567382e0bcece
  • Vorgänger aec14b51
  • Nachfolger 3c3d13d8

Wechselkurs beim Laden des Belegs in form_header oder retrieve_invoice holen

Unterschiede anzeigen:

SL/IR.pm
1013 1013
  $form->{mtime} = $form->{itime} if !$form->{mtime};
1014 1014
  $form->{lastmtime} = $form->{mtime};
1015 1015

  
1016
  $form->{exchangerate}  = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, "sell");
1016
  ($form->{exchangerate}, $form->{record_forex}) = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, "sell", conv_i($form->{id}), 'ap');
1017 1017

  
1018 1018
  # get shipto
1019 1019
  $query = qq|SELECT * FROM shipto WHERE (trans_id = ?) AND (module = 'AP')|;
SL/IS.pm
2317 2317
    $form->{mtime} = $form->{itime} if !$form->{mtime};
2318 2318
    $form->{lastmtime} = $form->{mtime};
2319 2319

  
2320
    $form->{exchangerate} = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, "buy");
2320
    ($form->{exchangerate}, $form->{record_forex}) = $form->check_exchangerate($myconfig, $form->{currency}, $form->{invdate}, "buy", $id, 'ar');
2321 2321

  
2322 2322
    foreach my $vc (qw(customer vendor)) {
2323 2323
      next if !$form->{"delivery_${vc}_id"};
bin/mozilla/ap.pl
346 346
  # build the popup menus
347 347
  $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked";
348 348

  
349
  # currencies
350
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
351

  
352 349
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
353 350

  
354 351
  $form->{employee} = "$form->{employee}--$form->{employee_id}";
......
406 403

  
407 404
  $form->{readonly} = $readonly;
408 405

  
409
  $form->{forex} = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
410
  if ( $form->{forex} ) {
411
    $form->{exchangerate} = $form->{forex};
406
  # currencies
407
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
408
  if ($form->{currency} ne $form->{defaultcurrency}) {
409
    ($form->{exchangerate}, $form->{record_forex}) = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, "sell", $form->{id}, 'ap');
412 410
  }
413 411

  
414 412
  # format amounts
415
  $form->{exchangerate}    = $form->{exchangerate} ? $form->format_amount(\%myconfig, $form->{exchangerate}) : '';
416 413
  $form->{creditlimit}     = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
417 414
  $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
418 415

  
......
690 687

  
691 688
  map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
692 689

  
693
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
694
  $form->{exchangerate} = $form->{forex} if $form->{forex};
695

  
696 690
  $form->{invdate} = $form->{transdate};
697 691

  
698 692
  if (($form->{previous_vendor_id} || $form->{vendor_id}) != $form->{vendor_id}) {
bin/mozilla/ar.pl
378 378
                      ? ($form->current_date(\%myconfig) eq $form->{gldate})
379 379
                      : ($::instance_conf->get_ar_changeable == 1);
380 380
  $readonly = ($form->{radier}) ? "" : $readonly;
381
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
382
  if ($form->{currency} ne $form->{defaultcurrency}) {
383
    ($form->{exchangerate}, $form->{record_forex}) = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, "buy", $form->{id}, 'ar');
384
  }
381 385

  
382
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'buy');
383
  $form->{exchangerate} = $form->{forex} if $form->{forex};
384 386

  
385 387
  $rows = max 2, $form->numtextrows($form->{notes}, 50);
386 388

  
bin/mozilla/is.pl
851 851
  if (!$form->{forex}) {        # read exchangerate from input field (not hidden)
852 852
    $form->{exchangerate} = $form->parse_amount(\%myconfig, $form->{exchangerate}) unless $recursive_call;
853 853
  }
854
  $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
854
  ($form->{forex}, $form->{record_forex}) = $form->check_exchangerate(\%myconfig, $form->{currency},
855
                                                                      $form->{invdate}, 'buy', $form->{id}, 'ar');
855 856
  $form->{exchangerate} = $form->{forex} if $form->{forex};
856

  
857 857
  for my $i (1 .. $form->{paidaccounts}) {
858 858
    next unless $form->{"paid_$i"};
859 859
    map { $form->{"${_}_$i"}   = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);

Auch abrufbar als: Unified diff