From 31e24c7d6e4e636c37fca75f5aecf795bf43d0b6 Mon Sep 17 00:00:00 2001 From: Sam Lau Date: Wed, 26 Jun 2024 19:06:48 +0000 Subject: [PATCH] Bug 23674: Add ability to add a note to issue refund To test: 1) Apply patch, restart_all 2) From patron accounting page -> Create manual invoice. Enter some amount and select save and pay. Press confirm. 3) In the transactions tab, for the invoice you just created, under the actions column select issue refund. 4) This should open a modal with the ability to enter a note for the refund. Type in a note and confirm. 5) Ensure the note correctly shows in the table. Signed-off-by: Roman Dolny Signed-off-by: Martin Renvoize --- Koha/Account/Line.pm | 6 ++++-- .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 5 ++++- members/boraccount.pl | 8 ++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 816f04be169..805cf0856a4 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -736,7 +736,8 @@ sub apply { register_id => $register_id, staff_id => $staff_id, interface => 'intranet', - amount => $amount + amount => $amount, + note => $note } ); @@ -801,7 +802,8 @@ sub payout { borrowernumber => $self->borrowernumber, interface => $params->{interface}, branchcode => $params->{branch}, - register_id => $params->{cash_register} + register_id => $params->{cash_register}, + note => $params->{note}, } )->store(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt index 27ab5dfc583..f1a729b9e89 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -333,7 +333,10 @@ [% END %] - +
  • + + +
  • diff --git a/members/boraccount.pl b/members/boraccount.pl index 2f3bbdf8dbd..6e9cd60047a 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -132,6 +132,8 @@ if ( $op eq 'cud-refund' ) { my $charge = Koha::Account::Lines->find($charge_id); my $amount = scalar $input->param('amount'); my $refund_type = scalar $input->param('refund_type'); + my $note = scalar $input->param('refund_note'); + $schema->txn_do( sub { @@ -141,7 +143,8 @@ if ( $op eq 'cud-refund' ) { branch => $library_id, staff_id => $logged_in_user->id, interface => 'intranet', - amount => $amount + amount => $amount, + note => $note } ); unless ( $refund_type eq 'AC' ) { @@ -152,7 +155,8 @@ if ( $op eq 'cud-refund' ) { staff_id => $logged_in_user->id, cash_register => $registerid, interface => 'intranet', - amount => $amount + amount => $amount, + note => $note } ); } -- 2.48.1