View | Details | Raw Unified | Return to bug 37344
Collapse All | Expand All

(-)a/Koha/Patron/Discharge.pm (-1 / +1 lines)
Lines 124-130 sub cancel { Link Here
124
    $discharge->update(
124
    $discharge->update(
125
        {
125
        {
126
            cancelled           => dt_from_string,
126
            cancelled           => dt_from_string,
127
            cancellation_reason => 'BORROWER_MISTAKE'
127
            cancellation_reason => $params->{cancellation_reason}
128
        }
128
        }
129
    );
129
    );
130
    Koha::Patron::Debarments::DelUniqueDebarment(
130
    Koha::Patron::Debarments::DelUniqueDebarment(
(-)a/Koha/Schema/Result/Discharge.pm (-2 / +22 lines)
Lines 47-52 __PACKAGE__->table("discharges"); Link Here
47
  datetime_undef_if_invalid: 1
47
  datetime_undef_if_invalid: 1
48
  is_nullable: 1
48
  is_nullable: 1
49
49
50
=head2 cancelled
51
52
  data_type: 'timestamp'
53
  datetime_undef_if_invalid: 1
54
  is_nullable: 1
55
56
=head2 cancellation_reason
57
58
  data_type: 'varchar'
59
  is_nullable: 1
60
  size: 80
61
50
=cut
62
=cut
51
63
52
__PACKAGE__->add_columns(
64
__PACKAGE__->add_columns(
Lines 66-71 __PACKAGE__->add_columns( Link Here
66
    datetime_undef_if_invalid => 1,
78
    datetime_undef_if_invalid => 1,
67
    is_nullable => 1,
79
    is_nullable => 1,
68
  },
80
  },
81
  "cancelled",
82
  {
83
    data_type => "timestamp",
84
    datetime_undef_if_invalid => 1,
85
    is_nullable => 1,
86
  },
87
  "cancellation_reason",
88
  { data_type => "varchar", is_nullable => 1, size => 80 },
69
);
89
);
70
90
71
=head1 PRIMARY KEY
91
=head1 PRIMARY KEY
Lines 103-110 __PACKAGE__->belongs_to( Link Here
103
);
123
);
104
124
105
125
106
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2015-09-28 12:09:06
126
# Created by DBIx::Class::Schema::Loader v0.07052 @ 2025-04-30 10:35:23
107
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Wc3EkS92v98jXtena5VaUQ
127
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:nw3IMky+ABLpeC6I54uHQQ
108
128
109
129
110
# You can replace this text with custom code or comments, and it will be preserved on regeneration
130
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/discharge.tt (-1 / +1 lines)
Lines 133-139 Link Here
133
                <div class="modal-body">
133
                <div class="modal-body">
134
                    [% INCLUDE 'csrf-token.inc' %]
134
                    [% INCLUDE 'csrf-token.inc' %]
135
                    <input name="op" type="hidden" value="cud-cancel-discharge" />
135
                    <input name="op" type="hidden" value="cud-cancel-discharge" />
136
                    <div id="cancel_dicharge_alert" class="alert alert-danger" style="display:none;"></div>
136
                    <div id="cancel_discharge_alert" class="alert alert-danger" style="display:none;"></div>
137
                    <fieldset class="action">
137
                    <fieldset class="action">
138
                        <p>Are you sure you want to cancel this discharge ? Borrower will again have right to check out books after this.</p>
138
                        <p>Are you sure you want to cancel this discharge ? Borrower will again have right to check out books after this.</p>
139
                        [% SET discharge_cancellation_reasons = AuthorisedValues.GetAuthValueDropbox('DISCHARGE_CANCELLATION') %]
139
                        [% SET discharge_cancellation_reasons = AuthorisedValues.GetAuthValueDropbox('DISCHARGE_CANCELLATION') %]
(-)a/members/discharge.pl (-6 / +7 lines)
Lines 50-58 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user( Link Here
50
    }
50
    }
51
);
51
);
52
52
53
my $op             = $input->param('op') // q{};
53
my $op                  = $input->param('op') // q{};
54
my $borrowernumber = $input->param('borrowernumber');
54
my $borrowernumber      = $input->param('borrowernumber');
55
my $discharge_id   = $input->param('discharge_id');
55
my $discharge_id        = $input->param('discharge_id');
56
my $cancellation_reason = $input->param('cancellation-reason');
56
57
57
unless ( C4::Context->preference('useDischarge') ) {
58
unless ( C4::Context->preference('useDischarge') ) {
58
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&nopermission=1");
59
    print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&nopermission=1");
Lines 73-80 if ( $op eq "cud-cancel-discharge" ) { Link Here
73
    unless ( Koha::Patron::Discharge::is_cancelled( { discharge_id => $discharge_id } ) ) {
74
    unless ( Koha::Patron::Discharge::is_cancelled( { discharge_id => $discharge_id } ) ) {
74
        Koha::Patron::Discharge::cancel(
75
        Koha::Patron::Discharge::cancel(
75
            {
76
            {
76
                discharge_id   => $discharge_id,
77
                discharge_id        => $discharge_id,
77
                borrowernumber => $borrowernumber,
78
                borrowernumber      => $borrowernumber,
79
                cancellation_reason => $cancellation_reason,
78
            }
80
            }
79
        );
81
        );
80
    }
82
    }
81
- 

Return to bug 37344