6 [% PROCESS 'i18n.inc' %]
8 [% PROCESS 'accounts.inc' %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>[% FILTER collapse %]
11 [% t("Create manual invoice") | html %] ›
12 [% t("Patrons") | html %] ›
13 [% t("Koha") | html %]
15 [% INCLUDE 'doc-head-close.inc' %]
18 <body id="pat_maninvoice" class="pat">
19 [% WRAPPER 'header.inc' %]
20 [% INCLUDE 'patron-search-header.inc' %]
23 [% WRAPPER 'sub-header.inc' %]
24 [% WRAPPER breadcrumbs %]
25 [% WRAPPER breadcrumb_item %]
26 <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
28 [% WRAPPER breadcrumb_item %]
29 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% patron.borrowernumber | uri %]">[% INCLUDE 'patron-title.inc' %]</a>
31 [% WRAPPER breadcrumb_item bc_active= 1 %]
32 <span>Manual invoice</span>
34 [% END #/ WRAPPER breadcrumbs %]
35 [% END #/ WRAPPER sub-header.inc %]
37 <div class="main container-fluid">
39 <div class="col-sm-10 col-sm-push-2">
41 [% INCLUDE 'messages.inc' %]
44 [% INCLUDE 'members-toolbar.inc' %]
46 <h1>Manual invoice</h1>
48 <!-- The manual invoice and credit buttons -->
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>
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>
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>
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>
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
73 <div id="error_message" class="dialog alert">
74 An error occurred, please try again: [% error | html %]
77 <form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice">
78 <input type="hidden" name="op" value="cud-add" />
79 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
80 [% INCLUDE 'csrf-token.inc' %]
81 <fieldset class="rows">
82 <legend>Manual invoice</legend>
85 <label for="type">Type: </label>
86 <select name="type" id="type">
87 [% FOREACH debit_type IN debit_types %]
88 [% IF debit_type.code == type %]
89 <option value="[% debit_type.code | html %]" selected="selected">[%- PROCESS debit_type_description debit_type=debit_type -%]</option>
91 <option value="[% debit_type.code | html %]">[%- PROCESS debit_type_description debit_type=debit_type -%]</option>
96 <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li>
97 <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li>
98 <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li>
99 <li class="additional_field"><label for="cost">Cost: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="cost" id="cost" min="0" value="[% amount | $Price on_editing => 1 %]" /></li>
100 <li class="additional_field"><label for="quantity">Quantity: </label><input type="text" name="quantity" id="quantity" value="1" /></li>
101 <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>
105 [% IF available_additional_fields %]
106 [% INCLUDE 'additional-fields-entry.inc' available=available_additional_fields values=additional_field_values %]
109 <fieldset class="action">
110 <button type="submit" name="add" class="btn btn-primary" value="save">Save</button>
111 <button type="submit" name="add" class="btn btn-primary" value="save and pay">Save and pay</button>
112 <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a>
116 </div> <!-- /.tab-pane -->
117 </div> <!-- /.tab-content -->
118 </div> <!-- /.toptabs -->
121 </div> <!-- /.col-sm-10.col-sm-push-2 -->
123 <div class="col-sm-2 col-sm-pull-10">
125 [% INCLUDE 'circ-menu.inc' %]
127 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
128 </div> <!-- /.row -->
130 [% MACRO jsinclude BLOCK %]
131 [% INCLUDE 'str/members-menu.inc' %]
132 [% Asset.js("js/members-menu.js") | $raw %]
135 [% FOREACH debit_type IN debit_types %]
136 type_fees['[% debit_type.code | html %]'] = "[% IF debit_type.default_amount %][% debit_type.default_amount | $Price on_editing => 1 %][% END %]";
138 $(document).ready(function(){
139 $('#maninvoice').preventDoubleFormSubmit();
140 $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
141 $("#invoice_type").on("change",function(){
142 this.form.desc.value = this.options[this.selectedIndex].value;
143 this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
145 [% UNLESS amount.defined %]
146 $("#maninvoice #desc").val($("#maninvoice #type option:selected").text());
147 $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]);
148 $("#maninvoice #cost").val(type_fees[$("#maninvoice #type option:selected").val()]);
149 if(!type_fees[$("#maninvoice #type option:selected").val()]){
150 $("#maninvoice li.additional_field").hide();
153 $("#maninvoice #type").change(function(){
154 $("#maninvoice #desc").val($(this).find("option:selected").text());
155 $("#maninvoice #amount").val(type_fees[$(this).val()]);
156 $("#maninvoice #cost").val(type_fees[$(this).val()]);
157 $("#maninvoice #quantity").val('1');
158 if(type_fees[$(this).val()]){
159 $("#maninvoice li.additional_field").show();
162 $("#maninvoice li.additional_field").hide();
165 $("#maninvoice #quantity").blur(function(){
166 $("#maninvoice #amount").val(($("#maninvoice #cost").val() * $(this).val()).toFixed(2));
168 $("#maninvoice #cost").blur(function(){
169 $("#maninvoice #amount").val(($("#maninvoice #quantity").val() * $(this).val()).toFixed(2));
175 [% INCLUDE 'intranet-bottom.inc' %]