Bugzilla – Attachment 181709 Details for
Bug 37344
Patrons with cancelled discharge are seen as discharged when suspended due to overdue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37344: (follow-up)
Bug-37344-follow-up.patch (text/plain), 4.55 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-04-30 08:45:21 UTC
(
hide
)
Description:
Bug 37344: (follow-up)
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-04-30 08:45:21 UTC
Size:
4.55 KB
patch
obsolete
>From 14383c49b5b097b0eeca4deee620e50b6ed642f0 Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Wed, 30 Apr 2025 10:42:40 +0200 >Subject: [PATCH] Bug 37344: (follow-up) > >--- > 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 e8d8d096..25272c0d 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 2a687852..1181b1ee 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 5ea20e42..a67114c7 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 @@ > <div class="modal-body"> > [% INCLUDE 'csrf-token.inc' %] > <input name="op" type="hidden" value="cud-cancel-discharge" /> >- <div id="cancel_dicharge_alert" class="alert alert-danger" style="display:none;"></div> >+ <div id="cancel_discharge_alert" class="alert alert-danger" style="display:none;"></div> > <fieldset class="action"> > <p>Are you sure you want to cancel this discharge ? Borrower will again have right to check out books after this.</p> > [% SET discharge_cancellation_reasons = AuthorisedValues.GetAuthValueDropbox('DISCHARGE_CANCELLATION') %] >diff --git a/members/discharge.pl b/members/discharge.pl >index bbd0060f..1222126c 100755 >--- a/members/discharge.pl >+++ b/members/discharge.pl >@@ -50,9 +50,10 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( > } > ); > >-my $op = $input->param('op') // q{}; >-my $borrowernumber = $input->param('borrowernumber'); >-my $discharge_id = $input->param('discharge_id'); >+my $op = $input->param('op') // q{}; >+my $borrowernumber = $input->param('borrowernumber'); >+my $discharge_id = $input->param('discharge_id'); >+my $cancellation_reason = $input->param('cancellation-reason'); > > unless ( C4::Context->preference('useDischarge') ) { > print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&nopermission=1"); >@@ -73,8 +74,9 @@ if ( $op eq "cud-cancel-discharge" ) { > unless ( Koha::Patron::Discharge::is_cancelled( { discharge_id => $discharge_id } ) ) { > Koha::Patron::Discharge::cancel( > { >- discharge_id => $discharge_id, >- borrowernumber => $borrowernumber, >+ discharge_id => $discharge_id, >+ borrowernumber => $borrowernumber, >+ cancellation_reason => $cancellation_reason, > } > ); > } >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37344
:
179461
|
179489
|
179763
|
179826
|
179827
|
179828
|
181709
|
182647
|
182648
|
182649
|
182650
|
182747
|
182748
|
182749
|
182750
|
182751
|
182907