Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0f8092f8

Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt

  • ID 0f8092f8a406307b06f92e07381e3eecd08bb09f
  • Vorgänger 2a4516c1
  • Nachfolger a7a0fa6a

tax_id ist nicht zwingend 0

Bei Dialogbuchungen war bisher die tax_id für keine Steuern hartcodiert
0. Das muss allerdings nicht so sein und führt zu Problemen, wenn
der Steuerschlüssel 0 unter einer anderen id gespeichert wurde.

Unterschiede anzeigen:

bin/mozilla/gl.pl
999 999
  my $debitcredit;
1000 1000
  my %split_safety = ();
1001 1001

  
1002
  my $dbh = $form->dbconnect_noauto(\%myconfig);
1003
  my ($notax_id) = selectrow_query($form, $dbh, "SELECT id FROM tax WHERE taxkey = 0 LIMIT 1", );
1004
  $dbh->disconnect;
1005

  
1002 1006
  my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart);
1003 1007

  
1004 1008
  for my $i (1 .. $form->{rowcount}) {
......
1039 1043
      $form->{debitlock} = 1;
1040 1044
    }
1041 1045
    if ($debitcredit && $credittax) {
1042
      $form->{"taxchart_$i"} = "0--0.00";
1046
      $form->{"taxchart_$i"} = "$notax_id--0.00";
1043 1047
    }
1044 1048
    if (!$debitcredit && $debittax) {
1045
      $form->{"taxchart_$i"} = "0--0.00";
1049
      $form->{"taxchart_$i"} = "$notax_id--0.00";
1046 1050
    }
1047 1051
    my $amount = ($form->{"debit_$i"} == 0)
1048 1052
            ? $form->{"credit_$i"}
1049 1053
            : $form->{"debit_$i"};
1050 1054
    my $j = $#a;
1051 1055
    if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) {
1052
      $form->{"taxchart_$i"} = "0--0.00";
1056
      $form->{"taxchart_$i"} = "$notax_id--0.00";
1053 1057
      $form->{"tax_$i"}      = 0;
1054 1058
    }
1055 1059
    my ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});

Auch abrufbar als: Unified diff