]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt
Bug 32977: Add callnumber column to boraccount.tt
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / maninvoice.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE Price %]
5 [% USE Branches %]
6 [% SET footerjs = 1 %]
7
8 [% PROCESS 'accounts.inc' %]
9
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Create manual invoice &rsaquo; Patrons &rsaquo; Koha</title>
12 [% INCLUDE 'doc-head-close.inc' %]
13 </head>
14
15 <body id="pat_maninvoice" class="pat">
16 [% WRAPPER 'header.inc' %]
17     [% INCLUDE 'patron-search-header.inc' %]
18 [% END %]
19
20 [% WRAPPER 'sub-header.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22     <ol>
23         <li>
24             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
28         </li>
29         <li>
30             <a href="#" aria-current="page">
31                 Manual invoice
32             </a>
33         </li>
34     </ol>
35 </nav>
36 [% END %]
37
38 <div class="main container-fluid">
39     <div class="row">
40         <div class="col-sm-10 col-sm-push-2">
41             <main>
42
43
44             [% INCLUDE 'members-toolbar.inc' %]
45
46             <h1>Manual invoice</h1>
47
48             <!-- The manual invoice and credit buttons -->
49             <div class="toptabs">
50                 <ul class="nav nav-tabs" role="tablist">
51                     <li role="presentation" class="transactions">
52                         <a href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Transactions</a>
53                     </li>
54                     <li role="presentation" class="makepayment">
55                         <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Make a payment</a>
56                     </li>
57                     <li role="presentation" class="manualinvoice active">
58                         <a href="/cgi-bin/koha/members/maninvoice.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Create manual invoice</a>
59                     </li>
60                     [% IF CAN_user_updatecharges_manual_credit %]
61                         <li role="presentation" class="manualcredit">
62                             <a href="/cgi-bin/koha/members/mancredit.pl?borrowernumber=[% patron.borrowernumber | uri %]" role="tab">Create manual credit</a>
63                         </li>
64                     [% END %]
65                 </ul> <!-- /.nav.nav-tabs -->
66                 <div class="tab-content">
67                     <div role="tabpanel" class="tab-pane active">
68                 [% IF error == 'itemnumber' %]
69                     <div id="error_message" class="dialog alert">
70                         Error: Invalid barcode entered, please try again
71                     </div>
72                 [% ELSIF error %]
73                     <div id="error_message" class="dialog alert">
74                         An error occurred, please try again: [% error | html %]
75                     </div>
76                 [% END %]
77                 <form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice">
78                     <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
79                     <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
80                     <fieldset class="rows">
81                         <legend>Manual invoice</legend>
82                         <ol>
83                             <li>
84                                 <label for="type">Type: </label>
85                                 <select name="type" id="type">
86                                     [% FOREACH debit_type IN debit_types %]
87                                     [% IF debit_type.code == type %]
88                                     <option value="[% debit_type.code | html %]" selected="selected">[%- PROCESS debit_type_description debit_type=debit_type -%]</option>
89                                     [% ELSE %]
90                                     <option value="[% debit_type.code | html %]">[%- PROCESS debit_type_description debit_type=debit_type -%]</option>
91                                     [% END %]
92                                     [% END %]
93                                 </select>
94                             </li>
95                             <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li>
96                             <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li>
97                             <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li>
98                             <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value="[% amount | $Price on_editing => 1 %]" /> Example: 5.00</li>
99                         </ol>
100                     </fieldset>
101
102                     [% IF available_additional_fields %]
103                         [% INCLUDE 'additional-fields-entry.inc' available=available_additional_fields values=additional_field_values %]
104                     [% END %]
105
106                     <fieldset class="action">
107                         <button type="submit" name="add" class="btn btn-primary" value="save">Save</button>
108                         <button type="submit" name="add" class="btn btn-primary" value="save and pay">Save and pay</button>
109                         <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
110                     </fieldset>
111                 </form>
112
113                     </div> <!-- /.tab-pane -->
114                 </div> <!-- /.tab-content -->
115             </div> <!-- /.toptabs -->
116
117             </main>
118         </div> <!-- /.col-sm-10.col-sm-push-2 -->
119
120         <div class="col-sm-2 col-sm-pull-10">
121             <aside>
122                 [% INCLUDE 'circ-menu.inc' %]
123             </aside>
124         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
125      </div> <!-- /.row -->
126
127 [% MACRO jsinclude BLOCK %]
128     [% INCLUDE 'str/members-menu.inc' %]
129     [% Asset.js("js/members-menu.js") | $raw %]
130     <script>
131         var type_fees = {};
132         [% FOREACH debit_type IN debit_types %]
133             type_fees['[% debit_type.code | html %]'] = "[% IF debit_type.default_amount %][% debit_type.default_amount | $Price on_editing => 1 %][% END %]";
134         [% END %]
135         $(document).ready(function(){
136             $('#maninvoice').preventDoubleFormSubmit();
137             $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
138             $("#invoice_type").on("change",function(){
139                 this.form.desc.value = this.options[this.selectedIndex].value;
140                 this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
141             });
142             [% UNLESS amount.defined %]
143             $("#maninvoice #desc").val($("#maninvoice #type option:selected").text());
144             $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]);
145             [% END %]
146             $("#maninvoice #type").change(function(){
147                 $("#maninvoice #desc").val($(this).find("option:selected").text());
148                 $("#maninvoice #amount").val(type_fees[$(this).val()]);
149             });
150         });
151     </script>
152 [% END %]
153
154 [% INCLUDE 'intranet-bottom.inc' %]