From 5045b2bfce9a8b2d83853500818c9d287c05efb3 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. Signed-off-by: Roman Dolny Signed-off-by: Martin Renvoize --- 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 a82ad434146..21adf8b3e1c 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -564,6 +564,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 13cc95051b1..17b82ff3b8c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -374,6 +374,10 @@
  • Amount charged:
  • +
  • + + +
  • diff --git a/members/boraccount.pl b/members/boraccount.pl index 707dc4b2791..e3b85e7e774 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.48.1