[Koha-devel] CVS: koha/circ circulation.pl,1.17,1.18

Chris Cormack rangi at users.sourceforge.net
Tue Apr 3 23:32:39 CEST 2001


Update of /cvsroot/koha/koha/circ
In directory usw-pr-cvs1:/tmp/cvs-serv23813/circ

Modified Files:
	circulation.pl 
Log Message:
Making a change to the way charges are handled, the system originally worked such that if a borrower owed more than $5 issues werent allowed. This worked fine except that often borrowers wish to borrows say 3 pay videos at $2 each, then 2 books say. The three pay videos rack up charges of $6 and then they cant issue the books until that is paid.
Reworked so that it cares about previous charges, not the ones accrued during current issue process.


Index: circulation.pl
===================================================================
RCS file: /cvsroot/koha/koha/circ/circulation.pl,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** circulation.pl	2001/03/28 03:00:56	1.17
--- circulation.pl	2001/04/03 21:32:37	1.18
***************
*** 73,78 ****
  #print $query->dump;
  print startpage();
! print startmenu('circulation');
! 
  
  print <<EOF
--- 73,86 ----
  #print $query->dump;
  print startpage();
! #print startmenu('circulation');
! my @inp=startmenu('circulation');
! if ($query->param('module') eq 'issues' && $query->param('barcode') eq '' && $query->param('charges') eq 'yes'){
!  my $count=@inp;
!  for (my $i=0;$i<$count;$i++){
!   my $bornum=$query->param('borrnumber');
!   $inp[$i]=~ s/onLoad=focusinput\(\)/onLoad=focusinput\(\)\;messenger\(\"\/cgi-bin\/koha\/pay.pl?bornum=$bornum\"\)\;window1.focus\(\)/;
!  }
! }
! print @inp;
  
  print <<EOF
***************
*** 85,89 ****
  </script>
  EOF
! 
  if ($printer && $branch) {
  
--- 93,97 ----
  </script>
  EOF
! ;
  if ($printer && $branch) {
  
***************
*** 226,230 ****
  	
      my $barcodeentrytext= << "EOF";
!     <form method=get>
      <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
  	<tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage><font color=black><b>Enter Book Barcode</b></font></td></tr>
--- 234,238 ----
  	
      my $barcodeentrytext= << "EOF";
!     <form method=post action=/cgi-bin/koha/circ/circulation.pl>
      <table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
  	<tr><td colspan=2 bgcolor=$headerbackgroundcolor align=center background=$backgroundimage><font color=black><b>Enter Book Barcode</b></font></td></tr>
***************
*** 488,492 ****
  	    }
  	    unless ($invalidduedate) {
! 		my ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer, $message) = issuebook(\%env, $borrower, $barcode, \%responses);
  		unless ($iteminformation) {
  		    print << "EOF";
--- 496,502 ----
  	    }
  	    unless ($invalidduedate) {
! 	        my @time=localtime(time);
! 		my $date= (1900+$time[5])."-".($time[4]+1)."-".$time[3];
! 		my ($iteminformation, $duedate, $rejected, $question, $questionnumber, $defaultanswer, $message) = issuebook(\%env, $borrower, $barcode, \%responses,$date);
  		unless ($iteminformation) {
  		    print << "EOF";
***************
*** 506,511 ****
  			print << "EOF"
  			<table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
! 			<tr><th bgcolor= background=$backgroundimage><font color=black>Error Issuing Book</font></th></tr>
! 			<tr><td><font color=red>$rejected</font></td></tr>
  			</table>
  			<br>
--- 516,521 ----
  			print << "EOF"
  			<table border=0 cellpadding=5 cellspacing=0 bgcolor=#dddddd>
! 			<tr><th><font color=black size=6>Error Issuing Book</font></th></tr>
! 			<tr><td><font color=red size=6>$rejected</font></td></tr>
  			</table>
  			<br>
***************
*** 698,702 ****
  	<input type=hidden name=branch value=$branch>
  	<input type=hidden name=printer value=$printer>
! 	</form>
  	</td>
  
--- 708,723 ----
  	<input type=hidden name=branch value=$branch>
  	<input type=hidden name=printer value=$printer>
! 	
! EOF
! ;
!   my $amountold=$flags->{'CHARGES'}->{'message'};
!   my @temp=split(/\$/,$amountold);
!   $amountold=$temp[1];
!   print "<input type=hidden name=oldamount value=$amountold>";
!   if ($flags->{'CHARGES'}){
!             print "<input type=hidden name=charges value=yes>";
!   }
! print <<EOF
! </form>
  	</td>
  
***************
*** 806,810 ****
  	} else {
  	    if ($flag eq 'CHARGES') {
! 		$flaginfotext.="<tr><td valign=top>$flag</td><td $flags->{$flag}->{'message'} <a href=/cgi-bin/koha/pay.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment</a></td></tr>\n";
  	    } elsif ($flag eq 'WAITING') {
  		my $itemswaiting='';
--- 827,831 ----
  	} else {
  	    if ($flag eq 'CHARGES') {
! 		$flaginfotext.="<tr><td valign=top>$flag</td><td> $flags->{$flag}->{'message'} <a href=/cgi-bin/koha/pay.pl?bornum=$borrower->{'borrowernumber'} onClick=\"openWindow(this, 'Payment', 480,640)\">Payment</a></td></tr>\n";
  	    } elsif ($flag eq 'WAITING') {
  		my $itemswaiting='';
***************
*** 838,842 ****
  	}
      }
!     ($flaginfotext) && ($flaginfotext="<tr><td bgcolor=$headerbackgroundcolor background=$backgroundimage colspan=2><b>Flags</b></td></tr>$flaginfotext</table>\n");
      my $patrontable= << "EOF";
      <table border=1
--- 859,864 ----
  	}
      }
!     ($flaginfotext) && ($flaginfotext="<tr><td bgcolor=$headerbackgroundcolor background=$backgroundimage colspan=2><b>Flags</b></td></tr>$flaginfotext\n");
!     $flaginfotext.="</table>";
      my $patrontable= << "EOF";
      <table border=1





More information about the Koha-devel mailing list