Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a53233e5

Von Sven Schöling vor mehr als 16 Jahren hinzugefügt

  • ID a53233e56a9d4001b47bcf412b4bfe46910d3117
  • Vorgänger 1b95831a
  • Nachfolger 04e9a474

Wechselkurse.

Zum einen den unsaeglichen Algorithmus zum setzen von exchangerate und forex im ganzen Porgramm geaendert.
Dann einen Bug mit der Angzeige der Wechselkurseingabe in oe.pl gefixt.
Ausserdem Bug 666 gefixt.

Unterschiede anzeigen:

SL/AP.pm
56 56
  if ($form->{currency} eq $form->{defaultcurrency}) {
57 57
    $form->{exchangerate} = 1;
58 58
  } else {
59
    $exchangerate =
60
      $form->check_exchangerate($myconfig, $form->{currency},
61
                                $form->{transdate}, 'sell');
62

  
63
    $form->{exchangerate} =
64
      ($exchangerate)
65
      ? $exchangerate
66
      : $form->parse_amount($myconfig, $form->{exchangerate});
59
    $exchangerate         = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'sell');
60
    $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
67 61
  }
68 62

  
69 63
  for $i (1 .. $form->{rowcount}) {
......
271 265
      if ($form->{currency} eq $form->{defaultcurrency}) {
272 266
        $form->{"exchangerate_$i"} = 1;
273 267
      } else {
274
        $exchangerate =
275
          $form->check_exchangerate($myconfig, $form->{currency},
276
                                    $form->{"datepaid_$i"}, 'sell');
277

  
278
        $form->{"exchangerate_$i"} =
279
          ($exchangerate)
280
          ? $exchangerate
281
          : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
268
        $exchangerate              = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
269
        $form->{"exchangerate_$i"} = $exchangerate || $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
282 270
      }
283 271
      $form->{"AP_paid_$i"} =~ s/\"//g;
284 272

  
SL/Form.pm
1578 1578

  
1579 1579
  my ($exchangerate) = selectrow_query($self, $dbh, $query, $currency, $transdate);
1580 1580

  
1581
  $exchangerate = 1 if ($exchangerate eq "");
1582

  
1583 1581
  $main::lxdebug->leave_sub();
1584 1582

  
1585 1583
  return $exchangerate;
SL/IS.pm
524 524
  if ($form->{currency} eq $defaultcurrency) {
525 525
    $form->{exchangerate} = 1;
526 526
  } else {
527
    $exchangerate =
528
      $form->check_exchangerate($myconfig, $form->{currency},
529
                                $form->{transdate}, 'buy');
527
    $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, 'buy');
530 528
  }
531 529

  
532 530
  $form->{exchangerate} =
......
820 818
      if ($form->{currency} eq $defaultcurrency) {
821 819
        $form->{"exchangerate_$i"} = 1;
822 820
      } else {
823
        $exchangerate =
824
          $form->check_exchangerate($myconfig, $form->{currency},
825
                                    $form->{"datepaid_$i"}, 'buy');
826

  
827
        $form->{"exchangerate_$i"} =
828
          $exchangerate ? $exchangerate
829
            : $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
821
        $exchangerate              = $form->check_exchangerate($myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
822
        $form->{"exchangerate_$i"} = $exchangerate || $form->parse_amount($myconfig, $form->{"exchangerate_$i"});
830 823
      }
831 824

  
832 825
      # record AR
SL/OE.pm
415 415
    $exchangerate = $form->check_exchangerate($myconfig, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? 'buy' : 'sell');
416 416
  }
417 417

  
418
  $form->{exchangerate} = ($exchangerate) ? $exchangerate : $form->parse_amount($myconfig, $form->{exchangerate});
418
  $form->{exchangerate} = $exchangerate || $form->parse_amount($myconfig, $form->{exchangerate});
419 419

  
420 420
  my $quotation = $form->{type} =~ /_order$/ ? 'f' : 't';
421 421

  
bin/mozilla/ap.pl
223 223
  }
224 224
  $readonly = ($form->{id}) ? "readonly" : "";
225 225

  
226
  $form->{radier} =
227
    ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
228
  $readonly                 = ($form->{radier}) ? "" : $readonly;
226
  $form->{radier} = ($form->current_date(\%myconfig) eq $form->{gldate}) ? 1 : 0;
227
  $readonly       = ($form->{radier}) ? "" : $readonly;
229 228

  
230
  $form->{exchangerate} = $exchangerate
231
    if (
232
        $form->{forex} = (
233
                     $exchangerate =
234
                       $form->check_exchangerate(
235
                       \%myconfig, $form->{currency}, $form->{transdate}, 'sell'
236
                       )));
229
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
230
  $form->{exchangerate} = $form->{forex} if $form->{forex};
237 231

  
238 232

  
239 233
  # format amounts
......
898 892

  
899 893
  map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
900 894

  
901
  $form->{exchangerate} = $exchangerate
902
    if (
903
        $form->{forex} = (
904
                    $exchangerate =
905
                      $form->check_exchangerate(
906
                      \%myconfig, $form->{currency}, $form->{transdate}, 'sell'
907
                      )));
