[Koha-cvs] koha koha-tmpl/intranet-tmpl/prog/en/members/pa... [rel_3_0]

Bruno Toumi btoumi at ouestprovence.fr
Mon Oct 9 15:00:43 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Bruno Toumi <btoumi>	06/10/09 13:00:43

Modified files:
	koha-tmpl/intranet-tmpl/prog/en/members: pay.tmpl 
	members        : pay.pl 

Log message:
	modify display now u can have accountline per notify id and per borrower

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/members/pay.tmpl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4&r2=1.4.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/members/pay.pl?cvsroot=koha&only_with_tag=rel_3_0&r1=1.4&r2=1.4.2.1

Patches:
Index: koha-tmpl/intranet-tmpl/prog/en/members/pay.tmpl
===================================================================
RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/members/pay.tmpl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- koha-tmpl/intranet-tmpl/prog/en/members/pay.tmpl	13 Jun 2006 09:54:30 -0000	1.4
+++ koha-tmpl/intranet-tmpl/prog/en/members/pay.tmpl	9 Oct 2006 13:00:42 -0000	1.4.2.1
@@ -1,5 +1,4 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->Pay Fines for  <!-- TMPL_VAR NAME="surname" -->, <!-- TMPL_VAR NAME="firstname" --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
-
 <!-- TMPL_INCLUDE NAME="menus.inc" -->
 <!-- TMPL_INCLUDE NAME="menu-members.inc" -->
 
@@ -12,11 +11,14 @@
 	<th>Fines &amp; Charges</th>
 	<th>Description</th>
 	<th>Account Type</th>
+	<th>Notify id</th>
+	<th>Level</th>
 	<th>Amount</th>
 	<th>Amount Outstanding</th>
 </tr>
 	
-<!-- TMPL_LOOP name="loop_pay" -->
+<!-- TMPL_LOOP name="allfile" -->
+	<!-- TMPL_LOOP name="loop_pay" -->
 <tr>
 	<td><select name="payfine<!-- TMPL_VAR name="i" -->">
 	<option value="no">Unpaid</option>
@@ -29,17 +31,26 @@
 	<input type="hidden" name="out<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="amountoutstanding" -->" />
 	<input type="hidden" name="bornum<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="bornum" -->" />
 	<input type="hidden" name="accountno<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="accountno" -->" />
+	<input type="hidden" name="notify_id<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="notify_id" -->" />
+	<input type="hidden" name="notify_level<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="notify_level" -->" />
+	<input type="hidden" name="totals<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="totals" -->" />
 	</td>
 	<td><!-- TMPL_VAR name="description" --><!-- TMPL_VAR name="title" --></td>
 	<td><!-- TMPL_VAR name="accounttype" --></td>
+	<td><!-- TMPL_VAR name="notify_id" --></a></td>
+	<td><!-- TMPL_VAR name="notify_level" --></td>
 	<td class="debit"><!-- TMPL_VAR name="amount" --></td>
 	<td class="debit"><!-- TMPL_VAR name="amountoutstanding" --></td>
 </tr>
 <!-- /TMPL_LOOP -->
+<!-- TMPL_IF  NAME="total"-->
 <tr>
-	<td colspan="4">Total Due</td>
+
+	<td colspan="6">Total Due</td>
 	<td><!-- TMPL_VAR name="total" --></td>
 </tr>
+<!--/TMPL_IF-->
+<!-- /TMPL_LOOP  -->
 </table>
 <input type="submit" name="submit"  value="Make Payment" class="submit" /></form>
 <form action="/cgi-bin/koha/members/moremember.pl?bornum=<!-- TMPL_VAR name="bornum" -->" method="get"><input type="hidden" name="bornum" value="<!-- TMPL_VAR NAME="bornum" -->" /> <input type="submit" value="Return to Patron Record" /></form>

