From: Moritz Bunkus Date: Thu, 12 Nov 2009 11:28:53 +0000 (+0100) Subject: Revert "Einkaufsrechnung -> Zahlung buchen: sinnlosen Quark gefixt." X-Git-Tag: release-2.6.1beta1~98 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=452974ed95bccca90fe3991d46c081e46413b643;p=kivitendo-erp.git Revert "Einkaufsrechnung -> Zahlung buchen: sinnlosen Quark gefixt." This reverts commit 88e6dce2c094fa468e4397030d2f14289a265e62. Leider sorgt der besagte Commit dafuer, dass das Buchen von Kreditorenbuchungen total schief laeuft, weil die Aenderung von $form->{AP}{amounts_1} auf $form->{AP_amounts_1} mal eben Variablen aus dem Formular ueberschreibt. Da ich nicht genau weiss, was Sven hier wie fixen wollte, mache ich es erst einmal rueckgaengig & spreche mit Sven darueber, wenn er wieder aus dem Urlaub da ist. --- diff --git a/SL/AP.pm b/SL/AP.pm index aaf2d5e6e..ad8749f56 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -38,8 +38,6 @@ use SL::DBUtils; use SL::IO; use SL::MoreCommon; -use Data::Dumper; - use strict; sub post_transaction { @@ -70,7 +68,7 @@ sub post_transaction { (split(/--/, $form->{"AP_amount_$i"}))[0]; } ($form->{AP_amounts}{payables}) = split(/--/, $form->{APselected}); - ($form->{AP_payables}) = split(/--/, $form->{APselected}); + ($form->{AP}{payables}) = split(/--/, $form->{APselected}); # reverse and parse amounts for my $i (1 .. $form->{rowcount}) { @@ -272,7 +270,7 @@ sub post_transaction { # get paid account - ($form->{"AP_paid_account_$i"}) = split(/--/, $form->{"AP_paid_$i"}); + ($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"}); $form->{"datepaid_$i"} = $form->{transdate} unless ($form->{"datepaid_$i"}); @@ -289,9 +287,9 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, project_id, taxkey) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, | . qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|; - @values = ($form->{id}, $form->{AP_payables}, $amount, + @values = ($form->{id}, $form->{AP}{payables}, $amount, conv_date($form->{"datepaid_$i"}), $project_id, - $form->{AP_payables}); + $form->{AP}{payables}); do_query($form, $dbh, $query, @values); } $form->{payables} = $amount; @@ -301,9 +299,9 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, source, memo, project_id, taxkey) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, ?, ?, ?, | . qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|; - @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"}, + @values = ($form->{id}, $form->{AP}{"paid_$i"}, $form->{"paid_$i"}, conv_date($form->{"datepaid_$i"}), $form->{"source_$i"}, - $form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"}); + $form->{"memo_$i"}, $project_id, $form->{AP}{"paid_$i"}); do_query($form, $dbh, $query, @values); # add exchange rate difference @@ -315,9 +313,9 @@ sub post_transaction { qq|INSERT INTO acc_trans (trans_id, chart_id, amount, transdate, fx_transaction, cleared, project_id, taxkey) | . qq|VALUES (?, (SELECT id FROM chart WHERE accno = ?), ?, ?, 't', 'f', ?, | . qq| (SELECT taxkey_id FROM chart WHERE accno = ?))|; - @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount, + @values = ($form->{id}, $form->{AP}{"paid_$i"}, $amount, conv_date($form->{"datepaid_$i"}), $project_id, - $form->{"AP_paid_account_$i"}); + $form->{AP}{"paid_$i"}); do_query($form, $dbh, $query, @values); } diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 551b0ee10..49dc1589e 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -1070,8 +1070,8 @@ sub post { my ($debitaccno, $debittaxkey) = split /--/, $form->{AP_amountselected}; my ($taxkey, $NULL) = split /--/, $form->{taxchartselected}; my ($payablesaccno, $payablestaxkey) = split /--/, $form->{APselected}; - $form->{AP_amount_1} = $debitaccno; - $form->{AP_payables} = $payablesaccno; + $form->{AP}{amount_1} = $debitaccno; + $form->{AP}{payables} = $payablesaccno; $form->{taxkey} = $taxkey; $form->{storno} = 0;