From b5a417317ac5bb88c54cd598416a7ce652ee2599 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Wed, 20 May 2009 09:07:24 +0000 Subject: [PATCH] IC.pm->prepare_parts_for_printing an die TEMPLATE_ARRAYS Konvention angepasst, Dor auch gleich die Spalten drawing, microfiche, image und weight exportiert. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ausserdem clobbering von TEMPLATE_ARRAYS in IS.pm entfernt. Fix für Bug 992. --- SL/IC.pm | 14 +++++++------- SL/IS.pm | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index ea8b92926..bc13d3678 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -698,7 +698,7 @@ sub assembly_item { 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 @@ -1516,7 +1516,7 @@ sub prepare_parts_for_printing { $sth->finish(); - my @columns = qw(ean); + my @columns = qw(ean image microfiche drawing weight); $query = qq|SELECT id, | . join(', ', @columns) . qq| FROM parts @@ -1524,7 +1524,7 @@ sub prepare_parts_for_printing { 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}"}; @@ -1532,16 +1532,16 @@ sub prepare_parts_for_printing { 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); } } diff --git a/SL/IS.pm b/SL/IS.pm index 0ec51c10d..2443d852c 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -149,7 +149,7 @@ sub invoice_details { 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]; -- 2.20.1