summaryrefslogtreecommitdiff
path: root/httemplate/misc/xmlhttp-cust_bill-search.html
diff options
context:
space:
mode:
authorBrian Medley <bpm@snafu.org>2012-04-24 07:40:14 -0500
committerBrian Medley <bpm@snafu.org>2012-04-24 07:40:14 -0500
commit05364e1a107233d35792a76bf6d23d00dd5611cf (patch)
treee448de80cfdb2c4de1453d2c8ebdc14febe3498c /httemplate/misc/xmlhttp-cust_bill-search.html
parenta502263ac279815f164ba2abfffec919c6250dcb (diff)
parentbe368a6ee2dca0ddd4aa53c0b912e09498bef24a (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_bill-search.html')
-rw-r--r--httemplate/misc/xmlhttp-cust_bill-search.html18
1 files changed, 18 insertions, 0 deletions
diff --git a/httemplate/misc/xmlhttp-cust_bill-search.html b/httemplate/misc/xmlhttp-cust_bill-search.html
new file mode 100644
index 000000000..46f15d1ab
--- /dev/null
+++ b/httemplate/misc/xmlhttp-cust_bill-search.html
@@ -0,0 +1,18 @@
+<% encode_json(\@return) %>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+die 'access denied' unless $curuser->access_right('View invoices');
+my @return;
+if ( $cgi->param('sub') eq 'custnum_search_open' ) {
+ my $custnum = $cgi->param('arg');
+ #warn "searching invoices for $custnum\n";
+ my $cust_main = FS::cust_main->by_key($custnum);
+ @return = map {
+ +{ $_->hash,
+ 'owed' => $_->owed }
+ } $cust_main->open_cust_bill
+ if $curuser->agentnums_href->{ $cust_main->agentnum };
+}
+
+</%init>