From c03a8dcb0a31db16829a05e7d41a396407f19864 Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Mon, 24 Jun 2024 17:07:47 +0000 Subject: [PATCH] Bug 23674: Add ability to add a note to APPLY DISCOUNT To test: 1. APPLY PATCH and restart_all 2. Apply a manual invoice to a patron account. 3. Go to the patron record -> accounting -> transaction tab 4. Look for the 'Apply discount' button. 5. When the 'Apply discount' modal appears notcie the 'Note' field. 6. Add a note, make sure it gets applied to this accountline. --- Koha/Account/Line.pm | 1 + .../intranet-tmpl/prog/en/modules/members/boraccount.tt | 4 ++++ members/boraccount.pl | 5 ++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Koha/Account/Line.pm b/Koha/Account/Line.pm index 572b16444e..e35338512e 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -553,6 +553,7 @@ sub reduce { borrowernumber => $self->borrowernumber, interface => $params->{interface}, branchcode => $params->{branch}, + 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 a051fc2732..fb0e734418 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -375,6 +375,10 @@
  • Amount charged:
  • +
  • + + +
  • diff --git a/members/boraccount.pl b/members/boraccount.pl index 707dc4b279..e3b85e7e77 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -161,6 +161,8 @@ if ( $op eq 'cud-discount' ) { my $charge_id = scalar $input->param('accountlines_id'); my $charge = Koha::Account::Lines->find($charge_id); my $amount = scalar $input->param('amount'); + my $note = scalar $input->param('apply_discount_note'); + $schema->txn_do( sub { @@ -170,7 +172,8 @@ if ( $op eq 'cud-discount' ) { branch => $library_id, staff_id => $logged_in_user->id, interface => 'intranet', - amount => $amount + amount => $amount, + note => $note, } ); } -- 2.39.2