From: Sven Schöling Date: Thu, 5 Nov 2009 17:10:38 +0000 (+0100) Subject: Einkaufsrechnung -> Zahlung buchen: sinnlosen Quark gefixt. X-Git-Tag: release-2.6.1beta1~115 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=88e6dce2c094fa468e4397030d2f14289a265e62;p=kivitendo-erp.git Einkaufsrechnung -> Zahlung buchen: sinnlosen Quark gefixt. Eine Variable, in der HTML Code fürs Frontend steht, erst zu löschen, dann unter Umständen wieder mit HTML zu befüllen und _dann_ als symbolische Referenz auf ein Zahlungsobjekt zu nehmen ist einfach nur Quark. --- diff --git a/SL/AP.pm b/SL/AP.pm index ad8749f56..aaf2d5e6e 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -38,6 +38,8 @@ use SL::DBUtils; use SL::IO; use SL::MoreCommon; +use Data::Dumper; + use strict; sub post_transaction { @@ -68,7 +70,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}) { @@ -270,7 +272,7 @@ sub post_transaction { # get paid account - ($form->{AP}{"paid_$i"}) = split(/--/, $form->{"AP_paid_$i"}); + ($form->{"AP_paid_account_$i"}) = split(/--/, $form->{"AP_paid_$i"}); $form->{"datepaid_$i"} = $form->{transdate} unless ($form->{"datepaid_$i"}); @@ -287,9 +289,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; @@ -299,9 +301,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_$i"}, $form->{"paid_$i"}, + @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $form->{"paid_$i"}, conv_date($form->{"datepaid_$i"}), $form->{"source_$i"}, - $form->{"memo_$i"}, $project_id, $form->{AP}{"paid_$i"}); + $form->{"memo_$i"}, $project_id, $form->{"AP_paid_account_$i"}); do_query($form, $dbh, $query, @values); # add exchange rate difference @@ -313,9 +315,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_$i"}, $amount, + @values = ($form->{id}, $form->{"AP_paid_account_$i"}, $amount, conv_date($form->{"datepaid_$i"}), $project_id, - $form->{AP}{"paid_$i"}); + $form->{"AP_paid_account_$i"}); do_query($form, $dbh, $query, @values); } diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index 49dc1589e..551b0ee10 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;