Savannah seems out of sync. reloading.Mainly code cleaning and removing of Date:...
[koha.git] / members / payprint.pl
1 #!/usr/bin/perl
2 # WARNING: Not enough context to figure out the correct tabstop size
3 # WARNING: Assume that this file uses 4-character tabs
4
5 # $Id$
6
7 #written 11/1/2000 by chris@katipo.oc.nz
8 #part of the koha library system, script to facilitate paying off fines
9
10
11 # Copyright 2000-2002 Katipo Communications
12 #
13 # This file is part of Koha.
14 #
15 # Koha is free software; you can redistribute it and/or modify it under the
16 # terms of the GNU General Public License as published by the Free Software
17 # Foundation; either version 2 of the License, or (at your option) any later
18 # version.
19 #
20 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
21 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
22 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
23 #
24 # You should have received a copy of the GNU General Public License along with
25 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
26 # Suite 330, Boston, MA  02111-1307 USA
27
28 use strict;
29 use C4::Context;
30 use C4::Auth;
31 use C4::Interface::CGI::Output;
32 use CGI;
33 use C4::Search;
34 use C4::Date;
35 use C4::Members;
36 my $input=new CGI;
37
38 #print $input->header;
39 my $bornum=$input->param('bornum');
40
41 #get borrower details
42 my $data=borrdata('',$bornum);
43 #my $user=C4::Context->preference('defaultbranch');
44 my $amount=$input->param('amount');
45 my $accounttype=$input->param('accounttype');
46 my $desc=$input->param('desc');
47
48 if ($accounttype eq "FU"){
49 $accounttype="Overdue item";
50 }elsif ($accounttype eq "L"){
51 $accounttype="Very Overdue or Lost item";
52 }else{
53 $accounttype="Miscelenaous Fees";
54 }
55         my($template, $loggedinuser, $cookie)
56                 = get_template_and_user ({ template_name => "members/payprint.tmpl",
57                                            query => $input,
58                                            type => "intranet",
59                                            authnotrequired => 0,
60                                            flagsrequired => {borrowers => 1},
61                                            debug => 1,
62                                          });
63         my $user=borrdata('',$loggedinuser);
64 my @datearr = localtime(time());
65 my $todaysdate = (1900+$datearr[5]).'-'.sprintf ("%0.2d", ($datearr[4]+1)).'-'.sprintf ("%0.2d", $datearr[3]);
66         $template->param(firstname => $data->{'firstname'}, date=>format_date($todaysdate),
67                                                         surname => $data->{'surname'},
68                                                         cardnumber => $data->{'cardnumber'},
69                                                         street => $data->{'street'},
70                                                         city => $data->{'city'},
71                                                         phone => $data->{'phone'},
72                                                         email => $data->{'email'},
73                                                         amount=> $amount,
74                                                         desc=> $desc,
75                                                         accounttype=> $accounttype,
76                                                         bornum=>$bornum,
77                                                         loggeduser=>$user->{'firstname'}.' '.$user->{'surname'},
78                                                         );
79         output_html_with_http_headers $input, $cookie, $template->output;
80
81
82
83 # Local Variables:
84 # tab-width: 4
85 # End: