Kumara - predecessor to Koha
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

111 lines
2.4 KiB

  1. #!/usr/bin/perl
  2. #wrriten 11/1/2000 by chris@katipo.oc.nz
  3. #part of the koha library system, script to facilitate paying off fines
  4. use strict;
  5. use C4::Output;
  6. use CGI;
  7. use C4::Search;
  8. my $input=new CGI;
  9. my $bornum=$input->param('bornum');
  10. #get borrower details
  11. my $data=borrdata('',$bornum);
  12. #get account details
  13. my %bor;
  14. $bor{'borrowernumber'}=$bornum;
  15. my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
  16. my @names=$input->param;
  17. my %inp;
  18. my $check=0;
  19. for (my $i=0;$i<@names;$i++){
  20. my$temp=$input->param($names[$i]);
  21. if ($temp eq 'wo'){
  22. $inp{$names[$i]}=$temp;
  23. $check=1;
  24. }
  25. }
  26. if ($check ==0){
  27. print $input->header;
  28. print startpage();
  29. print startmenu('member');
  30. print <<printend
  31. <FONT SIZE=6><em>Pay Fines for $data->{'firstname'} $data->{'surname'}</em></FONT><P>
  32. <center>
  33. <p>
  34. <TABLE CELLSPACING=0 CELLPADDING=5 border=1 >
  35. <TR VALIGN=TOP>
  36. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=4><B>FINES & CHARGES</TD>
  37. <td bgcolor="99cc33" background="/images/background-mem.gif" colspan=4><B>CALCULATE</TD>
  38. </TR>
  39. <form action=/cgi-bin/koha/pay.pl method=post>
  40. printend
  41. ;
  42. for (my $i=0;$i<$numaccts;$i++){
  43. print <<printend
  44. <tr VALIGN=TOP >
  45. <TD><input type=radio name=payfine$i value=no checked>Unpaid
  46. <input type=radio name=payfine$i value=yes>Pay
  47. <input type=radio name=payfine$i value=wo>Writeoff
  48. <input type=hidden name=itemnumber$i value=$accts->[$i]{'itemnumber'}>
  49. <input type=hidden name=accounttype$i value=$accts->[$i]{'accounttype'}>
  50. <input type=hidden name=bornum value=$bornum>
  51. <input type=hidden name=accountno$i value=$accts->[$i]{'accountno'}>
  52. </td>
  53. <TD>$accts->[$i]{'description'}</td>
  54. <TD>$accts->[$i]{'accounttype'}</td>
  55. <td>$accts->[$i]{'amount'}</td>
  56. <TD>$accts->[$i]{'amountoutstanding'}</td>
  57. </tr>
  58. printend
  59. ;
  60. }
  61. print <<printend
  62. <tr VALIGN=TOP >
  63. <TD></td>
  64. <TD colspan=2><b>Total Due</b></td>
  65. <TD><b>$total</b></td>
  66. </tr>
  67. <tr VALIGN=TOP >
  68. <TD></td>
  69. <TD colspan=3><b>AMOUNT PAID</b></td>
  70. <TD><input type=text name=total value="" SIZE=7></td>
  71. </tr>
  72. <tr VALIGN=TOP >
  73. <TD colspan=5 align=right>
  74. <INPUT TYPE="image" name="submit" VALUE="pay" height=42 WIDTH=187 BORDER=0 src="/images/pay-fines.gif"></td>
  75. </tr>
  76. </form>
  77. </table>
  78. <br clear=all>
  79. <p> &nbsp; </p>
  80. printend
  81. ;
  82. print endmenu('member');
  83. print endpage();
  84. } else {
  85. my $quety=$input->query_string;
  86. print $input->redirect("/cgi-bin/koha/sec/writeoff.pl?$quety");
  87. }