Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision bea3f989

Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt

  • ID bea3f989a3bb5d1b734cf4e606a668213755e2e0
  • Vorgänger ee9e20c6
  • Nachfolger 0519635d

Nicht mit Wechselkursen arbeiten, wenn keine Währungen konfiguriert sind

Fix für Bug 1349

Unterschiede anzeigen:

bin/mozilla/ap.pl
156 156
  $form->{notes} = $form->{intnotes} unless $form->{notes};
157 157

  
158 158
  # currencies
159
  my @curr = split(/:/, $form->{currencies});
160
  chomp $curr[0];
161
  $form->{defaultcurrency} = $curr[0];
159
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
162 160

  
163
  map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
161
  map { $form->{selectcurrency} .= "<option>$_\n" } $form->get_all_currencies(\%myconfig);
164 162

  
165 163
  # vendors
166 164
  if (@{ $form->{all_vendor} || [] }) {
......
261 259
  my $exchangerate = qq|
262 260
<input type=hidden name=forex value=$form->{forex}>
263 261
|;
264
  if ($form->{currency} ne $form->{defaultcurrency}) {
262
  if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
265 263
    if ($form->{forex}) {
266 264
      $exchangerate .= qq|
267 265
            <tr>
......
639 637
|;
640 638

  
641 639
  my @column_index;
642
  if ($form->{currency} eq $form->{defaultcurrency}) {
640
  if ($form->{defaultcurrency} && ($form->{currency} eq $form->{defaultcurrency})) {
643 641
    @column_index = qw(datepaid source memo paid AP_paid paid_project_id);
644 642
  } else {
645 643
    @column_index = qw(datepaid source memo paid exchangerate AP_paid paid_project_id);
......
692 690
    }
693 691

  
694 692
    $exchangerate = qq|&nbsp;|;
695
    if ($form->{currency} ne $form->{defaultcurrency}) {
693
    if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
696 694
      if ($form->{"forex_$i"}) {
697 695
        $exchangerate =
698 696
          qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
......
985 983
      $form->error($locale->text('Cannot post payment for a closed period!'))
986 984
        if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig));
987 985

  
988
      if ($form->{currency} ne $form->{defaultcurrency}) {
986
      if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
989 987
        $form->{"exchangerate_$i"} = $form->{exchangerate}
990 988
          if ($invdate == $datepaid);
991 989
        $form->isblank("exchangerate_$i",
......
1034 1032
  $form->error($locale->text('Zero amount posting!')) if $zero_amount_posting;
1035 1033

  
1036 1034
  $form->isblank("exchangerate", $locale->text('Exchangerate missing!'))
1037
    if ($form->{currency} ne $form->{defaultcurrency});
1035
    if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency}));
1038 1036
  delete($form->{AP});
1039 1037

  
1040 1038
  for my $i (1 .. $form->{paidaccounts}) {
......
1046 1044
      $form->error($locale->text('Cannot post payment for a closed period!'))
1047 1045
        if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig));
1048 1046

  
1049
      if ($form->{currency} ne $form->{defaultcurrency}) {
1047
      if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
1050 1048
        $form->{"exchangerate_$i"} = $form->{exchangerate}
1051 1049
          if ($transdate == $datepaid);
1052 1050
        $form->isblank("exchangerate_$i",

Auch abrufbar als: Unified diff