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