Revision b5a41731
Von Sven Schöling vor mehr als 15 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
698 | 698 |
my $dbh = $form->dbconnect($myconfig); |
699 | 699 |
|
700 | 700 |
my $query = |
701 |
qq|SELECT p.id, p.partnumber, p.description, p.sellprice,
|
|
701 |
qq|SELECT p.id, p.partnumber, p.description, p.sellprice, |
|
702 | 702 |
p.weight, p.onhand, p.unit, pg.partsgroup, p.lastcost, |
703 | 703 |
p.price_factor_id, pfac.factor AS price_factor |
704 | 704 |
FROM parts p |
... | ... | |
1516 | 1516 |
|
1517 | 1517 |
$sth->finish(); |
1518 | 1518 |
|
1519 |
my @columns = qw(ean); |
|
1519 |
my @columns = qw(ean image microfiche drawing weight);
|
|
1520 | 1520 |
|
1521 | 1521 |
$query = qq|SELECT id, | . join(', ', @columns) . qq| |
1522 | 1522 |
FROM parts |
... | ... | |
1524 | 1524 |
|
1525 | 1525 |
my %data = selectall_as_map($form, $dbh, $query, 'id', \@columns, @part_ids); |
1526 | 1526 |
|
1527 |
map { $form->{$_} = [] } (qw(make model), @columns); |
|
1527 |
map { $form->{TEMPLATE_ARRAYS}{$_} = [] } (qw(make model), @columns);
|
|
1528 | 1528 |
|
1529 | 1529 |
foreach my $i (1 .. $rowcount) { |
1530 | 1530 |
my $id = $form->{"${prefix}${i}"}; |
... | ... | |
1532 | 1532 |
next if (!$id); |
1533 | 1533 |
|
1534 | 1534 |
foreach (@columns) { |
1535 |
push @{ $form->{$_} }, $data{$id}->{$_}; |
|
1535 |
push @{ $form->{TEMPLATE_ARRAYS}{$_} }, $data{$id}->{$_};
|
|
1536 | 1536 |
} |
1537 | 1537 |
|
1538 |
push @{ $form->{make} }, []; |
|
1539 |
push @{ $form->{model} }, []; |
|
1538 |
push @{ $form->{TEMPLATE_ARRAYS}{make} }, [];
|
|
1539 |
push @{ $form->{TEMPLATE_ARRAYS}{model} }, [];
|
|
1540 | 1540 |
|
1541 | 1541 |
next if (!$makemodel{$id}); |
1542 | 1542 |
|
1543 | 1543 |
foreach my $ref (@{ $makemodel{$id} }) { |
1544 |
map { push @{ $form->{$_}->[-1] }, $ref->{$_} } qw(make model); |
|
1544 |
map { push @{ $form->{TEMPLATE_ARRAYS}{$_}->[-1] }, $ref->{$_} } qw(make model);
|
|
1545 | 1545 |
} |
1546 | 1546 |
} |
1547 | 1547 |
|
Auch abrufbar als: Unified diff
IC.pm->prepare_parts_for_printing an die TEMPLATE_ARRAYS Konvention angepasst,
Dor auch gleich die Spalten drawing, microfiche, image und weight exportiert.
Ausserdem clobbering von TEMPLATE_ARRAYS in IS.pm entfernt.
Fix für Bug 992.