Bug 17014: Simplify some code
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / maninvoice.tt
1 [% USE Koha %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Patrons &rsaquo; Create manual invoice</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript">
6 //<![CDATA[
7     var type_fees = {'L':'','F':'','A':'','N':'','M':''};
8     [% FOREACH invoice_types_loo IN invoice_types_loop %]
9         type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
10     [% END %]
11 $(document).ready(function(){
12         $('#maninvoice').preventDoubleFormSubmit();
13         $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
14     $("#invoice_type").on("change",function(){
15         this.form.desc.value = this.options[this.selectedIndex].value;
16         this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
17     });
18 });
19 //]]>
20 </script>
21 </head>
22 <body id="pat_maninvoice" class="pat">
23 [% INCLUDE 'header.inc' %]
24 [% INCLUDE 'patron-search.inc' %]
25
26 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Manual invoice</div>
27
28 <div id="doc3" class="yui-t2">
29    
30    <div id="bd">
31         <div id="yui-main">
32         <div class="yui-b">
33 [% INCLUDE 'members-toolbar.inc' %]
34
35 <!-- The manual invoice and credit buttons -->
36 <div class="statictabs">
37 <ul>
38         <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li>
39         <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li>
40     <li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
41         <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li>
42 </ul>
43 <div class="tabs-container">
44
45 [% IF ( ERROR ) %]
46 [% IF ( ITEMNUMBER ) %]
47   ERROR an invalid itemnumber was entered, please hit back and try again
48 [% END %]
49 [% ELSE %]
50 <form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
51         <fieldset class="rows">
52         <legend>Manual invoice</legend>
53         <ol>
54       <li>
55         <label for="type">Type: </label>
56         <select name="type" id="invoice_type">
57           <option value="L">Lost item</option>
58           <option value="F">Fine</option>
59           <option value="A">Account management fee</option>
60           <option value="N">New card</option>
61           <option value="M">Sundry</option>
62           [% FOREACH invoice_types_loo IN invoice_types_loop %]
63             <option value="[% invoice_types_loo.authorised_value %]">[% invoice_types_loo.authorised_value %]</option>
64           [% END %]
65         </select>
66       </li>
67         <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
68         <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
69     <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
70     <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
71         </ol></fieldset>
72 <fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
73 </form>
74
75 [% END %]
76 </div></div>
77
78 </div>
79 </div>
80
81 <div class="yui-b">
82 [% INCLUDE 'circ-menu.inc' %]
83 </div>
84 </div>
85 [% INCLUDE 'intranet-bottom.inc' %]