X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_cust_credit.html;h=dbab66ae53471bb3c193631e7726c4a3855bc7ec;hb=87f255507af9f14dfbccd37eefd71a148f9af344;hp=1b30685dcec075465a02712c5e7893d9f2fd446e;hpb=47208f7694a6ec1cb979d7d0da7848dfe0e0aa7b;p=freeside.git
diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html
index 1b30685dc..dbab66ae5 100644
--- a/httemplate/search/report_cust_credit.html
+++ b/httemplate/search/report_cust_credit.html
@@ -1,54 +1,54 @@
-
-
- Payment report criteria
-
-
-
-
-
-
- Payment report criteria
-
-
-
+<& /elements/header.html, mt($title) &>
+
+
+
+<& /elements/footer.html &>
+
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
+
+my $sth = dbh->prepare("SELECT DISTINCT usernum FROM cust_credit")
+ or die dbh->errstr;
+$sth->execute or die $sth->errstr;
+my @usernum = map $_->[0], @{$sth->fetchall_arrayref};
+my %access_user =
+ map { $_ => qsearchs('access_user',{'usernum'=>$_})->username }
+ @usernum;
+
+my $unapplied = $cgi->param('unapplied') ? 1 : 0;
+
+my $title = $cgi->param('unapplied') ?
+ 'Unapplied credit report' : 'Credit report';
+
+%init>