- my ($sections) = $quotation->_items_sections(escape => $null_escape);
- foreach my $section (@$sections) {
- $section->{'detail_items'} =
- [ $quotation->_items_pkg('section' => $section, escape_function => $null_escape) ];
- }
+ # 3.x only; 4.x quotation redesign uses actual sections for this
+ # and isn't a weird hack
+ my @items =
+ map { $_->{'pkgnum'} = $_->{'preref_html'}; $_ }
+ $quotation->_items_pkg(escape_function => $null_escape,
+ preref_callback => sub { shift->quotationpkgnum });
+ push @items, $quotation->_items_total();
+
+ my $sections = [
+ { 'description' => 'Estimated Charges',
+ 'detail_items' => \@items
+ }
+ ];
+