Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Templating mancredit and maninvoice

  • Loading branch information...
commit 3d03be3c86ec619144682d25701690a5ccc38c60 1 parent 55482b6
hdl authored
Showing with 9 additions and 60 deletions.
  1. +4 −28 mancredit.pl
  2. +5 −32 maninvoice.pl
32 mancredit.pl
View
@@ -24,6 +24,7 @@
use strict;
use C4::Output;
use CGI;
+use HTML::Template;
use C4::Search;
use C4::Accounts2;
my $input=new CGI;
@@ -42,32 +43,7 @@
manualinvoice($bornum,$itemnum,$desc,$type,$amount);
print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");
} else {
- print $input->header;
- print startpage();
- print startmenu('member');
-print <<printend
-<Center><h3>Manual Credit</h3></center>
-<form action=/cgi-bin/koha/mancredit.pl method=post>
-<table cellpadding=2 cellspacing=0 border=0>
-<input type=hidden name=bornum value=$bornum>
-<tr><td><b>Borrowernumber<b></td><td>$bornum</td></tr>
-<!--<tr><td><b>Cardnumber<b></td><td></td></tr>-->
-<tr><td><b>Type</b></td><Td>
-<select name=type>
-<option value=C>Credit</option>
-<option value=BAY>Baycorp Adjustment</option>
-<option value=WORK>Worked off</option>
-</select>
-</td></tr>
-<tr><td><b>Itemnumber</b></td><td><input type=text name=itemnum></td></tr>
-<tr><td><b>Description</b></td><td><input type=text name=desc size=50></td></tr>
-<tr><td><b>Amount</b></td><td><input type=text name=amount></td></tr>
-<tr><td><input type=submit name=add value=Add></td></tr>
-</table>
-</form>
-printend
-;
-print endmenu('member');
-print endpage();
-
+ my $template = gettemplate("mancredit.tmpl");
+ $template->param( bornum => $bornum);
+ print "Content-Type: text/html\n\n", $template->output;
}
37 maninvoice.pl
View
@@ -26,8 +26,9 @@
use CGI;
use C4::Search;
use C4::Accounts2;
-my $input=new CGI;
+use HTML::Template;
+my $input=new CGI;
my $bornum=$input->param('bornum');
#get borrower details
@@ -42,35 +43,7 @@
manualinvoice($bornum,$itemnum,$desc,$type,$amount);
print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$bornum");
} else {
- print $input->header;
- print startpage();
- print startmenu('member');
-print <<printend
-<Center><h3>Manual Invoice</h3></center>
-<form action=/cgi-bin/koha/maninvoice.pl method=post>
-<table cellpadding=2 cellspacing=0 border=0>
-<input type=hidden name=bornum value=$bornum>
-<tr><td><b>Borrowernumber<b></td><td>$bornum</td></tr>
-<!--<tr><td><b>Cardnumber<b></td><td></td></tr>-->
-<tr><td><b>Type</b></td><Td>
-<select name=type>
-<option value=L>Lost Item</option>
-<option value=F>Fine</option>
-<option value=A>Account Management Fee</option>
-<option value=N>New Card</option>
-<option value=M>Sundry</option>
-<option value=REF>Cash Refund</option>
-</select>
-</td></tr>
-<tr><td><b>Itemnumber</b></td><td><input type=text name=itemnum></td></tr>
-<tr><td><b>Description</b></td><td><input type=text name=desc size=50></td></tr>
-<tr><td><b>Amount</b></td><td><input type=text name=amount></td></tr>
-<tr><td><input type=submit name=add value=Add></td></tr>
-</table>
-</form>
-printend
-;
-print endmenu('member');
-print endpage();
-
+ my $template=gettemplate("maninvoice.tmpl");
+ $template->param( bornum => $bornum);
+ print "Content-Type: text/html\n\n", $template->output;
}
Please sign in to comment.
Something went wrong with that request. Please try again.