Lines 115-121
Link Here
|
115 |
<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> |
115 |
<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> |
116 |
[% END %] |
116 |
[% END %] |
117 |
[% IF CAN_user_updatecharges_refund && account.is_debit && ( account.amountoutstanding != account.amount ) && !(account.status == 'REFUNDED') && !(account.debit_type_code == 'PAYOUT') %] |
117 |
[% IF CAN_user_updatecharges_refund && account.is_debit && ( account.amountoutstanding != account.amount ) && !(account.status == 'REFUNDED') && !(account.debit_type_code == 'PAYOUT') %] |
118 |
<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> |
118 |
<button type="button" class="btn btn-default btn-xs" 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 %]" data-member="[% credit.debit.borrowernumber %]"><i class="fa fa-money"></i> Issue refund</button> |
119 |
[% END %] |
119 |
[% END %] |
120 |
[% IF CAN_user_updatecharges_discount && account.is_debit && ( account.amountoutstanding == account.amount ) && !(account.debit_type_code == 'PAYOUT') %] |
120 |
[% IF CAN_user_updatecharges_discount && account.is_debit && ( account.amountoutstanding == account.amount ) && !(account.debit_type_code == 'PAYOUT') %] |
121 |
<button type="button" data-toggle="modal" data-target="#applyDiscountModal" 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">Apply discount</button> |
121 |
<button type="button" data-toggle="modal" data-target="#applyDiscountModal" 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">Apply discount</button> |
Lines 177-196
Link Here
|
177 |
<input type="text" inputmode="numeric" pattern="[0-9]*" id="amount" name="amount" required="required"> |
177 |
<input type="text" inputmode="numeric" pattern="[0-9]*" id="amount" name="amount" required="required"> |
178 |
<span class="required">Required</span> |
178 |
<span class="required">Required</span> |
179 |
</li> |
179 |
</li> |
180 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
180 |
|
181 |
[% SET excluded = ['SIP00', 'SIP01', 'SIP02'] %] |
181 |
[% INCLUDE 'transaction_types.inc' type="payout" %] |
182 |
[% IF payment_types > 3 %] |
|
|
183 |
<li> |
184 |
<label for="transaction_type">Transaction type: </label> |
185 |
<select name="transaction_type" id="payout_transaction_type"> |
186 |
[% FOREACH pt IN payment_types %] |
187 |
[% UNLESS excluded.grep("^$pt.authorised_value\$").size %] |
188 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
189 |
[% END %] |
190 |
[% END %] |
191 |
</select> |
192 |
</li> |
193 |
[% END %] |
194 |
|
182 |
|
195 |
[% IF Koha.Preference('UseCashRegisters') %] |
183 |
[% IF Koha.Preference('UseCashRegisters') %] |
196 |
<li> |
184 |
<li> |
Lines 246-263
Link Here
|
246 |
<input type="text" inputmode="numeric" pattern="[0-9]*" id="returned" name="amount" required="required"> |
234 |
<input type="text" inputmode="numeric" pattern="[0-9]*" id="returned" name="amount" required="required"> |
247 |
<span class="required">Required</span> |
235 |
<span class="required">Required</span> |
248 |
</li> |
236 |
</li> |
249 |
[% SET payment_types = AuthorisedValues.GetAuthValueDropbox('PAYMENT_TYPE') %] |
237 |
|
250 |
<li> |
238 |
[% INCLUDE 'transaction_types.inc' type="refund" %] |
251 |
<label for="transaction_type">Transaction type: </label> |
|
|
252 |
<select name="transaction_type" id="refund_transaction_type"> |
253 |
<option value="AC">Account credit</option> |
254 |
[% IF payment_types %] |
255 |
[% FOREACH pt IN payment_types %] |
256 |
<option value="[% pt.authorised_value | html %]">[% pt.lib | html %]</option> |
257 |
[% END %] |
258 |
[% END %] |
259 |
</select> |
260 |
</li> |
261 |
|
239 |
|
262 |
[% IF Koha.Preference('UseCashRegisters') %] |
240 |
[% IF Koha.Preference('UseCashRegisters') %] |
263 |
<li> |
241 |
<li> |
Lines 379-389
Link Here
|
379 |
var accountline = button.data('accountline'); |
357 |
var accountline = button.data('accountline'); |
380 |
$('#refundline').val(accountline); |
358 |
$('#refundline').val(accountline); |
381 |
var amount = button.data('amount'); |
359 |
var amount = button.data('amount'); |
382 |
var amountoutstanding = button.data('amountoutstanding'); |
360 |
var amountoutstanding = button.data('amountoutstanding') || 0; |
383 |
var paid = amount - amountoutstanding; |
361 |
var paid = amount - amountoutstanding; |
384 |
$("#paid + span").replaceWith(paid); |
362 |
$("#paid + span").replaceWith(paid); |
385 |
$("#returned").attr({ "value": paid, "max": paid }); |
363 |
$("#returned").attr({ "value": paid, "max": paid }); |
386 |
$("#returned, #refund_transaction_type").focus(); |
364 |
var member = button.data('member'); |
|
|
365 |
if ( member === '' ) { |
366 |
$("#refund_type option[value='AC']").remove(); |
367 |
} else if ( $("#refund_type option[value='AC']").length == 0 ) { |
368 |
$("#refund_type").prepend('<option value="AC" selected="selected">Account credit</option>'); |
369 |
} |
370 |
$("#returned, #refund_type").focus(); |
387 |
}); |
371 |
}); |
388 |
|
372 |
|
389 |
$("#applyDiscountModal").on("shown.bs.modal", function(e){ |
373 |
$("#applyDiscountModal").on("shown.bs.modal", function(e){ |