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/ar.pl
147 147
  my $form     = $main::form;
148 148
  my %myconfig = %main::myconfig;
149 149

  
150
  my ($duedate, $taxincluded, @curr);
150
  my ($duedate, $taxincluded);
151 151

  
152 152
  $form->create_links("AR", \%myconfig, "customer");
153 153
  $duedate = $form->{duedate};
......
166 166
  $form->{notes} = $form->{intnotes} unless $form->{notes};
167 167

  
168 168
  # currencies
169
  @curr = split(/:/, $form->{currencies});
170
  chomp $curr[0];
171
  $form->{defaultcurrency} = $curr[0];
169
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
172 170

  
173
  map { $form->{selectcurrency} .= "<option>$_\n" } @curr;
171
  map { $form->{selectcurrency} .= "<option>$_\n" } $form->get_all_currencies(\%myconfig);
174 172

  
175 173
  # customers
176 174
  if (@{ $form->{all_customer} || [] }) {
......
290 288
  $exchangerate = qq|
291 289
<input type=hidden name=forex value=$form->{forex}>
292 290
|;
293
  if ($form->{currency} ne $form->{defaultcurrency}) {
291
  if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
294 292
    if ($form->{forex}) {
295 293
      $exchangerate .= qq|
296 294
        <th align=right>| . $locale->text('Exchangerate') . qq|</th>
......
684 682
        </tr>
685 683
|;
686 684

  
687
  if ($form->{currency} eq $form->{defaultcurrency}) {
685
  if ($form->{defaultcurrency} && ($form->{currency} eq $form->{defaultcurrency})) {
688 686
    @column_index = qw(datepaid source memo paid AR_paid paid_project_id);
689 687
  } else {
690 688
    @column_index = qw(datepaid source memo paid exchangerate AR_paid paid_project_id);
......
737 735
    }
738 736

  
739 737
    $exchangerate = qq|&nbsp;|;
740
    if ($form->{currency} ne $form->{defaultcurrency}) {
738
    if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
741 739
      if ($form->{"forex_$i"}) {
742 740
        $exchangerate =
743 741
          qq|<input type=hidden name="exchangerate_$i" value=$form->{"exchangerate_$i"}>$form->{"exchangerate_$i"}|;
......
1048 1046

  
1049 1047
      $form->error($locale->text('Cannot post payment for a closed period!')) if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig));
1050 1048

  
1051
      if ($form->{currency} ne $form->{defaultcurrency}) {
1049
      if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
1052 1050
#        $form->{"exchangerate_$i"} = $form->{exchangerate} if ($invdate == $datepaid);
1053 1051
        $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
1054 1052
      }
......
1099 1097
    unless grep $_*1, map $form->parse_amount(\%myconfig, $form->{"amount_$_"}), 1..$form->{rowcount};
1100 1098

  
1101 1099
  $form->isblank("exchangerate", $locale->text('Exchangerate missing!'))
1102
    if ($form->{currency} ne $form->{defaultcurrency});
1100
    if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency}));
1103 1101

  
1104 1102
  delete($form->{AR});
1105 1103

  
......
1112 1110
      $form->error($locale->text('Cannot post payment for a closed period!'))
1113 1111
        if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig));
1114 1112

  
1115
      if ($form->{currency} ne $form->{defaultcurrency}) {
1113
      if ($form->{defaultcurrency} && ($form->{currency} ne $form->{defaultcurrency})) {
1116 1114
        $form->{"exchangerate_$i"} = $form->{exchangerate} if ($transdate == $datepaid);
1117 1115
        $form->isblank("exchangerate_$i", $locale->text('Exchangerate for payment missing!'));
1118 1116
      }

Auch abrufbar als: Unified diff