Fixes mysql syntax errors logged to apache log files when performing subject
[koha.git] / boraccount.pl
blob2c72251a0f68cd89fec3ea170cea8aae5577f35a
1 #!/usr/bin/perl
3 #wrriten 11/1/2000 by chris@katipo.oc.nz
4 #script to display borrowers account details
6 use strict;
7 use C4::Output;
8 use CGI;
9 use C4::Search;
10 use C4::Auth;
12 my $input=new CGI;
14 my $flagsrequired;
15 $flagsrequired->{circulation}=1;
16 my ($loggedinuser, $cookie, $sessionID) = checkauth($input, 0, $flagsrequired);
19 my $bornum=$input->param('bornum');
20 #get borrower details
21 my $data=borrdata('',$bornum);
24 #get account details
25 my %bor;
26 $bor{'borrowernumber'}=$bornum;
27 my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
31 print $input->header;
32 print startpage();
33 print startmenu('member');
34 print <<printend
35 <FONT SIZE=6><em>Account for $data->{'firstname'} $data->{'surname'}</em></FONT><P>
36 <a href=/cgi-bin/koha/maninvoice.pl?bornum=$bornum><image src=/images/create-man-invoice.gif border=0></a>
37 &nbsp; <a href=/cgi-bin/koha/mancredit.pl?bornum=$bornum><image src=/images/create-man-credit.gif border=0></a>
38 <center>
39 <p>
40 <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
41 <TR VALIGN=TOP>
42 <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=2><B>FINES & CHARGES</TD>
43 <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=1><B>AMOUNT</TD>
44 <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=1><B>STILL OWING</TD>
45 </TR>
47 printend
49 for (my $i=0;$i<$numaccts;$i++){
50 $accts->[$i]{'amount'}+=0.00;
51 $accts->[$i]{'amountoutstanding'}+=0.00;
52 print <<printend
53 <tr VALIGN=TOP >
54 <td>$accts->[$i]{'date'}</td>
55 <TD>$accts->[$i]{'description'}
56 printend
58 if ($accts->[$i]{'accounttype'} ne 'F' && $accts->[$i]{'accounttype'} ne 'FU'){
59 print "$accts->[$i]{'title'}";
61 print <<printend
62 </td>
64 <td>$accts->[$i]{'amount'}</td>
65 <TD>$accts->[$i]{'amountoutstanding'}</td>
66 </tr>
67 printend
70 print <<printend
71 <tr VALIGN=TOP >
72 <TD></td>
73 <TD colspan=2><b>Total Due</b></td>
75 <TD><b>$total</b></td>
77 </tr>
78 </table>
79 <br clear=all>
80 <p> &nbsp; </p>
82 printend
84 print endmenu('member');
85 print endpage();