Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision eeb560af

Von Moritz Bunkus vor fast 16 Jahren hinzugefügt

  • ID eeb560af5b33f700fa0cefd5feeadfa6a1c61f1e
  • Vorgänger 47c3bf62
  • Nachfolger d71bfc9b

Bei verschachtelten Schleifen in der inneren Schleife eine andere Schleifenvariable als in der äußeren Schleife benutzen. Bei Perl 5.10 wird ansonsten unter der Bedingung "äußere Schleifenvariable mit my deklariert, innere hingegen ohne my" Speicher korrumpiert, und es trägt zum einfacheren Verständnis bei. Fix für Bug 839.

Unterschiede anzeigen:

SL/IS.pm
279 279

  
280 280
      if ($form->round_amount($taxrate, 7) == 0) {
281 281
        if ($form->{taxincluded}) {
282
          foreach $item (@taxaccounts) {
283
            $taxamount =
284
              $form->round_amount($linetotal * $form->{"${item}_rate"} /
285
                                    (1 + abs($form->{"${item}_rate"})),
286
                                  2);
282
          foreach my $accno (@taxaccounts) {
283
            $taxamount            = $form->round_amount($linetotal * $form->{"${accno}_rate"} / (1 + abs($form->{"${accno}_rate"})), 2);
287 284

  
288
            $taxaccounts{$item} += $taxamount;
289
            $taxdiff            += $taxamount;
285
            $taxaccounts{$accno} += $taxamount;
286
            $taxdiff             += $taxamount;
290 287

  
291
            $taxbase{$item} += $taxbase;
288
            $taxbase{$accno}     += $taxbase;
292 289
          }
293 290
          $taxaccounts{ $taxaccounts[0] } += $taxdiff;
294 291
        } else {
295
          foreach $item (@taxaccounts) {
296
            $taxaccounts{$item} += $linetotal * $form->{"${item}_rate"};
297
            $taxbase{$item}     += $taxbase;
292
          foreach my $accno (@taxaccounts) {
293
            $taxaccounts{$accno} += $linetotal * $form->{"${accno}_rate"};
294
            $taxbase{$accno}     += $taxbase;
298 295
          }
299 296
        }
300 297
      } else {
301
        foreach $item (@taxaccounts) {
302
          $taxaccounts{$item} +=
303
            $taxamount * $form->{"${item}_rate"} / $taxrate;
304
          $taxbase{$item} += $taxbase;
298
        foreach my $accno (@taxaccounts) {
299
          $taxaccounts{$accno} += $taxamount * $form->{"${accno}_rate"} / $taxrate;
300
          $taxbase{$accno}     += $taxbase;
305 301
        }
306 302
      }
307 303
      $tax_rate = $taxrate * 100;
SL/OE.pm
1075 1075
      }
1076 1076

  
1077 1077
      if ($taxamount != 0) {
1078
        foreach my $item (split / /, $form->{"taxaccounts_$i"}) {
1079
          $taxaccounts{$item} += $taxamount * $form->{"${item}_rate"} / $taxrate;
1080
          $taxbase{$item}     += $taxbase;
1078
        foreach my $accno (split / /, $form->{"taxaccounts_$i"}) {
1079
          $taxaccounts{$accno} += $taxamount * $form->{"${accno}_rate"} / $taxrate;
1080
          $taxbase{$accno}     += $taxbase;
1081 1081
        }
1082 1082
      }
1083 1083

  

Auch abrufbar als: Unified diff