From 0c4b51268cd7b4dd912442e6024543fadc56f740 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 11 Jan 2013 13:40:24 +0100 Subject: [PATCH] Revert "Fehler beim Schreiben von tax_id" This reverts commit 94915eda8e84805b5745b81fefc67be9ecde55f8. --- SL/AP.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index 9e3888c96..804c9b478 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -211,10 +211,10 @@ sub post_transaction { qq|INSERT INTO acc_trans | . qq| (trans_id, chart_id, amount, transdate, project_id, taxkey, tax_id)| . qq|VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), | . - qq| ?, ?, ?, ?, ?)|; + qq| ?, ?, ?, ?, (SELECT tax_id FROM taxkeys WHERE taxkey_id= (SELECT taxkey_id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; @values = ($form->{id}, $form->{AP_amounts}{"amount_$i"}, $form->{"amount_$i"}, conv_date($form->{transdate}), - $project_id, $form->{"taxkey_$i"}, conv_i($form->{"tax_id_$i"})); + $project_id, $form->{"taxkey_$i"}, $form->{AP_amounts}{"amount_$i"}, conv_date($form->{transdate})); do_query($form, $dbh, $query, @values); if ($form->{"tax_$i"} != 0) { @@ -223,10 +223,10 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, | . qq| project_id, taxkey, tax_id) | . qq|VALUES (?, (SELECT c.id FROM chart c WHERE c.accno = ?), | . - qq| ?, ?, ?, ?, ?)|; + qq| ?, ?, ?, ?, (SELECT tax_id FROM taxkeys WHERE taxkey_id= (SELECT taxkey_id FROM chart WHERE accno = ?) AND startdate <= ? ORDER BY startdate DESC LIMIT 1))|; @values = ($form->{id}, $form->{AP_amounts}{"tax_$i"}, $form->{"tax_$i"}, conv_date($form->{transdate}), - $project_id, $form->{"taxkey_$i"}, conv_i($form->{"tax_id_$i"})); + $project_id, $form->{"taxkey_$i"}, $form->{AP_amounts}{"tax_$i"}, conv_date($form->{transdate})); do_query($form, $dbh, $query, @values); } -- 2.20.1