|
Lines 84-89
Link Here
|
| 84 |
[% IF account.is_credit %] |
84 |
[% IF account.is_credit %] |
| 85 |
<a href="boraccount.pl?action=void&accountlines_id=[% account.accountlines_id | uri %]&borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void</a> |
85 |
<a href="boraccount.pl?action=void&accountlines_id=[% account.accountlines_id | uri %]&borrowernumber=[% account.borrowernumber | uri %]" class="btn btn-default btn-xs void"><i class="fa fa-ban"></i> Void</a> |
| 86 |
[% END %] |
86 |
[% END %] |
|
|
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> |
| 89 |
[% END %] |
| 87 |
</td> |
90 |
</td> |
| 88 |
</tr> |
91 |
</tr> |
| 89 |
|
92 |
|
|
Lines 113-118
Link Here
|
| 113 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
116 |
</div> <!-- /.col-sm-2.col-sm-pull-10 --> |
| 114 |
</div> <!-- /.row --> |
117 |
</div> <!-- /.row --> |
| 115 |
|
118 |
|
|
|
119 |
<!-- Issue payout modal --> |
| 120 |
<div class="modal" id="issuePayoutModal" tabindex="-1" role="dialog" aria-labelledby="issuePayoutLabel"> |
| 121 |
<form id="payout_form" action="/cgi-bin/koha/members/boraccount.pl" method="get" enctype="multipart/form-data" class="validated"> |
| 122 |
<input type="hidden" name="accountlines_id" value="" id="payoutline"> |
| 123 |
<input type="hidden" name="action" value="payout"> |
| 124 |
<input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]"> |
| 125 |
<div class="modal-dialog" role="document"> |
| 126 |
<div class="modal-content"> |
| 127 |
<div class="modal-header"> |
| 128 |
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> |
| 129 |
<h4 class="modal-title" id="issuePayoutLabel">Issue payout</h4> |
| 130 |
</div> |
| 131 |
<div class="modal-body"> |
| 132 |
<fieldset class="rows"> |
| 133 |
<ol> |
| 134 |
<li> |
| 135 |
<span id="item" class="label">Account: </span><span></span> |
| 136 |
</li> |
| 137 |
<li> |
| 138 |
<span id="paid" class="label">Amount outstanding: </span><span>[% payout.amount | $Price %]</span> |
| 139 |
</li> |
| 140 |
<li> |
| 141 |
<label class="required" for="amount">Returned to patron: </label> |
| 142 |
<input type="number" step="0.01" id="amount" name="amount" value="[% payout.amount | html %]" required="required"> |
| 143 |
<span class="required">Required</span> |
| 144 |
</li> |
| 145 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
| 146 |
[% IF payment_types %] |
| 147 |
<li> |
| 148 |
<label for="transaction_type">Transaction type: </label> |
| 149 |
<select name="transaction_type" id="transaction_type"> |
| 150 |
[% FOREACH pt IN payment_types %] |
| 151 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
| 152 |
[% END %] |
| 153 |
</select> |
| 154 |
</li> |
| 155 |
[% END %] |
| 156 |
|
| 157 |
[% IF Koha.Preference('UseCashRegisters') %] |
| 158 |
<li> |
| 159 |
<label for="cash_register">Cash register: </label> |
| 160 |
<select name="cash_register" id="cash_register"> |
| 161 |
[% FOREACH register IN registers %] |
| 162 |
[% IF register.id == registerid %] |
| 163 |
<option value="[% register.id %]" selected="selected">[% register.name | html %]</option> |
| 164 |
[% ELSE %] |
| 165 |
<option value="[% register.id %]">[% register.name | html %]</option> |
| 166 |
[% END %] |
| 167 |
[% END %] |
| 168 |
</select> |
| 169 |
</li> |
| 170 |
[% END %] |
| 171 |
|
| 172 |
</ol> |
| 173 |
</fieldset> <!-- /.rows --> |
| 174 |
</div> <!-- /.modal-body --> |
| 175 |
<div class="modal-footer"> |
| 176 |
<input type="hidden" name="registerid" value="[% register.id | html %]"> |
| 177 |
<input type="hidden" name="op" value="payout"> |
| 178 |
<button type="submit" class="btn btn-default">Confirm</button> |
| 179 |
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> |
| 180 |
</div> <!-- /.modal-footer --> |
| 181 |
</div> <!-- /.modal-content --> |
| 182 |
</div> <!-- /.modal-dialog --> |
| 183 |
</form> <!-- /#payout_form --> |
| 184 |
</div> <!-- /#issuePayoutModal --> |
| 185 |
|
| 116 |
[% MACRO jsinclude BLOCK %] |
186 |
[% MACRO jsinclude BLOCK %] |
| 117 |
[% INCLUDE 'datatables.inc' %] |
187 |
[% INCLUDE 'datatables.inc' %] |
| 118 |
[% INCLUDE 'columns_settings.inc' %] |
188 |
[% INCLUDE 'columns_settings.inc' %] |
|
Lines 157-162
Link Here
|
| 157 |
e.preventDefault(); |
227 |
e.preventDefault(); |
| 158 |
} |
228 |
} |
| 159 |
}); |
229 |
}); |
|
|
230 |
|
| 231 |
$("#issuePayoutModal").on("shown.bs.modal", function(e){ |
| 232 |
var button = $(e.relatedTarget); |
| 233 |
var account = button.data('account'); |
| 234 |
$("#account + span").replaceWith(account); |
| 235 |
var accountline = button.data('accountline'); |
| 236 |
$('#payoutline').val(accountline); |
| 237 |
var amount = button.data('amount') * -1; |
| 238 |
$("#paid + span").replaceWith(amount); |
| 239 |
$("#amount").val(amount); |
| 240 |
$("#amount, #transaction_type").focus(); |
| 241 |
}); |
| 242 |
|
| 160 |
}); |
243 |
}); |
| 161 |
</script> |
244 |
</script> |
| 162 |
[% END %] |
245 |
[% END %] |