p.id IN ($in)
SQL
- my $sth_tax = prepare_query($::form, $dbh, <<SQL);
+ my $query_tax = <<SQL;
SELECT c.accno, t.taxdescription AS description, t.rate, t.taxnumber
FROM tax t
LEFT JOIN chart c ON c.id = t.chart_id
WHERE tk.chart_id = ? AND startdate <= ?
ORDER BY startdate DESC LIMIT 1)
SQL
+ my $sth_tax = prepare_query($::form, $dbh, $query_tax);
while (my ($index => $part_id) = each %args) {
my $ref = $accno_by_part{$part_id} or next;
$form->{"${_}_accno_$index"} = $accounts{"${_}_accno"} for qw(inventory income expense);
- $sth_tax->execute($accounts{$inc_exp}, quote_db_date($transdate));
+ $sth_tax->execute($accounts{$inc_exp}, quote_db_date($transdate)) || $::form->dberror($query_tax);
$ref = $sth_tax->fetchrow_hashref or next;
$form->{"taxaccounts_$index"} = $ref->{"accno"};
next unless $id;
my $prt = $parts_by_id{$id};
my $type_abbr = $::request->presenter->type_abbreviation($prt->part_type);
- push @{ $template_arrays{part_type} }, $type_abbr;
- push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id);
+ push @{ $template_arrays{part_type} }, $prt->part_type;
+ push @{ $template_arrays{part_abbreviation} }, $type_abbr;
+ push @{ $template_arrays{type_and_classific}}, $type_abbr.$::request->presenter->classification_abbreviation($prt->classification_id);
push @{ $template_arrays{separate} }, $::request->presenter->separate_abbreviation($prt->classification_id);
}