X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_cust_credit.html;h=dbab66ae53471bb3c193631e7726c4a3855bc7ec;hb=79ae09bffa5efc73ee1195ea06f8c14d399cef36;hp=56bbd0ac0583947d09e1c332753834d72772d6e7;hpb=386ec52836abbe32ce2fbf575e851a75f6e112f8;p=freeside.git
diff --git a/httemplate/search/report_cust_credit.html b/httemplate/search/report_cust_credit.html
index 56bbd0ac0..dbab66ae5 100644
--- a/httemplate/search/report_cust_credit.html
+++ b/httemplate/search/report_cust_credit.html
@@ -1,36 +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>