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

(-)a/Koha/Old/Checkout.pm (-1 / +20 lines)
Lines 165-170 sub to_api_mapping { Link Here
165
    };
165
    };
166
}
166
}
167
167
168
=head3 delete
169
170
Overloaded delete method to ensure quota usages are updated.
171
172
=cut
173
174
sub delete {
175
    my ($self) = @_;
176
177
    my $schema = Koha::Database->new->schema;
178
    $schema->txn_do(
179
        sub {
180
            # Update any quota usages linked to this checkout
181
            Koha::Patron::Quota::Usages->search( { issue_id => $self->issue_id } )->update( { issue_id => undef } );
182
183
            return $self->SUPER::delete();
184
        }
185
    );
186
}
187
168
=head2 Internal methods
188
=head2 Internal methods
169
189
170
=head3 _type
190
=head3 _type
171
- 

Return to bug 38924