Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a9f5ce46

Von Moritz Bunkus vor etwa 14 Jahren hinzugefügt

  • ID a9f5ce465e84488e8dd60bda636bbde1812dbc8f
  • Vorgänger 1bb4746a
  • Nachfolger 83c51f89

Globale Variablen entfernt/umgewandelt.

Unterschiede anzeigen:

bin/mozilla/gl.pl
74 74
# $locale->text('Nov')
75 75
# $locale->text('Dec')
76 76

  
77
my $tax;
78
my $debitlock  = 0;
79
my $creditlock = 0;
80

  
81 77
sub add {
82 78
  $main::lxdebug->enter_sub();
83 79

  
......
96 92
  # yep. aber er holt hier auch schon ALL_CHARTS. Aufwand / Nutzen? jb
97 93
  GL->transaction(\%myconfig, \%$form);
98 94

  
99
  map {
100
    $tax .=
101
      qq|<option value="$_->{id}--$_->{rate}">$_->{taxdescription}  |
102
      . ($_->{rate} * 100) . qq| %|
103
  } @{ $form->{TAX} };
104

  
105 95
  $form->{rowcount}  = 2;
106 96

  
107 97
  $form->{debit}  = 0;
......
136 126

  
137 127
  GL->transaction(\%myconfig, \%$form);
138 128

  
139
  map {
140
    $tax .=
141
      qq|<option value="$_->{id}--$_->{rate}">$_->{taxdescription}  |
142
      . ($_->{rate} * 100) . qq| %|
143
  } @{ $form->{TAX} };
144

  
145 129
  $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
146 130

  
147 131
  # departments
......
715 699
        $form->{"credit_$i"} = 0;
716 700
        $form->{"tax_$i"}    = 0;
717 701
        $creditcount--;
718
        $creditlock = 1;
702
        $form->{creditlock} = 1;
719 703
      }
720 704
      if (($creditcount >= 2) && ($debitcount == 2)) {
721 705
        $form->{"debit_$i"} = 0;
722 706
        $form->{"tax_$i"}   = 0;
723 707
        $debitcount--;
724
        $debitlock = 1;
708
        $form->{debitlock} = 1;
725 709
      }
726 710
      if (($creditcount == 1) && ($debitcount == 2)) {
727
        $creditlock = 1;
711
        $form->{creditlock} = 1;
728 712
      }
729 713
      if (($creditcount == 2) && ($debitcount == 1)) {
730
        $debitlock = 1;
714
        $form->{debitlock} = 1;
731 715
      }
732 716
      if ($debitcredit && $credittax) {
733 717
        $form->{"taxchart_$i"} = "0--0.00";
......
895 879
      . $cgi->hidden('-name' => "previous_accno_$i",
896 880
                     '-default' => $selected_accno_full)
897 881
      . qq|</td>|;
898
    $tax = qq|<td>| .
882
    my $tax_ddbox = qq|<td>| .
899 883
      NTI($cgi->popup_menu('-name' => "taxchart_$i",
900 884
                           '-id' => "taxchart_$i",
901 885
                           '-style' => 'width:200px',
......
953 937
    my $debitreadonly  = "";
954 938
    my $creditreadonly = "";
955 939
    if ($i == $form->{rowcount}) {
956
      if ($debitlock) {
940
      if ($form->{debitlock}) {
957 941
        $debitreadonly = "readonly";
958
      } elsif ($creditlock) {
942
      } elsif ($form->{creditlock}) {
959 943
        $creditreadonly = "readonly";
960 944
      }
961 945
    }
......
977 961
    <td><input name="debit_$i" size="8" value="$form->{"debit_$i"}" accesskey=$i $copy2credit $debitreadonly></td>
978 962
    <td><input name="credit_$i" size=8 value="$form->{"credit_$i"}" $creditreadonly></td>
979 963
    <td><input type="hidden" name="tax_$i" value="$form->{"tax_$i"}">$form->{"tax_$i"}</td>
980
    $tax|;
964
    $tax_ddbox|;
981 965

  
982 966
    if ($form->{show_details}) {
983 967
      print qq|
......
1491 1475
      $form->{"credit_$i"} = 0;
1492 1476
      $form->{"tax_$i"}    = 0;
1493 1477
      $creditcount--;
1494
      $creditlock = 1;
1478
      $form->{creditlock} = 1;
1495 1479
    }
1496 1480
    if (($creditcount >= 2) && ($debitcount == 2)) {
1497 1481
      $form->{"debit_$i"} = 0;
1498 1482
      $form->{"tax_$i"}   = 0;
1499 1483
      $debitcount--;
1500
      $debitlock = 1;
1484
      $form->{debitlock} = 1;
1501 1485
    }
1502 1486
    if (($creditcount == 1) && ($debitcount == 2)) {
1503
      $creditlock = 1;
1487
      $form->{creditlock} = 1;
1504 1488
    }
1505 1489
    if (($creditcount == 2) && ($debitcount == 1)) {
1506
      $debitlock = 1;
1490
      $form->{debitlock} = 1;
1507 1491
    }
1508 1492
    if ($debitcredit && $credittax) {
1509 1493
      $form->{"taxchart_$i"} = "0--0.00";
......
1557 1541
  for my $i (1 .. $form->{rowcount}) {
1558 1542
    my $dr  = $form->{"debit_$i"};
1559 1543
    my $cr  = $form->{"credit_$i"};
1560
    $tax = $form->{"tax_$i"};
1544
    my $tax = $form->{"tax_$i"};
1561 1545
    if ($dr && $cr) {
1562 1546
      $form->error($locale->text('Cannot post transaction with a debit and credit entry for the same account!'));
1563 1547
    }

Auch abrufbar als: Unified diff