|
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 166-171
Link Here
|
| 166 |
</div> <!-- /.modal-dialog --> |
173 |
</div> <!-- /.modal-dialog --> |
| 167 |
</div> <!-- /#confirmCashupModal --> |
174 |
</div> <!-- /#confirmCashupModal --> |
| 168 |
|
175 |
|
|
|
176 |
<!-- Issue refund modal --> |
| 177 |
<div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel"> |
| 178 |
<form id="refund_form" method="post" enctype="multipart/form-data" class="validated"> |
| 179 |
<input type="hidden" name="accountline" value="" id="refundline"> |
| 180 |
<div class="modal-dialog" role="document"> |
| 181 |
<div class="modal-content"> |
| 182 |
<div class="modal-header"> |
| 183 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 184 |
<h4 class="modal-title" id="issueRefundLabel">Issue refund from <em>[% register.description | html %]</em></h4> |
| 185 |
</div> |
| 186 |
<div class="modal-body"> |
| 187 |
<fieldset class="rows"> |
| 188 |
<ol> |
| 189 |
<li> |
| 190 |
<span id="item" class="label">Item: </span><span></span> |
| 191 |
</li> |
| 192 |
<li> |
| 193 |
<span id="paid" class="label">Amount paid: </span><span></span> |
| 194 |
</li> |
| 195 |
<li> |
| 196 |
<label class="required" for="amount">Returned to patron: </label> |
| 197 |
<input type="number" step="0.01" id="returned" name="amount" min="0.00" required="required"> |
| 198 |
<span class="required">Required</span> |
| 199 |
</li> |
| 200 |
[% SET payment_types = [] %] |
| 201 |
[% FOR pt IN AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 202 |
[% NEXT IF pt.authorised_value.grep("^SIP[[:digit:]]{2}$").size() %] |
| 203 |
[% payment_types.push(pt) %] |
| 204 |
[% END %] |
| 205 |
<li> |
| 206 |
<label for="transaction_type">Transaction type: </label> |
| 207 |
<select name="transaction_type" id="transaction_type"> |
| 208 |
[% FOREACH pt IN payment_types %] |
| 209 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
| 210 |
[% END %] |
| 211 |
</select> |
| 212 |
</li> |
| 213 |
</ol> |
| 214 |
</fieldset> <!-- /.rows --> |
| 215 |
</div> <!-- /.modal-body --> |
| 216 |
<div class="modal-footer"> |
| 217 |
<input type="hidden" name="registerid" value="[% register.id | html %]"> |
| 218 |
<input type="hidden" name="op" value="refund"> |
| 219 |
<button type="submit" class="btn btn-default">Confirm</button> |
| 220 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
| 221 |
</div> <!-- /.modal-footer --> |
| 222 |
</div> <!-- /.modal-content --> |
| 223 |
</div> <!-- /.modal-dialog --> |
| 224 |
</form> <!-- /#refund_form --> |
| 225 |
</div> <!-- /#issueRefundModal --> |
| 226 |
|
| 169 |
[% MACRO jsinclude BLOCK %] |
227 |
[% MACRO jsinclude BLOCK %] |
| 170 |
[% INCLUDE 'datatables.inc' %] |
228 |
[% INCLUDE 'datatables.inc' %] |
| 171 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
229 |
[% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %] |
|
Lines 190-195
Link Here
|
| 190 |
} |
248 |
} |
| 191 |
})); |
249 |
})); |
| 192 |
|
250 |
|
|
|
251 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
| 252 |
var button = $(e.relatedTarget); |
| 253 |
var item = button.data('item'); |
| 254 |
$("#item + span").replaceWith(item); |
| 255 |
var accountline = button.data('accountline'); |
| 256 |
$('#refundline').val(accountline); |
| 257 |
var amount = button.data('amount'); |
| 258 |
$("#paid + span").replaceWith(amount); |
| 259 |
$("#returned").attr({ "value": amount, "max": amount }); |
| 260 |
$("#returned, #transaction_type").focus(); |
| 261 |
}); |
| 262 |
|
| 193 |
$(".printReceipt").click(function() { |
263 |
$(".printReceipt").click(function() { |
| 194 |
var accountlines_id = $(this).data('accountline'); |
264 |
var accountlines_id = $(this).data('accountline'); |
| 195 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |
265 |
var win = window.open('/cgi-bin/koha/pos/printreceipt.pl?action=print&accountlines_id=' + accountlines_id, '_blank'); |