895
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'sell');
896
  $form->{exchangerate} = $form->{forex} if $form->{forex};
908 897

  
909 898
  $form->{invdate} = $form->{transdate};
910 899
  $save_AP = $form->{AP};
......
925 914

  
926 915
      $totalpaid += $form->{"paid_$i"};
927 916

  
928
      $form->{"exchangerate_$i"} = $exchangerate
929
        if (
930
            $form->{"forex_$i"} = (
931
                $exchangerate =
932
                  $form->check_exchangerate(
933
                  \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell'
934
                  )));
917
      $form->{"forex_$i"}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
918
      $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
935 919
    }
936 920
  }
937 921

  
bin/mozilla/ar.pl
261 261
      s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
262 262
  }
263 263

  
264
  $form->{exchangerate} = $exchangerate
265
    if (
266
        $form->{forex} = (
267
                     $exchangerate =
268
                       $form->check_exchangerate(
269
                       \%myconfig, $form->{currency}, $form->{transdate}, 'buy'
270
                       )));
264
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'buy');
265
  $form->{exchangerate} = $form->{forex} if $form->{forex};
271 266

  
272 267
  # format amounts
273 268
  $form->{exchangerate} =
......
961 956
  $form->{rowcount} = $count + 1;
962 957
  map { $form->{invtotal} += $form->{"amount_$_"} } (1 .. $form->{rowcount});
963 958

  
964
  $form->{exchangerate} = $exchangerate
965
    if (
966
        $form->{forex} = (
967
                     $exchangerate =
968
                       $form->check_exchangerate(
969
                       \%myconfig, $form->{currency}, $form->{transdate}, 'buy'
970
                       )));
959
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, 'buy');
960
  $form->{exchangerate} = $form->{forex} if $form->{forex};
971 961

  
972 962
  $form->{invdate} = $form->{transdate};
973 963
  my $save_AR = $form->{AR};
......
986 976

  
987 977
      $totalpaid += $form->{"paid_$i"};
988 978

  
989
      $form->{"exchangerate_$i"} = $exchangerate
990
        if (
991
            $form->{"forex_$i"} = (
992
                 $exchangerate =
993
                   $form->check_exchangerate(
994
                   \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy'
995
                   )));
979
      $form->{"forex_$i"}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
980
      $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
996 981
    }
997 982
  }
998 983

  
bin/mozilla/cp.pl
579 579
    }
580 580
  }
581 581

  
582
  $form->{exchangerate} = $exchangerate
583
    if (
584
        $form->{forex} = (
585
                   $exchangerate =
586
                     $form->check_exchangerate(
587
                     \%myconfig, $form->{currency}, $form->{datepaid}, $buysell
588
                     )));
582
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{datepaid}, $buysell);
583
  $form->{exchangerate} = $form->{forex} if $form->{forex};
589 584

  
590 585
  $amount = $form->{amount} = $form->parse_amount(\%myconfig, $form->{amount});
591 586

  
bin/mozilla/do.pl
671 671

  
672 672
  $form->{currency}     = $currency;
673 673
  $form->{exchangerate} = "";
674
  $form->{forex}        = ($exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell));
675
  $form->{exchangerate} = $exchangerate if ($form->{forex});
674
  $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, $buysell);
675
  $form->{exchangerate} = $form->{forex} if ($form->{forex});
676 676

  
677 677
  prepare_invoice();
678 678

  
bin/mozilla/io.pl
854 854
  &order_links;
855 855

  
856 856
  $form->{currency}     = $currency;
857
  $form->{exchangerate} = "";
858
  $form->{forex}        = "";
859
  $form->{exchangerate} = $exchangerate
860
    if (
861
        $form->{forex} = (
862
                  $exchangerate =
863
                    $form->check_exchangerate(
864
                    \%myconfig, $form->{currency}, $form->{transdate}, $buysell
865
                    )));
857
  $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell);
858
  $form->{exchangerate} = $form->{forex} || '';
866 859

  
867 860
  for $i (1 .. $form->{rowcount}) {
868
    map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
869
                                                     $form->{"${_}_${i}"})
861
    map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"})
870 862
            if ($form->{"${_}_${i}"}) }
871 863
        qw(ship qty sellprice listprice basefactor));
872 864
  }
......
917 909
  &order_links;
918 910

  
919 911
  $form->{currency}     = $currency;
920
  $form->{exchangerate} = "";
921
  $form->{forex}        = "";
922
  $form->{exchangerate} = $exchangerate
923
    if (
924
        $form->{forex} = (
925
                  $exchangerate =
926
                    $form->check_exchangerate(
927
                    \%myconfig, $form->{currency}, $form->{transdate}, $buysell
928
                    )));
912
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{transdate}, $buysell);
913
  $form->{exchangerate} = $form->{forex} || '';
929 914

  
930 915
  for $i (1 .. $form->{rowcount}) {
931 916
    map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig,
bin/mozilla/ir.pl
893 893

  
894 894
  &check_name(vendor);
895 895

  
896
  $form->{exchangerate} = $exchangerate if
897
    $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell');
896
  $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'sell');
