- push @{ $form->{runningnumber} }, $position;
- push @{ $form->{number} }, $form->{"partnumber_$i"};
- push @{ $form->{description} }, $form->{"description_$i"};
- push @{ $form->{longdescription} }, $form->{"longdescription_$i"};
- push @{ $form->{qty} }, $form->format_amount($myconfig, $form->{"qty_$i"});
- push @{ $form->{ship} }, $form->format_amount($myconfig, $form->{"ship_$i"});
- push @{ $form->{unit} }, $form->{"unit_$i"};
- push @{ $form->{bin} }, $form->{"bin_$i"};
- push @{ $form->{partnotes} }, $form->{"partnotes_$i"};
- push @{ $form->{serialnumber} }, $form->{"serialnumber_$i"};
- push @{ $form->{reqdate} }, $form->{"reqdate_$i"};
- push @{ $form->{sellprice} }, $form->{"sellprice_$i"};
- push @{ $form->{listprice} }, $form->{"listprice_$i"};
- push @{ $form->{price_factor} }, $price_factor->{formatted_factor};
- push @{ $form->{price_factor_name} }, $price_factor->{description};
+ push(@{ $form->{TEMPLATE_ARRAYS}->{$_} }, $prepared_template_arrays{$_}[$i - 1]) for @prepared_arrays;
+
+ push @{ $form->{TEMPLATE_ARRAYS}->{entry_type} }, 'normal';
+ push @{ $form->{TEMPLATE_ARRAYS}->{runningnumber} }, $position;
+ push @{ $form->{TEMPLATE_ARRAYS}->{number} }, $form->{"partnumber_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{description} }, $form->{"description_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{longdescription} }, $form->{"longdescription_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{qty} }, $form->format_amount($myconfig, $form->{"qty_$i"});
+ push @{ $form->{TEMPLATE_ARRAYS}->{qty_nofmt} }, $form->{"qty_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{ship} }, $form->format_amount($myconfig, $form->{"ship_$i"});
+ push @{ $form->{TEMPLATE_ARRAYS}->{ship_nofmt} }, $form->{"ship_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{unit} }, $form->{"unit_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{bin} }, $form->{"bin_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{partnotes} }, $form->{"partnotes_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{serialnumber} }, $form->{"serialnumber_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{reqdate} }, $form->{"reqdate_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{sellprice} }, $form->{"sellprice_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{sellprice_nofmt} }, $form->parse_amount($myconfig, $form->{"sellprice_$i"});
+ push @{ $form->{TEMPLATE_ARRAYS}->{listprice} }, $form->format_amount($myconfig, $form->{"listprice_$i"}, 2);
+ push @{ $form->{TEMPLATE_ARRAYS}->{listprice_nofmt} }, $form->{"listprice_$i"};
+ push @{ $form->{TEMPLATE_ARRAYS}->{price_factor} }, $price_factor->{formatted_factor};
+ push @{ $form->{TEMPLATE_ARRAYS}->{price_factor_name} }, $price_factor->{description};
+ push @{ $form->{TEMPLATE_ARRAYS}->{partsgroup} }, $form->{"partsgroup_$i"};