1 <% encode_json( \@return ) %>\
4 # default returned records must maintain consistency with /elements/select-part_pkg.html
6 my $select = 'part_pkg.*, setup_option.optionvalue AS _setup_fee,
7 recur_option.optionvalue AS _recur_fee';
8 my $addl_from .= FS::part_pkg->join_options_sql;
10 my $extra_sql = ' WHERE ' . FS::part_pkg->curuser_pkgs_sql;
12 # equivalent to agent_virt=1 and agent_null=1 in /elements/select-table.html
13 $extra_sql .= ' AND ' .
14 $FS::CurrentUser::CurrentUser->agentnums_sql(
18 my @records = qsearch( {
19 'table' => 'part_pkg',
21 'addl_from' => $addl_from,
23 'extra_sql' => $extra_sql,
24 'order_by' => "ORDER BY pkg",
29 'pkgpart' => $_->pkgpart,
30 'label' => $_->pkg_comment_only,
31 'disabled' => $_->disabled,