897
  $form->{exchangerate} = $form->{forex} if $form->{forex};
898 898

  
899 899
  for $i (1 .. $form->{paidaccounts}) {
900 900
    next unless $form->{"paid_$i"};
901 901
    map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
902
    $form->{"exchangerate_$i"} = $exchangerate if
903
      $form->{"forex_$i"} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
902
    $form->{"forex_$i"}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'sell');
903
    $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
904 904
  }
905 905

  
906 906
  $i            = $form->{rowcount};
bin/mozilla/is.pl
1230 1230

  
1231 1231
  $form->{taxincluded} ||= $taxincluded;
1232 1232

  
1233
  $form->{exchangerate} = $exchangerate if
1234
    $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
1233
  $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{invdate}, 'buy');
1234
  $form->{exchangerate} = $form->{forex} if $form->{forex};
1235 1235

  
1236 1236
  for $i (1 .. $form->{paidaccounts}) {
1237 1237
    next unless $form->{"paid_$i"};
1238 1238
    map { $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(paid exchangerate);
1239
    $form->{"exchangerate_$i"} = $exchangerate if
1240
      $form->{"forex_$i"} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
1239
    $form->{"forex_$i"}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{"datepaid_$i"}, 'buy');
1240
    $form->{"exchangerate_$i"} = $form->{"forex_$i"} if $form->{"forex_$i"};
1241 1241
  }
1242 1242

  
1243 1243
  $i            = $form->{rowcount};
......
1618 1618
  &invoice_links;
1619 1619

  
1620 1620
  $form->{currency}     = $currency;
1621
  $form->{exchangerate} = "";
1622
  $form->{forex}        = "";
1623
  $form->{exchangerate} = $exchangerate
1624
    if (
1625
        $form->{forex} = (
1626
                    $exchangerate =
1627
                      $form->check_exchangerate(
1628
                      \%myconfig, $form->{currency}, $form->{invdate}, $buysell
1629
                      )));
1621
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, $buysell);
1622
  $form->{exchangerate} = $form->{forex} || '';
1630 1623

  
1631 1624
  $form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
1632 1625

  
bin/mozilla/oe.pl
336 336
  @values = map { $_ } @{ $form->{ALL_CURRENCIES} };
337 337
  %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} };
338 338
  $form->{currency}            = $form->{defaultcurrency} unless $form->{currency};
339
  $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency} && $form->{exchangerate};
339
  $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency};
340 340
  $TMPL_VAR{currencies}        = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"},
341 341
                                                      '-values' => \@values, '-labels' => \%labels)) if scalar @values;
342 342
  push @custom_hiddens, "forex";
......
492 492
  
493 493
  $buysell              = 'buy';
494 494
  $buysell              = 'sell' if ($form->{vc} eq 'vendor');
495
  $form->{exchangerate} = $exchangerate if 
496
    $form->{forex} = $exchangerate = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell);
495
  $form->{forex}        = $form->check_exchangerate(\%myconfig, $form->{currency}, $form->{transdate}, $buysell);
496
  $form->{exchangerate} = $form->{forex} if $form->{forex};
497 497

  
498 498
  $exchangerate = $form->{exchangerate} || 1;
499 499

  
......
1494 1494
  &invoice_links;
1495 1495

  
1496 1496
  $form->{currency}     = $currency;
1497
  $form->{exchangerate} = "";
1498
  $form->{forex}        = "";
1499
  $form->{exchangerate} = $exchangerate
1500
    if (
1501
        $form->{forex} = (
1502
                    $exchangerate =
1503
                      $form->check_exchangerate(
1504
                      \%myconfig, $form->{currency}, $form->{invdate}, $buysell
1505
                      )));
1497
  $form->{forex}        = $form->check_exchangerate( \%myconfig, $form->{currency}, $form->{invdate}, $buysell);
1498
  $form->{exchangerate} = $form->{forex} || '';
1506 1499

  
1507 1500
  $form->{creditremaining} -= ($form->{oldinvtotal} - $form->{ordtotal});
1508 1501

  
templates/webpages/oe/form_header_de.html
132 132
                    <th align="right">Wechselkurs</th>
133 133
                    <td>
134 134
                     [%- IF forex %]
135
                      [% LxERP.format_amount(exchangerate, 0) %]
135
                      [% LxERP.format_amount(exchangerate, 2) %]
136 136
                     [%- ELSE %]
137 137
                      <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
138 138
                     [%- END %]
templates/webpages/oe/form_header_master.html
132 132
                    <th align="right"><translate>Exchangerate</translate></th>
133 133
                    <td>
134 134
                     [%- IF forex %]
135
                      [% LxERP.format_amount(exchangerate, 0) %]
135
                      [% LxERP.format_amount(exchangerate, 2) %]
136 136
                     [%- ELSE %]
137 137
                      <input name="exchangerate" size="10" value="[% HTML.escape(LxERP.format_amount(exchangerate)) %]">
138 138
                     [%- END %]

Auch abrufbar als: Unified diff