From 25d13e2d04955020a172e1042888b69ee44612a9 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 851ebec7551..bb8da9e197d 100644 --- a/Koha/Account/Line.pm +++ b/Koha/Account/Line.pm @@ -535,6 +535,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 e33aa4ea5aa..ce6b812647e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt @@ -403,6 +403,10 @@
  1. Account type:
  2. Amount charged:
  3. +
  4. + + +
  5. diff --git a/members/boraccount.pl b/members/boraccount.pl index 3ac1dc9b09c..ea949947996 100755 --- a/members/boraccount.pl +++ b/members/boraccount.pl @@ -163,6 +163,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 { @@ -172,7 +174,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.5