Bug 23674: Add ability to add note to canceled charge
To test, with this patchset applied: 1) From patron accounting page -> Add a manual invoice 2) Under the transaction tab click 'Cancel charge' 3) You should see a modal that gives you the option to type in a note. 4) Type something in and select submit. 5) Ensure the note shows up in the note column. Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
72c60c11b4
commit
994959db48
3 changed files with 60 additions and 14 deletions
|
@ -420,6 +420,7 @@ sub cancel {
|
|||
borrowernumber => $self->borrowernumber,
|
||||
interface => 'intranet',
|
||||
branchcode => $params->{branch},
|
||||
note => $params->{note},
|
||||
}
|
||||
)->store();
|
||||
|
||||
|
|
|
@ -193,15 +193,15 @@
|
|||
>
|
||||
[% END %]
|
||||
[% IF account.is_debit && account.amount == account.amountoutstanding && account.status != 'CANCELLED' && !(account.debit_type_code == 'PAYOUT') %]
|
||||
<form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="op" value="cud-cancel" />
|
||||
<input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]" />
|
||||
<button type="submit" class="btn btn-default btn-xs cancel-action">
|
||||
<i class="fa fa-ban"></i>
|
||||
Cancel charge
|
||||
</button>
|
||||
</form>
|
||||
<button
|
||||
type="button"
|
||||
data-toggle="modal"
|
||||
data-target="#cancelChargeModal"
|
||||
data-accountlines_id="[% account.accountlines_id | html %]"
|
||||
data-borrowernumber="[% patron.borrowernumber | html %]"
|
||||
class="btn btn-default btn-xs void-action"
|
||||
><i class="fa fa-ban"></i> Cancel charge</button
|
||||
>
|
||||
[% END %]
|
||||
[% IF CAN_user_updatecharges_payout && account.is_credit && ( account.amountoutstanding < 0 ) %]
|
||||
<button
|
||||
|
@ -477,6 +477,44 @@
|
|||
</div>
|
||||
<!-- /#voidPaymentModal -->
|
||||
|
||||
<!-- Cancel charge modal -->
|
||||
<div class="modal" id="cancelChargeModal" tabindex="-1" role="dialog" aria-labelledby="cancelChangreLabel">
|
||||
<form method="post" action="/cgi-bin/koha/members/cancel-charge.pl">
|
||||
[% INCLUDE 'csrf-token.inc' %]
|
||||
<input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
|
||||
<input type="hidden" name="accountlines_id" id="accountlines_id" value="" />
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="cancelChargeLabel">Cancel charge</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<fieldset class="rows">
|
||||
<ol>
|
||||
<li>
|
||||
<label for="cancel_charge_note">Note: </label>
|
||||
<input type="text" id="cnacel_charge_note" name="cancel_charge_note" />
|
||||
</li>
|
||||
</ol>
|
||||
</fieldset>
|
||||
<!-- /.rows -->
|
||||
</div>
|
||||
<!-- /.modal-body -->
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-default">Confirm</button>
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
<!-- /.modal-footer -->
|
||||
</div>
|
||||
<!-- /.modal-content -->
|
||||
</div>
|
||||
<!-- /.modal-dialog -->
|
||||
</form>
|
||||
<!-- /#cancel_charge_form -->
|
||||
</div>
|
||||
<!-- /#voidPaymentModal -->
|
||||
|
||||
[% MACRO jsinclude BLOCK %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% INCLUDE 'format_price.inc' %]
|
||||
|
@ -563,6 +601,12 @@
|
|||
$('#voidline').val(accountline);
|
||||
});
|
||||
|
||||
$("#cancelChargeModal").on("shown.bs.modal", function(e){
|
||||
var button = $(e.relatedTarget);
|
||||
var item = button.data('accountlines_id');
|
||||
$('#accountlines_id').val(item);
|
||||
});
|
||||
|
||||
$(".receipt-email-action").on("click", function(e){
|
||||
e.preventDefault();
|
||||
return $(this).siblings('form').submit();
|
||||
|
|
|
@ -36,13 +36,14 @@ my $op = $cgi->param('op') // q{};
|
|||
|
||||
if ( $op eq "cud-cancel" ) {
|
||||
my $accountlines_id = $cgi->param('accountlines_id');
|
||||
|
||||
my $cancel_charge_note = $cgi->param('cancel_charge_note');
|
||||
my $charge = Koha::Account::Lines->find($accountlines_id);
|
||||
my $borrowernumber = $charge->patron->borrowernumber;
|
||||
$charge->cancel(
|
||||
{
|
||||
branch => C4::Context->userenv->{'branch'},
|
||||
staff_id => C4::Context->userenv->{'number'}
|
||||
staff_id => C4::Context->userenv->{'number'},
|
||||
note => $cancel_charge_note,
|
||||
}
|
||||
);
|
||||
print $cgi->redirect( '/cgi-bin/koha/members/boraccount.pl?borrowernumber=' . $borrowernumber );
|
||||
|
|
Loading…
Reference in a new issue