Lines 87-92
Link Here
|
87 |
[% IF CAN_user_updatecharges_payout && account.is_credit && ( account.amountoutstanding < 0 ) %] |
87 |
[% IF CAN_user_updatecharges_payout && account.is_credit && ( account.amountoutstanding < 0 ) %] |
88 |
<button type="button" data-toggle="modal" data-target="#issuePayoutModal" data-account="[%- PROCESS account_type_description account=account -%]" data-accountline="[% account.accountlines_id | html %]" data-amount="[% account.amountoutstanding | $Price %]" class="btn btn-default btn-xs"><i class="fa fa-money"></i> Issue payout</button> |
88 |
<button type="button" data-toggle="modal" data-target="#issuePayoutModal" data-account="[%- PROCESS account_type_description account=account -%]" data-accountline="[% account.accountlines_id | html %]" data-amount="[% account.amountoutstanding | $Price %]" class="btn btn-default btn-xs"><i class="fa fa-money"></i> Issue payout</button> |
89 |
[% END %] |
89 |
[% END %] |
|
|
90 |
[% IF CAN_user_updatecharges_refund && account.is_debit && ( account.amountoutstanding != account.amount ) && !(account.status == 'REFUNDED' ) %] |
91 |
<button type="button" data-toggle="modal" data-target="#issueRefundModal" data-item="[%- PROCESS account_type_description account=account -%]" data-accountline="[% account.accountlines_id | html %]" data-amount="[% account.amount | $Price %]" data-amountoutstanding="[% account.amountoutstanding | $Price %]" class="btn btn-default btn-xs"><i class="fa fa-money"></i> Issue refund</button> |
92 |
[% END %] |
90 |
</td> |
93 |
</td> |
91 |
</tr> |
94 |
</tr> |
92 |
|
95 |
|
Lines 183-188
Link Here
|
183 |
</form> <!-- /#payout_form --> |
186 |
</form> <!-- /#payout_form --> |
184 |
</div> <!-- /#issuePayoutModal --> |
187 |
</div> <!-- /#issuePayoutModal --> |
185 |
|
188 |
|
|
|
189 |
<!-- Issue refund modal --> |
190 |
<div class="modal" id="issueRefundModal" tabindex="-1" role="dialog" aria-labelledby="issueRefundLabel"> |
191 |
<form id="refund_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated"> |
192 |
<input type="hidden" name="accountlines_id" value="" id="refundline"> |
193 |
<input type="hidden" name="action" value="refund"> |
194 |
<input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]"> |
195 |
<div class="modal-dialog" role="document"> |
196 |
<div class="modal-content"> |
197 |
<div class="modal-header"> |
198 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
199 |
<h4 class="modal-title" id="issueRefundLabel">Issue refund</h4> |
200 |
</div> |
201 |
<div class="modal-body"> |
202 |
<fieldset class="rows"> |
203 |
<ol> |
204 |
<li> |
205 |
<span id="item" class="label">Account: </span><span></span> |
206 |
</li> |
207 |
<li> |
208 |
<span id="paid" class="label">Amount paid: </span><span></span> |
209 |
</li> |
210 |
<li> |
211 |
<label class="required" for="amount">Returned to patron: </label> |
212 |
<input type="number" step="0.01" id="returned" name="amount" value="" required="required"> |
213 |
<span class="required">Required</span> |
214 |
</li> |
215 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
216 |
[% IF payment_types %] |
217 |
<li> |
218 |
<label for="transaction_type">Transaction type: </label> |
219 |
<select name="transaction_type" id="transaction_type"> |
220 |
<option value="AC">Account credit</option> |
221 |
[% FOREACH pt IN payment_types %] |
222 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
223 |
[% END %] |
224 |
</select> |
225 |
</li> |
226 |
[% END %] |
227 |
|
228 |
[% IF Koha.Preference('UseCashRegisters') %] |
229 |
<li> |
230 |
<label for="cash_register">Cash register: </label> |
231 |
<select name="cash_register" id="cash_register"> |
232 |
[% FOREACH register IN registers %] |
233 |
[% IF register.id == registerid %] |
234 |
<option value="[% register.id %]" selected="selected">[% register.name | html %]</option> |
235 |
[% ELSE %] |
236 |
<option value="[% register.id %]">[% register.name | html %]</option> |
237 |
[% END %] |
238 |
[% END %] |
239 |
</select> |
240 |
</li> |
241 |
[% END %] |
242 |
|
243 |
</ol> |
244 |
</fieldset> <!-- /.rows --> |
245 |
</div> <!-- /.modal-body --> |
246 |
<div class="modal-footer"> |
247 |
<input type="hidden" name="registerid" value="[% register.id | html %]"> |
248 |
<input type="hidden" name="op" value="refund"> |
249 |
<button type="submit" class="btn btn-default">Confirm</button> |
250 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
251 |
</div> <!-- /.modal-footer --> |
252 |
</div> <!-- /.modal-content --> |
253 |
</div> <!-- /.modal-dialog --> |
254 |
</form> <!-- /#refund_form --> |
255 |
</div> <!-- /#issueRefundModal --> |
256 |
|
186 |
[% MACRO jsinclude BLOCK %] |
257 |
[% MACRO jsinclude BLOCK %] |
187 |
[% INCLUDE 'datatables.inc' %] |
258 |
[% INCLUDE 'datatables.inc' %] |
188 |
[% INCLUDE 'columns_settings.inc' %] |
259 |
[% INCLUDE 'columns_settings.inc' %] |
Lines 240-245
Link Here
|
240 |
$("#amount, #transaction_type").focus(); |
311 |
$("#amount, #transaction_type").focus(); |
241 |
}); |
312 |
}); |
242 |
|
313 |
|
|
|
314 |
$("#issueRefundModal").on("shown.bs.modal", function(e){ |
315 |
var button = $(e.relatedTarget); |
316 |
var item = button.data('item'); |
317 |
$("#item + span").replaceWith(item); |
318 |
var accountline = button.data('accountline'); |
319 |
$('#refundline').val(accountline); |
320 |
var amount = button.data('amount'); |
321 |
var amountoutstanding = button.data('amountoutstanding'); |
322 |
var paid = amount - amountoutstanding; |
323 |
$("#paid + span").replaceWith(paid); |
324 |
$("#returned").val(paid); |
325 |
$("#returned, #transaction_type").focus(); |
326 |
}); |
243 |
}); |
327 |
}); |
244 |
</script> |
328 |
</script> |
245 |
[% END %] |
329 |
[% END %] |