Bugzilla – Attachment 173797 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) Use checkout accessor to get correct issue_id
Bug-22421-follow-up-Use-checkout-accessor-to-get-c.patch (text/plain), 2.70 KB, created by
Martin Renvoize (ashimema)
on 2024-10-31 13:15:03 UTC
(
hide
)
Description:
Bug 22421: (follow-up) Use checkout accessor to get correct issue_id
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-10-31 13:15:03 UTC
Size:
2.70 KB
patch
obsolete
>From f69651d205711b1aaeb3d9bb037dfb591c5a2d6b Mon Sep 17 00:00:00 2001 >From: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> >Date: Thu, 24 Oct 2024 11:37:56 -0400 >Subject: [PATCH] Bug 22421: (follow-up) Use checkout accessor to get correct > issue_id > >In some cases, we may want to update an AccountLine that is linked to a >checkout without knowing whether it is a current or old checkout. In >these cases, use the AccountLines ->checkout accessor to ensure we get >the issue_id correctly, regardless of whether it is a current issue or >and old_issue. > >This also applies when generating a new AccountLine based on an existing >AccountLine (for example, adding a credit to refund a previously charged >fine) > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Overdues.pm | 2 +- > Koha/Item.pm | 4 ++-- > 2 files changed, 3 insertions(+), 3 deletions(-) > >diff --git a/C4/Overdues.pm b/C4/Overdues.pm >index 7faa2e9f215..171651cdb38 100644 >--- a/C4/Overdues.pm >+++ b/C4/Overdues.pm >@@ -563,7 +563,7 @@ sub UpdateFine { > # - accumulate fines for other items > # so we can update $itemnum fine taking in account fine caps > while (my $overdue = $overdues->next) { >- if ( defined $overdue->issue_id && $overdue->issue_id == $issue_id && $overdue->status eq 'UNRETURNED' ) { >+ if ( defined $overdue->checkout && $overdue->checkout->issue_id == $issue_id && $overdue->status eq 'UNRETURNED' ) { > if ($accountline) { > Koha::Logger->get->debug("Not a unique accountlines record for issue_id $issue_id"); # FIXME Do we really need to log that? > #FIXME Should we still count this one in total_amount ?? >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 572b5f1ff61..dd471de5cbc 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1591,7 +1591,7 @@ sub _set_found_trigger { > interface => C4::Context->interface, > library_id => $branchcode, > item_id => $self->itemnumber, >- issue_id => $lost_charge->issue_id >+ issue_id => $lost_charge->checkout ? $lost_charge->checkout->issue_id : undef, > } > ); > >@@ -1747,7 +1747,7 @@ sub _set_found_trigger { > interface => C4::Context->interface, > library_id => $branchcode, > item_id => $self->itemnumber, >- issue_id => $processing_charge->issue_id >+ issue_id => $processing_charge->checkout ? $processing_charge->checkout->issue_id : undef, > } > ); > >-- >2.47.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