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