my $dbh = $form->dbconnect($myconfig);
my $query =
- qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
+ qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost,
p.price_factor_id, pfac.factor AS price_factor
FROM parts p
$sth->finish();
- my @columns = qw(ean);
+ my @columns = qw(ean image microfiche drawing weight);
$query = qq|SELECT id, | . join(', ', @columns) . qq|
FROM parts
my %data = selectall_as_map($form, $dbh, $query, 'id', \@columns, @part_ids);
- map { $form->{$_} = [] } (qw(make model), @columns);
+ map { $form->{TEMPLATE_ARRAYS}{$_} = [] } (qw(make model), @columns);
foreach my $i (1 .. $rowcount) {
my $id = $form->{"${prefix}${i}"};
next if (!$id);
foreach (@columns) {
- push @{ $form->{$_} }, $data{$id}->{$_};
+ push @{ $form->{TEMPLATE_ARRAYS}{$_} }, $data{$id}->{$_};
}
- push @{ $form->{make} }, [];
- push @{ $form->{model} }, [];
+ push @{ $form->{TEMPLATE_ARRAYS}{make} }, [];
+ push @{ $form->{TEMPLATE_ARRAYS}{model} }, [];
next if (!$makemodel{$id});
foreach my $ref (@{ $makemodel{$id} }) {
- map { push @{ $form->{$_}->[-1] }, $ref->{$_} } qw(make model);
+ map { push @{ $form->{TEMPLATE_ARRAYS}{$_}->[-1] }, $ref->{$_} } qw(make model);
}
}
my @payment_arrays = qw(payment paymentaccount paymentdate paymentsource paymentmemo);
- $form->{TEMPLATE_ARRAYS} = { map { $_ => [] } (@arrays, @tax_arrays, @payment_arrays) };
+ map { $form->{TEMPLATE_ARRAYS}{$_} => [] } (@arrays, @tax_arrays, @payment_arrays);
foreach $item (sort { $a->[1] cmp $b->[1] } @partsgroup) {
$i = $item->[0];