summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
blob: 71e2da5975c302fc6966e3adb1e746452cae8893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
% if ( $sub eq 'discount_terms' ) {
% 
%   my $return = [];
%   my $custnum = $cgi->param('arg');
%   my $cust_main = '';
%   $cust_main = qsearchs({
%     'table'   => 'cust_main',
%     'hashref' => { 'custnum' => $custnum },
%     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
%   });
%     
%   if ($cust_main) {
%     $return = [ map [ $_, "$_ months" ], $cust_main->discount_terms ];
%   }
%
<% objToJson($return) %>
% } 
<%init>

my $conf = new FS::Conf;

my $sub = $cgi->param('sub');

</%init>