Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ce19982e

Von Jan Büren vor fast 14 Jahren hinzugefügt

  • ID ce19982eebaca18b471aa5ee990c0b8a1602dce2
  • Vorgänger aef4bc0c
  • Nachfolger ab37875e

Currencies nochmal besser kommentiert und fehlerhaften Array wieder rausgenommen. Die callback-Funktion um currency erweitert (@sven donath: muh=kuh hatte ich mal extra dringelassen ...). Ferner ist die Antwort zu department klar: Abteilungen werden bei Rechnungen oder FiBu-Buchungen angegeben und sollten nicht per Zahlungsein- oder -ausgang geändert werden. Entsprechend aus cp.pl und CP.pm entfernt.

Unterschiede anzeigen:

bin/mozilla/cp.pl
74 74
      @{ $form->{"all_$form->{vc}"} };
75 75
  }
76 76

  
77
  # departments
78
  # auf departments kann man auch nicht mehr buchen. Raus oder wieder 
79
  # aktivieren? Im Backend dann auch anpassen. jb 12.10.2010
80
  if (@{ $form->{all_departments} || [] }) {
81
    $form->{selectdepartment} = "<option>\n";
82
    $form->{department}       = "$form->{department}--$form->{department_id}";
83

  
84
    map {
85
      $form->{selectdepartment} .=
86
        "<option>$_->{description}--$_->{id}\n"
87
    } (@{ $form->{all_departments} || [] });
88
  }
89

  
90 77
  CP->paymentaccounts(\%myconfig, \%$form);
91 78

  
92 79
  $form->{selectaccount} = "";
......
105 92
  # old_$FOO habe ich auch noch nicht verstanden ...
106 93
  # Ok. Wenn currency übernommen werden, dann in callback-string über-
107 94
  # geben und hier reinparsen, oder besser multibox oder html auslagern?
108
  @curr_unsorted = split(/:/, $form->{currencies});
109
  chomp $curr_unsorted[0];
110
  @curr = sort {} @curr_unsorted;
95
  # Antwort: form->currency wird mit oldcurrency oder curr[0] überschrieben
96
  # Wofür macht das Sinn?
97
  @curr = split(/:/, $form->{currencies});
98
  chomp $curr[0];
111 99
  $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} =
112 100
    $curr[0];
113 101

  
......
126 114

  
127 115
  $auth->assert('cash');
128 116

  
129
  my ($vc, $vclabel, $allvc, $arap, $department, $exchangerate);
117
  my ($vc, $vclabel, $allvc, $arap, $exchangerate);
130 118
  my ($jsscript, $button1, $button2, $onload);
131 119

  
132 120
  $vclabel = ucfirst $form->{vc};
......
167 155
|;
168 156
    }
169 157
  }
170

  
171
  foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}, "department") {
158
  foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
172 159
    $form->{"select$item"} =~ s/ selected//;
173 160
    $form->{"select$item"} =~
174 161
      s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
......
283 270
          </td>
284 271
          <td align=right>
285 272
            <table>
286
              $department
287 273
              <tr>
288 274
                <th align=right nowrap>| . $locale->text('Account') . qq|</th>
289 275
                <td colspan=3><select name=account>$form->{selectaccount}</select>
......
640 626
  }
641 627

  
642 628
  # Beim Aktualisieren wird das Konto übernommen
643
  $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}";
629
  $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}&$form->{currency}";
644 630

  
645 631
  my $msg1 = "$form->{origtitle} posted!";
646 632
  my $msg2 = "Cannot post $form->{origtitle}!";

Auch abrufbar als: Unified diff