Bug 18685: (bug 18551 follow-up) Fix patron toolbar
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / maninvoice.tt
index c4f3142..8fc1f68 100644 (file)
@@ -1,10 +1,20 @@
+[% USE Koha %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Borrowers &rsaquo; Create manual invoice</title>
+<title>Koha &rsaquo; Patrons &rsaquo; Create manual invoice</title>
 [% INCLUDE 'doc-head-close.inc' %]
 <script type="text/javascript">
 //<![CDATA[
+    var type_fees = {'L':'','F':'','A':'','N':'','M':''};
+    [% FOREACH invoice_types_loo IN invoice_types_loop %]
+        type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
+    [% END %]
 $(document).ready(function(){
-       $("fieldset.rows input").keydown(function(e){ return checkEnter(e); });
+        $('#maninvoice').preventDoubleFormSubmit();
+        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
+    $("#invoice_type").on("change",function(){
+        this.form.desc.value = this.options[this.selectedIndex].value;
+        this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
+    });
 });
 //]]>
 </script>
@@ -13,7 +23,7 @@ $(document).ready(function(){
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<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>
+<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>
 
 <div id="doc3" class="yui-t2">
    
@@ -23,11 +33,11 @@ $(document).ready(function(){
 [% INCLUDE 'members-toolbar.inc' %]
 
 <!-- The manual invoice and credit buttons -->
-<div class="toptabs">
-<ul class="ui-tabs-nav">
+<div class="statictabs">
+<ul>
        <li><a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Account</a></li>
        <li><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li>
-       <li class="ui-tabs-selected"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
+    <li class="active"><a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li>
        <li><a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li>
 </ul>
 <div class="tabs-container">
@@ -37,24 +47,13 @@ $(document).ready(function(){
   ERROR an invalid itemnumber was entered, please hit back and try again
 [% END %]
 [% ELSE %]
-<form action="/cgi-bin/koha/members/maninvoice.pl" method="post"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
+<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
        <fieldset class="rows">
-       <legend>Manual Invoice</legend>
+       <legend>Manual invoice</legend>
        <ol>
       <li>
-<script type="text/javascript">
-var type_fees = new Array();
-type_fees['L'] = '';
-type_fees['F'] = '';
-type_fees['A'] = '';
-type_fees['N'] = '';
-type_fees['M'] = '';
-[% FOREACH invoice_types_loo IN invoice_types_loop %]
-type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
-[% END %]
-</script>
         <label for="type">Type: </label>
-        <select name="type" id="type" onchange="this.form.desc.value=this.options[this.selectedIndex].value; this.form.amount.value=type_fees[this.options[this.selectedIndex].value];">
+        <select name="type" id="invoice_type">
           <option value="L">Lost item</option>
           <option value="F">Fine</option>
           <option value="A">Account management fee</option>
@@ -68,7 +67,7 @@ type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.li
        <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
        <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
     <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
-       <li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
+    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
        </ol></fieldset>
 <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>
 </form>