From: Sven Schöling Date: Thu, 22 Jul 2010 08:59:51 +0000 (+0200) Subject: Typo und Bugs in retrieve_accounts gefixt. Veraltete Aufrufsyntax von retrieve_accoun... X-Git-Tag: release-2.6.2beta1~222 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6f7c3b1044f67c26a7c7355e991224a7bab733f9;p=kivitendo-erp.git Typo und Bugs in retrieve_accounts gefixt. Veraltete Aufrufsyntax von retrieve_accounts gefixt. --- diff --git a/SL/IC.pm b/SL/IC.pm index 13cf55e00..bb8f194cc 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -1485,8 +1485,6 @@ sub retrieve_accounts { my $dbh = $form->get_standard_dbh; my %args = @_; # part_id => index - my ($query, $sth); - $form->{taxzone_id} *= 1; # transdate madness. @@ -1527,7 +1525,7 @@ sub retrieve_accounts { WHERE p.id = ? SQL - my $sth_tx = prepare_query($::form, $dbh, <fetchrow_hashref($part_id) or next; + $sth_accno->execute($part_id); + my $ref = $sth_accno->fetchrow_hashref or next; $ref->{"inventory_accno_id"} = undef unless $ref->{"is_part"}; @@ -1553,7 +1552,8 @@ SQL $form->{"${_}_accno_$index"} = $accounts{"${_}_accno"} for qw(inventory income expense); my $inc_exp = $form->{"vc"} eq "customer" ? "income" : "expense"; - $ref = $sth->fetchrow_hashref($accounts{"${inc_exp}_accno_id"}, quote_db_date($transdate)) or next; + $sth_tax->execute($accounts{"${inc_exp}_accno_id"}, quote_db_date($transdate)); + $ref = $sth_tax->fetchrow_hashref or next; $form->{"taxaccounts_$index"} = $ref->{"accno"}; $form->{"taxaccounts"} .= "$ref->{accno} "if $form->{"taxaccounts"} !~ /$ref->{accno}/; @@ -1561,6 +1561,9 @@ SQL $form->{"$ref->{accno}_${_}"} = $ref->{$_} for qw(rate description taxnumber); } + $sth_accno->finish; + $sth_tax->finish; + $::lxdebug->leave_sub(2); } diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index 6a0d2fc40..c2e4bd45e 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1979,7 +1979,7 @@ sub relink_accounts { for (my $i = 1; $i <= $form->{"rowcount"}; $i++) { if ($form->{"id_$i"}) { - IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i, 1); + IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i); } } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 5ded2b7aa..2e9ab7f90 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1897,7 +1897,7 @@ sub display_form { $form->{"taxaccounts"} = ""; for my $i (1 .. $form->{"rowcount"}) { - IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i, 1) if $form->{"id_$i"}; + IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i) if $form->{"id_$i"}; } $form->{rowcount}++;