From a640dd53bf61e2f090728ac1fb84d6be5a7befdb Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Wed, 30 Apr 2025 10:42:40 +0200 Subject: [PATCH] Bug 37344: (follow-up) Signed-off-by: David Nind --- Koha/Patron/Discharge.pm | 2 +- Koha/Schema/Result/Discharge.pm | 24 +++++++++++++++++-- .../prog/en/modules/members/discharge.tt | 2 +- members/discharge.pl | 12 ++++++---- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Koha/Patron/Discharge.pm b/Koha/Patron/Discharge.pm index e8d8d09667..25272c0d3b 100644 --- a/Koha/Patron/Discharge.pm +++ b/Koha/Patron/Discharge.pm @@ -124,7 +124,7 @@ sub cancel { $discharge->update( { cancelled => dt_from_string, - cancellation_reason => 'BORROWER_MISTAKE' + cancellation_reason => $params->{cancellation_reason} } ); Koha::Patron::Debarments::DelUniqueDebarment( diff --git a/Koha/Schema/Result/Discharge.pm b/Koha/Schema/Result/Discharge.pm index 2a6878520c..1181b1ee07 100644 --- a/Koha/Schema/Result/Discharge.pm +++ b/Koha/Schema/Result/Discharge.pm @@ -47,6 +47,18 @@ __PACKAGE__->table("discharges"); datetime_undef_if_invalid: 1 is_nullable: 1 +=head2 cancelled + + data_type: 'timestamp' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 cancellation_reason + + data_type: 'varchar' + is_nullable: 1 + size: 80 + =cut __PACKAGE__->add_columns( @@ -66,6 +78,14 @@ __PACKAGE__->add_columns( datetime_undef_if_invalid => 1, is_nullable => 1, }, + "cancelled", + { + data_type => "timestamp", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "cancellation_reason", + { data_type => "varchar", is_nullable => 1, size => 80 }, ); =head1 PRIMARY KEY @@ -103,8 +123,8 @@ __PACKAGE__->belongs_to( ); -# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-09-28 12:09:06 -# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Wc3EkS92v98jXtena5VaUQ +# Created by DBIx::Class::Schema::Loader v0.07052 @ 2025-04-30 10:35:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nw3IMky+ABLpeC6I54uHQQ # You can replace this text with custom code or comments, and it will be preserved on regeneration diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt index 5ea20e429c..a67114c762 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt @@ -133,7 +133,7 @@