From 39da7f8cf4f0db564e9e6e9d8f5bd8aedcc5aaea Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 8 Jan 2009 10:29:04 +0000 Subject: [PATCH] =?utf8?q?Beim=20Buchen=20von=20Kreditoren-=20und=20Debito?= =?utf8?q?renbuchungen=20immer=20die=20richtigen=20Steuerschl=C3=BCssel=20?= =?utf8?q?in=20acc=5Ftrans=20eintragen.=20Vorher=20konnte=20es=20den=20Fal?= =?utf8?q?l=20geben,=20dass=20bei=20mehreren=20Eintr=C3=A4gen=20f=C3=BCr?= =?utf8?q?=20ein=20Konto=20in=20einer=20Kreditoren-=20oder=20Debitorenbuch?= =?utf8?q?ung=20mit=20unterschiedlichen=20Steuerschl=C3=BCssel=20zwar=20di?= =?utf8?q?e=20richtigen=20Steuers=C3=A4tze=20berechnet=20aber=20die=20fals?= =?utf8?q?chen=20Steuerschl=C3=BCssel=20gespeichert=20wurden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AP.pm | 10 +++------- SL/AR.pm | 10 ++++------ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index 1b7c1d84a..514324522 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -96,10 +96,7 @@ sub post_transaction { qq|ORDER BY c.accno|; $sth = $dbh->prepare($query); $sth->execute($form->{"tax_id_$i"}) || $form->dberror($query . " (" . $form->{"tax_id_$i"} . ")"); - ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = - $sth->fetchrow_array; - $form->{AP_amounts}{"tax_$i"}{taxkey} = $form->{"taxkey_$i"}; - $form->{AP_amounts}{"amount_$i"}{taxkey} = $form->{"taxkey_$i"}; + ($form->{AP_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = $sth->fetchrow_array(); $sth->finish; if ($form->{taxincluded} *= 1) { @@ -212,7 +209,6 @@ sub post_transaction { if ($form->{"amount_$i"} != 0) { my $project_id; $project_id = conv_i($form->{"project_id_$i"}); - $taxkey = $form->{AP_amounts}{"amount_$i"}{taxkey}; # insert detail records in acc_trans $query = @@ -222,7 +218,7 @@ sub post_transaction { qq| ?, ?, ?, ?)|; @values = ($form->{id}, $form->{AP_amounts}{"amount_$i"}, $form->{"amount_$i"}, conv_date($form->{transdate}), - $project_id, $taxkey); + $project_id, $form->{"taxkey_$i"}); do_query($form, $dbh, $query, @values); if ($form->{"tax_$i"} != 0) { @@ -234,7 +230,7 @@ sub post_transaction { qq| ?, ?, ?, ?)|; @values = ($form->{id}, $form->{AP_amounts}{"tax_$i"}, $form->{"tax_$i"}, conv_date($form->{transdate}), - $project_id, $taxkey); + $project_id, $form->{"taxkey_$i"}); do_query($form, $dbh, $query, @values); } diff --git a/SL/AR.pm b/SL/AR.pm index c7965f8d5..14fa809c4 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -86,9 +86,6 @@ sub post_transaction { $query = qq|SELECT c.accno, t.taxkey, t.rate FROM tax t LEFT JOIN chart c ON (c.id = t.chart_id) WHERE t.id = ? ORDER BY c.accno|; ($form->{AR_amounts}{"tax_$i"}, $form->{"taxkey_$i"}, $form->{"taxrate_$i"}) = selectrow_query($form, $dbh, $query, $form->{"tax_id_$i"}); - $form->{AR_amounts}{"tax_$i"}{taxkey} = $form->{"taxkey_$i"}; - $form->{AR_amounts}{"amounts_$i"}{taxkey} = $form->{"taxkey_$i"}; - if ($form->{taxincluded} *= 1) { $tax = $form->{"korrektur_$i"} ? $form->{"tax_$i"} @@ -172,19 +169,20 @@ sub post_transaction { for $i (1 .. $form->{rowcount}) { if ($form->{"amount_$i"} != 0) { my $project_id = conv_i($form->{"project_id_$i"}); - $taxkey = $form->{AR_amounts}{"amounts_$i"}{taxkey}; # insert detail records in acc_trans $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?)|; - @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"amount_$i"}), conv_i($form->{"amount_$i"}), conv_date($form->{transdate}), $project_id, conv_i($taxkey)); + @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"amount_$i"}), conv_i($form->{"amount_$i"}), conv_date($form->{transdate}), $project_id, + conv_i($form->{"taxkey_$i"})); do_query($form, $dbh, $query, @values); if ($form->{"tax_$i"} != 0) { # insert detail records in acc_trans $query = qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), ?, ?, ?, ?)|; - @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"tax_$i"}), conv_i($form->{"tax_$i"}), conv_date($form->{transdate}), $project_id, conv_i($taxkey)); + @values = (conv_i($form->{id}), conv_i($form->{AR_amounts}{"tax_$i"}), conv_i($form->{"tax_$i"}), conv_date($form->{transdate}), $project_id, + conv_i($form->{"taxkey_$i"})); do_query($form, $dbh, $query, @values); } } -- 2.20.1