1 <% encode_json( \@return ) %>\
4 my( $pkgpart, $pkgnum ) = $cgi->param('arg');
6 #could worry about agent-virting this so you can't see the add-on pricing of
7 # other agents, but not a real-world big worry
9 my $part_pkg = qsearchs( 'part_pkg', { pkgpart=>$pkgpart } );
13 my $cust_pkg = qsearchs( 'cust_pkg', { pkgnum=>$pkgnum } );
14 %curr_quantity = map { $_->usagepricepart, $_->quantity } $cust_pkg->cust_pkg_usageprice;
19 # probably don't need to be returning js_only anymore?
20 my @return = ($pkgpart, map {
21 my $usagepricepart = $_->usagepricepart;
22 my @inc = ('/elements/cust_pkg_usageprice.html',
23 'usagepricepart' => $usagepricepart,
25 push(@inc,'curr_quantity',($curr_quantity{$usagepricepart} || 0));
26 ( include(@inc, field=>'usagepricenum'.$num, html_only=>1 ),
27 include(@inc, field=>'usagepricenum'.$num++, js_only=>1 ),
30 $part_pkg->part_pkg_usageprice);