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.

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