From 0f8092f8a406307b06f92e07381e3eecd08bb09f Mon Sep 17 00:00:00 2001 From: Niclas Zimmermann Date: Wed, 23 Jan 2013 11:25:37 +0100 Subject: [PATCH] tax_id ist nicht zwingend 0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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. --- bin/mozilla/gl.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index a0a1a73f3..626d68817 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -999,6 +999,10 @@ sub post_transaction { my $debitcredit; my %split_safety = (); + my $dbh = $form->dbconnect_noauto(\%myconfig); + my ($notax_id) = selectrow_query($form, $dbh, "SELECT id FROM tax WHERE taxkey = 0 LIMIT 1", ); + $dbh->disconnect; + my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); for my $i (1 .. $form->{rowcount}) { @@ -1039,17 +1043,17 @@ sub post_transaction { $form->{debitlock} = 1; } if ($debitcredit && $credittax) { - $form->{"taxchart_$i"} = "0--0.00"; + $form->{"taxchart_$i"} = "$notax_id--0.00"; } if (!$debitcredit && $debittax) { - $form->{"taxchart_$i"} = "0--0.00"; + $form->{"taxchart_$i"} = "$notax_id--0.00"; } my $amount = ($form->{"debit_$i"} == 0) ? $form->{"credit_$i"} : $form->{"debit_$i"}; my $j = $#a; if (($debitcredit && $credittax) || (!$debitcredit && $debittax)) { - $form->{"taxchart_$i"} = "0--0.00"; + $form->{"taxchart_$i"} = "$notax_id--0.00"; $form->{"tax_$i"} = 0; } my ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"}); -- 2.20.1