[Koha-cvs] koha negotiate.pl [dev_week]

Kyle Hall kyle.m.hall at gmail.com
Fri Mar 16 17:42:16 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/03/16 16:42:16

Added files:
	.              : negotiate.pl 

Log message:
	This script allows a librarian to actually alter the amount of a fine.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/negotiate.pl?cvsroot=koha&only_with_tag=dev_week&rev=1.1.2.1

Patches:
Index: negotiate.pl
===================================================================
RCS file: negotiate.pl
diff -N negotiate.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ negotiate.pl	16 Mar 2007 16:42:16 -0000	1.1.2.1
@@ -0,0 +1,92 @@
+#!/usr/bin/perl
+# WARNING: Not enough context to figure out the correct tabstop size
+# WARNING: Assume that this file uses 4-character tabs
+
+# $Id: negotiate.pl,v 1.1.2.1 2007/03/16 16:42:16 kylemhall Exp $
+
+#written 11/1/2000 by chris at katipo.oc.nz
+#part of the koha library system, script to facilitate paying off fines
+
+# Copyright 2000-2002 Katipo Communications
+#
+# This file is part of Koha.
+#
+# Koha is free software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the Free Software
+# Foundation; either version 2 of the License, or (at your option) any later
+# version.
+#
+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Context;
+use C4::Auth;
+use C4::Output;
+use CGI;
+use C4::Search;
+use C4::Accounts2;
+use C4::Stats;
+use HTML::Template;
+
+my $input = new CGI;
+
+# Grab the borrower number
+my $bornum = $input->param('bornum');
+if ( $bornum eq '' ) {
+    $bornum = $input->param('bornum0');
+}
+
+# get borrower details
+my $data = borrdata( '', $bornum );
+my $user = $input->remote_user;
+
+# get the template
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "members/pay.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { borrowers => 1 },
+        debug           => 1,
+    }
+);
+
+#get account details
+my %bor;
+$bor{'borrowernumber'} = $bornum;
+
+my @names = $input->param;
+
+# Loop throught the fines, altering each as neccessary
+for ( my $i = 0 ; $i < @names ; $i++ ) {
+    my $amount    = $input->param( 'negotiateFine' . $i );
+    my $accountno = $input->param( 'accountno' . $i );
+
+    if ( $amount ne '' ) {
+      my $dbh = C4::Context->dbh;
+      my $env;
+      my $sth;
+      $sth = $dbh->prepare(
+          "UPDATE accountlines
+       SET 
+         amount = ?,
+         description = CONCAT( description, ' *' ),
+         amountoutstanding = ?,
+         timestamp = NOW( ) 
+       WHERE
+         accountno = ?;"
+      );
+      $sth->execute( $amount, $amount, $accountno );
+      $sth->finish;
+    }
+}
+
+print $input->redirect("/cgi-bin/koha/pay.pl?bornum=$bornum");
+





More information about the Koha-cvs mailing list