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.

114 lines
2.5 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. if ($accts->[$i]{'amountoutstanding'} > 0){
  44. print <<printend
  45. <tr VALIGN=TOP >
  46. <TD><input type=radio name=payfine$i value=no checked>Unpaid
  47. <input type=radio name=payfine$i value=yes>Pay
  48. <input type=radio name=payfine$i value=wo>Writeoff
  49. <input type=hidden name=itemnumber$i value=$accts->[$i]{'itemnumber'}>
  50. <input type=hidden name=accounttype$i value=$accts->[$i]{'accounttype'}>
  51. <input type=hidden name=amount$i value=$accts->[$i]{'amount'}>
  52. <input type=hidden name=bornum value=$bornum>
  53. <input type=hidden name=accountno$i value=$accts->[$i]{'accountno'}>
  54. </td>
  55. <TD>$accts->[$i]{'description'}</td>
  56. <TD>$accts->[$i]{'accounttype'}</td>
  57. <td>$accts->[$i]{'amount'}</td>
  58. <TD>$accts->[$i]{'amountoutstanding'}</td>
  59. </tr>
  60. printend
  61. ;
  62. }
  63. }
  64. print <<printend
  65. <tr VALIGN=TOP >
  66. <TD></td>
  67. <TD colspan=2><b>Total Due</b></td>
  68. <TD><b>$total</b></td>
  69. </tr>
  70. <tr VALIGN=TOP >
  71. <TD></td>
  72. <TD colspan=3><b>AMOUNT PAID</b></td>
  73. <TD><input type=text name=total value="" SIZE=7></td>
  74. </tr>
  75. <tr VALIGN=TOP >
  76. <TD colspan=5 align=right>
  77. <INPUT TYPE="image" name="submit" VALUE="pay" height=42 WIDTH=187 BORDER=0 src="/images/pay-fines.gif"></td>
  78. </tr>
  79. </form>
  80. </table>
  81. <br clear=all>
  82. <p> &nbsp; </p>
  83. printend
  84. ;
  85. print endmenu('member');
  86. print endpage();
  87. } else {
  88. my $quety=$input->query_string;
  89. print $input->redirect("/cgi-bin/koha/sec/writeoff.pl?$quety");
  90. }