X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/1228aa97dd33175f74c5dfbdf759a6b3d9458f93..6f7c3b1044f67c26a7c7355e991224a7bab733f9:/SL/IC.pm 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); }