X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fsearch%2Freport_cust_credit.html;h=dbab66ae53471bb3c193631e7726c4a3855bc7ec;hb=c4b71bc4459cb7d403cbebede470aeb2c6292a6e;hp=b614e87b29beab09bf1456213e4cc5210ee005ea;hpb=b1fc20ef3b68a8536163fbb17c57bca15555f3c4;p=freeside.git
diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html
index b614e87b2..dbab66ae5 100644
--- a/httemplate/search/report_cust_credit.html
+++ b/httemplate/search/report_cust_credit.html
@@ -1,68 +1,54 @@
-
-
- Credit report criteria
-
-
-
-
-
-
- Credit 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>