bugfix
[koha.git] / mancredit.pl
blob5612e214b97613487ecc2ab9d5f4ad4b6d2ac0f6
1 #!/usr/bin/perl
3 #wrriten 11/1/2000 by chris@katipo.oc.nz
4 #script to display borrowers account details
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
14 # version.
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
24 use strict;
25 use C4::Output;
26 use CGI;
27 use C4::Search;
28 use C4::Accounts2;
29 my $input=new CGI;
32 my $bornum=$input->param('bornum');
33 #get borrower details
34 my $data=borrdata('',$bornum);
35 my $add=$input->param('add');
36 if ($add){
37 my $itemnum=$input->param('itemnum');
38 my $desc=$input->param('desc');
39 my $amount=$input->param('amount');
40 $amount = -$amount;
41 my $type=$input->param('type');
42 manualinvoice($bornum,$itemnum,$desc,$type,$amount);
43 print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");
44 } else {
45 print $input->header;
46 print startpage();
47 print startmenu('member');
48 print <<printend
49 <Center><h3>Manual Credit</h3></center>
50 <form action=/cgi-bin/koha/mancredit.pl method=post>
51 <table cellpadding=2 cellspacing=0 border=0>
52 <input type=hidden name=bornum value=$bornum>
53 <tr><td><b>Borrowernumber<b></td><td>$bornum</td></tr>
54 <!--<tr><td><b>Cardnumber<b></td><td></td></tr>-->
55 <tr><td><b>Type</b></td><Td>
56 <select name=type>
57 <option value=C>Credit</option>
58 <option value=BAY>Baycorp Adjustment</option>
59 <option value=WORK>Worked off</option>
60 </select>
61 </td></tr>
62 <tr><td><b>Itemnumber</b></td><td><input type=text name=itemnum></td></tr>
63 <tr><td><b>Description</b></td><td><input type=text name=desc size=50></td></tr>
64 <tr><td><b>Amount</b></td><td><input type=text name=amount></td></tr>
65 <tr><td><input type=submit name=add value=Add></td></tr>
66 </table>
67 </form>
68 printend
70 print endmenu('member');
71 print endpage();