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