Lines 2-7
Link Here
|
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
3 |
[% USE Koha %] |
3 |
[% USE Koha %] |
4 |
[% USE KohaDates %] |
4 |
[% USE KohaDates %] |
|
|
5 |
[% USE AuthorisedValues %] |
5 |
[% USE Price %] |
6 |
[% USE Price %] |
6 |
[% SET footerjs = 1 %] |
7 |
[% SET footerjs = 1 %] |
7 |
[% PROCESS 'accounts.inc' %] |
8 |
[% PROCESS 'accounts.inc' %] |
Lines 97-103
Link Here
|
97 |
[% credit.debit.amount | $Price %] |
98 |
[% credit.debit.amount | $Price %] |
98 |
</td> |
99 |
</td> |
99 |
<td></td> |
100 |
<td></td> |
100 |
<td></td> |
101 |
<td> |
|
|
102 |
[% IF CAN_user_cash_management_anonymous_refund && !(credit.debit.status == 'REFUNDED' ) %] |
103 |
<button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-quantity="[% credit.debit.note | html %]"><i class="fa fa-money"></i> Issue refund</button> |
104 |
[% ELSIF CAN_user_updatecharges_refund && !(credit.debit.status == 'REFUNDED') && credit.debit.borrowernumber %] |
105 |
<button type="button" class="btn btn-default btn-xs" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=credit.debit -%]" data-accountline="[% credit.debit.accountlines_id | html %]" data-amount="[% credit.debit.amount | $Price %]" data-quantity="[% credit.debit.note | html %]"><i class="fa fa-money"></i> Issue refund</button> |
106 |
[% END %] |
107 |
</td> |
101 |
</tr> |
108 |
</tr> |
102 |
[% END %] |
109 |
[% END %] |
103 |
[% END %] |
110 |
[% END %] |
Lines 147-152
Link Here
|
147 |
</div> |
154 |
</div> |
148 |
</div><!-- /.row --> |
155 |
</div><!-- /.row --> |
149 |
|
156 |
|
|
|
157 |
<!-- Issue refund modal --> |
158 |
<div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel"> |
159 |
<form id="refund_form" method="post" enctype="multipart/form-data" class="validated"> |
160 |
<input type="hidden" name="accountline" value="" id="refundline"> |
161 |
<div class="modal-dialog" role="document"> |
162 |
<div class="modal-content"> |
163 |
<div class="modal-header"> |
164 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
165 |
<h4 class="modal-title" id="issueRefundLabel">Issue refund from <em>[% register.description | html %]</em></h4> |
166 |
</div> |
167 |
<div class="modal-body"> |
168 |
<fieldset class="rows"> |
169 |
<ol> |
170 |
<li> |
171 |
<span id="item" class="label">Item: </span><span></span> |
172 |
</li> |
173 |
<li> |
174 |
<span id="paid" class="label">Amount paid: </span><span></span> |
175 |
</li> |
176 |
<li> |
177 |
<label class="required" for="amount">Returned to patron: </label> |
178 |
<input type="number" step="0.01" id="returned" name="amount" min="0.00" required="required"> |
179 |
<span class="required">Required</span> |
180 |
</li> |
181 |
[% SET payment_types = [] %] |
182 |
[% FOR pt IN AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
183 |
[% NEXT IF pt.authorised_value.grep("^SIP[[:digit:]]{2}$").size() %] |
184 |
[% payment_types.push(pt) %] |
185 |
[% END %] |
186 |
<li> |
187 |
<label for="transaction_type">Transaction type: </label> |
188 |
<select name="transaction_type" id="transaction_type"> |
189 |
[% FOREACH pt IN payment_types %] |
190 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
191 |
[% END %] |
192 |
</select> |
193 |
</li> |
194 |
</ol> |
195 |
</fieldset> <!-- /.rows --> |
196 |
</div> <!-- /.modal-body --> |
197 |
<div class="modal-footer"> |
198 |
<input type="hidden" name="registerid" value="[% register.id | html %]"> |
199 |
<input type="hidden" name="op" value="refund"> |
200 |
<button type="submit" class="btn btn-default">Confirm</button> |
201 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
202 |
</div> <!-- /.modal-footer --> |
203 |
</div> <!-- /.modal-content --> |
204 |
</div> <!-- /.modal-dialog --> |
205 |
</form> <!-- /#refund_form --> |
206 |
</div> <!-- /#issueRefundModal --> |
207 |
|
150 |
[% MACRO jsinclude BLOCK %] |
208 |
[% MACRO jsinclude BLOCK %] |
151 |
[% INCLUDE 'datatables.inc' %] |
209 |
[% INCLUDE 'datatables.inc' %] |
152 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
210 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
Lines 171-176
Link Here
|
171 |
} |
229 |
} |
172 |
})); |
230 |
})); |
173 |
|
231 |
|
|
|
232 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
233 |
var button = $(e.relatedTarget); |
234 |
var item = button.data('item'); |
235 |
$("#item + span").replaceWith(item); |
236 |
var accountline = button.data('accountline'); |
237 |
$('#refundline').val(accountline); |
238 |
var amount = button.data('amount'); |
239 |
$("#paid + span").replaceWith(amount); |
240 |
$("#returned").attr({ "value": amount, "max": amount }); |
241 |
$("#returned, #transaction_type").focus(); |
242 |
}); |
243 |
|
174 |
$(".printReceipt").click(function() { |
244 |
$(".printReceipt").click(function() { |
175 |
var accountlines_id = $(this).data('accountline'); |
245 |
var accountlines_id = $(this).data('accountline'); |
176 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
246 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |