From: Sven Schöling Date: Fri, 11 Jan 2013 12:40:24 +0000 (+0100) Subject: Revert "Fehler beim Schreiben von tax_id" X-Git-Tag: release-3.1.0beta1~751 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=0c4b51268cd7b4dd912442e6024543fadc56f740;p=kivitendo-erp.git Revert "Fehler beim Schreiben von tax_id" This reverts commit 94915eda8e84805b5745b81fefc67be9ecde55f8. --- 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); }