selfservice priority sort order, #14029
[freeside.git] / httemplate / misc / xmlhttp-cust_main-discount_terms.cgi
1 % if ( $sub eq 'discount_terms' ) {
2
3 %   my $return = [];
4 %   my $custnum = $cgi->param('arg');
5 %   my $cust_main = '';
6 %   $cust_main = qsearchs({
7 %     'table'   => 'cust_main',
8 %     'hashref' => { 'custnum' => $custnum },
9 %     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
10 %   });
11 %     
12 %   if ($cust_main) {
13 %     $return = [ map [ $_, "$_ months" ], $cust_main->discount_terms ];
14 %   }
15 %
16 <% objToJson($return) %>
17 % } 
18 <%init>
19
20 my $conf = new FS::Conf;
21
22 my $sub = $cgi->param('sub');
23
24 </%init>