Bugzilla – Attachment 166631 Details for
Bug 22421
accountlines.issue_id is missing a foreign key constraint
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22421: (follow-up) Check issue during add_debit
Bug-22421-follow-up-Check-issue-during-adddebit.patch (text/plain), 2.19 KB, created by
Martin Renvoize (ashimema)
on 2024-05-13 12:34:02 UTC
(
hide
)
Description:
Bug 22421: (follow-up) Check issue during add_debit
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-05-13 12:34:02 UTC
Size:
2.19 KB
patch
obsolete
>From 4807c4926c997c7788207efe7050834a90c17749 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 13 May 2024 13:32:17 +0100 >Subject: [PATCH] Bug 22421: (follow-up) Check issue during add_debit > >We need additional handling for the case where a debt may be added with >an issue_id after the issue is returned. > >This patch tries to fix that at a low level, but introduces new test >failures in t/db_dependent/Circulation.t to be investigated. >--- > Koha/Account.pm | 26 +++++++++++++++++++++++--- > 1 file changed, 23 insertions(+), 3 deletions(-) > >diff --git a/Koha/Account.pm b/Koha/Account.pm >index 3d0fcee854b..e3a2ef7f376 100644 >--- a/Koha/Account.pm >+++ b/Koha/Account.pm >@@ -486,6 +486,17 @@ sub add_debit { > my $item_id = $params->{item_id}; > my $issue_id = $params->{issue_id}; > >+ my $old_issue_id; >+ if ( $issue_id ) { >+ my $issue = Koha::Checkouts->find($issue_id); >+ unless ( $issue ) { >+ my $old_issue = Koha::Old::Checkouts->find($issue_id); >+ $issue_id = undef; >+ $old_issue_id = $old_issue->id; >+ } >+ } >+ >+ > my $line; > my $schema = Koha::Database->new->schema; > try { >@@ -506,9 +517,18 @@ sub add_debit { > manager_id => $user_id, > interface => $interface, > itemnumber => $item_id, >- issue_id => $issue_id, >- branchcode => $library_id, >- register_id => $cash_register, >+ ( >+ $issue_id >+ ? ( issue_id => $issue_id ) >+ : () >+ ), >+ ( >+ $old_issue_id >+ ? ( old_issue_id => $old_issue_id ) >+ : () >+ ), >+ branchcode => $library_id, >+ register_id => $cash_register, > ( > $debit_type eq 'OVERDUE' > ? ( status => 'UNRETURNED' ) >-- >2.45.0
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 22421
:
85773
|
85774
|
85775
|
90352
|
90353
|
90354
|
90359
|
90360
|
90361
|
90362
|
90365
|
90366
|
90367
|
90368
|
161919
|
161920
|
161921
|
161922
|
161923
|
162244
|
162245
|
162246
|
162247
|
162248
|
166631
|
173287
|
173288
|
173289
|
173305
|
173790
|
173791
|
173792
|
173793
|
173794
|
173795
|
173796
|
173797
|
173798
|
173799
|
174281
|
174974