Bug 30168 - Use checkout object in GetSoonestRenewDate
Summary: Use checkout object in GetSoonestRenewDate
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Katrin Fischer
URL:
Keywords:
Depends on: 30167
Blocks:
  Show dependency treegraph
 
Reported: 2022-02-23 16:24 UTC by Nick Clemens
Modified: 2023-12-28 20:42 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00


Attachments
Bug 30168: Use checkout object in GetSoonestRenewDate (5.83 KB, patch)
2022-02-23 16:52 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 30168: Embed patron and item in issue for passing to GetSoonestRenewDate (1.06 KB, patch)
2022-02-23 16:53 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 30168: Use checkout object in GetSoonestRenewDate (5.77 KB, patch)
2022-05-04 12:08 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 30168: Use checkout object in GetSoonestRenewDate (5.75 KB, patch)
2022-09-25 05:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 30168: Use checkout object in GetSoonestRenewDate (5.80 KB, patch)
2022-10-08 16:07 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 30168: (QA follow-up) Fix POD (1.30 KB, patch)
2022-10-08 16:07 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2022-02-23 16:24:48 UTC
Currently we fetch the checkout, patron, and item when calculating the soonest renewal date

Lets instead pass the checkout object and fetch from there, allowing to prefetch in the calling routine
Comment 1 Nick Clemens 2022-02-23 16:52:59 UTC
Created attachment 131048 [details] [review]
Bug 30168: Use checkout object in GetSoonestRenewDate
Comment 2 Nick Clemens 2022-02-23 16:53:02 UTC
Created attachment 131049 [details] [review]
Bug 30168: Embed patron and item in issue for passing to GetSoonestRenewDate
Comment 3 Nick Clemens 2022-02-23 17:30:10 UTC
(In reply to Nick Clemens from comment #2)
> Created attachment 131049 [details] [review] [review]
> Bug 30168: Embed patron and item in issue for passing to GetSoonestRenewDate

Obsoleting, see bug 30169
Comment 4 Nick Clemens 2022-05-04 12:08:59 UTC
Created attachment 134603 [details] [review]
Bug 30168: Use checkout object in GetSoonestRenewDate
Comment 5 David Nind 2022-09-25 05:00:47 UTC
Created attachment 140969 [details] [review]
Bug 30168: Use checkout object in GetSoonestRenewDate

Signed-off-by: David Nind <david@davidnind.com>
Comment 6 David Nind 2022-09-25 05:02:33 UTC
I've signed off on the basis that the tests pass before and after the patch is applied: prove t/db_dependent/Circulation.t 

Let me know if there is anything else required to test this.
Comment 7 David Nind 2022-09-25 05:21:39 UTC
I also ran similar tests to bug 30167, for what it is worth.

- Tested on 09/25/2022 (American date format) with 
  . 'no renewal before' set to 3
  . 'loan period' set to 5
- Checked out on date is 09/25/2022 05:10
- For the patron from the checkouts: No renewal before 04/27/2022
- When trying to renew from Circulation > Renew, the message is "Intermediate Perl / ( 39999000005134 ) cannot be renewed before 09/27/2022."
- When trying to renew by checking out to the same patron again, the message is: "No more renewals possible"
- Date is calculated correctly including the current day (3 days - 25th, 26th + 27th)
Comment 8 Katrin Fischer 2022-10-08 13:25:39 UTC
(In reply to David Nind from comment #7)
> I also ran similar tests to bug 30167, for what it is worth.
> 
> - Tested on 09/25/2022 (American date format) with 
>   . 'no renewal before' set to 3
>   . 'loan period' set to 5
> - Checked out on date is 09/25/2022 05:10
> - For the patron from the checkouts: No renewal before 04/27/2022
> - When trying to renew from Circulation > Renew, the message is
> "Intermediate Perl / ( 39999000005134 ) cannot be renewed before 09/27/2022."
> - When trying to renew by checking out to the same patron again, the message
> is: "No more renewals possible"
> - Date is calculated correctly including the current day (3 days - 25th,
> 26th + 27th)

Thanks David, your notes are always very helpful!
Comment 9 Katrin Fischer 2022-10-08 16:07:10 UTC
Created attachment 141554 [details] [review]
Bug 30168: Use checkout object in GetSoonestRenewDate

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 10 Katrin Fischer 2022-10-08 16:07:14 UTC
Created attachment 141555 [details] [review]
Bug 30168: (QA follow-up) Fix POD

The POD had $issue in the example, but $checkout in
explanation. Also standardized a bit of other terminology.
(borrower, issue) = (patron, checkout)

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Tomás Cohen Arazi 2022-10-11 14:21:29 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!