Index: members/pay.pl
===================================================================
RCS file: /sources/koha/koha/members/pay.pl,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -b -r1.4 -r1.4.2.1
--- members/pay.pl	21 Jul 2006 09:57:30 -0000	1.4
+++ members/pay.pl	9 Oct 2006 13:00:43 -0000	1.4.2.1
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: pay.pl,v 1.4 2006/07/21 09:57:30 toins Exp $
+# $Id: pay.pl,v 1.4.2.1 2006/10/09 13:00:43 btoumi Exp $
 
 # written 11/1/2000 by chris at katipo.oc.nz
 # part of the koha library system, script to facilitate paying off fines
@@ -32,6 +32,7 @@
 use C4::Accounts2;
 use C4::Stats;
 use C4::Koha;
+use C4::Circulation::Fines;
 use HTML::Template;
 
 my $input=new CGI;
@@ -90,17 +91,26 @@
 					   flagsrequired => {borrowers => 1},
 					   debug => 1,
 					 });
-	if ($total ne ''){
+if ($total ne ''){
 		recordpayment(\%env,$bornum,$total);
-	}
-	my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
+}
+	
+my ($numaccts,$accts,$total)=getboracctrecord('',\%bor);
+	
+#       creation d'une fonction qui va nous retourner le notify_id dans un tableau
 
-	my @loop_pay;
+my @allfile;
+my @notify=NumberNotifyId($bornum);
+	
+my $numberofnotify=scalar(@notify);
+for (my $j=0;$j<scalar(@notify);$j++){
+my @loop_pay;
+my ($numaccts,$accts,$total)=GetBorNotifyAcctRecord('',\%bor,$notify[$j]);
 	for (my $i=0;$i<$numaccts;$i++){
+		my %line;
 		if ($accts->[$i]{'amountoutstanding'} > 0){
 			$accts->[$i]{'amount'}+=0.00;
 			$accts->[$i]{'amountoutstanding'}+=0.00;
-			my %line;
 			$line{i}=$i;
 			$line{itemnumber} = $accts->[$i]{'itemnumber'};
 			$line{accounttype} = $accts->[$i]{'accounttype'};
@@ -110,13 +120,23 @@
 			$line{accountno} = $accts->[$i]{'accountno'};
 			$line{description} = $accts->[$i]{'description'};
 			$line{title} = $accts->[$i]{'title'};
-			push(@loop_pay, \%line);
+				$line{notify_id} = $accts->[$i]{'notify_id'};
+				$line{notify_level} = $accts->[$i]{'notify_level'};
+				
 		}
+		push(@loop_pay ,\%line);
 	}
-	$template->param(firstname => $data->{'firstname'},
+		
+	my $totalnotify=AmountNotify($notify[$j]);
+ 	($totalnotify = '0')if ($totalnotify =~/^0.00/ );
+	push @allfile,{'loop_pay'=>\@loop_pay,'notify'=>$notify[$j],'total'=>$totalnotify};
+}
+
+	$template->param(				
+							allfile => \@allfile,
+							firstname => $data->{'firstname'},
 							surname => $data->{'surname'},
 							bornum => $bornum,
-							loop_pay => \@loop_pay,
 							total => sprintf("%.2f",$total));
 	print "Content-Type: text/html\n\n", $template->output;
 
@@ -153,7 +173,7 @@
 	my $user=$input->remote_user;
 	my $dbh = C4::Context->dbh;
 	my $env;
-	my $sth=$dbh->prepare("Update accountlines set amountoutstanding=0 where accounttype='Res' and accountno=? and borrowernumber=?");
+	my $sth=$dbh->prepare("Update accountlines set amountoutstanding=0 where (accounttype='Res' or accounttype='FU' or accounttype ='IP' OR accounttype='CH' OR accounttype='RE' OR accounttype='RL') and accountno=? and borrowernumber=?");
         $sth->execute($accountnum,$bornum);
       	$sth->finish;
 	$sth=$dbh->prepare("select max(accountno) from accountlines");
@@ -168,6 +188,9 @@
 	UpdateStats($env,$branch,'writeoff',$amount,'','','',$bornum);
 }
 
+
+
+
 # Local Variables:
 # tab-width: 4
 # End:





More information about the Koha-cvs mailing list