Bug 33150

Summary: Add specific message for renewal too_soon situation
Product: Koha Reporter: Andreas Jonsson <andreas.jonsson>
Component: Self checkoutAssignee: Andreas Jonsson <andreas.jonsson>
Status: RESOLVED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: trivial    
Priority: P5 - low CC: arthur.suzuki, Laura.escamilla, lucas, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.12,21.11.20
Circulation function:
Attachments: Bug 33150 Add specific message for informing about too_soon for renewal.
Bug 33150: Add specific message for informing about too_soon for renewal.

Description Andreas Jonsson 2023-03-06 15:40:39 UTC
The message "No renewals allowed" is incorrect when it is too soon for renewal.
Comment 1 Andreas Jonsson 2023-03-06 15:44:42 UTC
Created attachment 147792 [details] [review]
Bug 33150 Add specific message for informing about too_soon for renewal.
Comment 2 Andreas Jonsson 2023-03-06 15:44:58 UTC
Test plan for koha-testing-docker:

- Make sure the system preference  SCOAllowCheckin is set to "allow"
- Go to Koha administration -> Circulation and fine rules
- Edit the rule for all items and change "No renewal before" to 1 and save.
- Check out an item to a borrower (for instance barcode 39999000000719 to the user koha with cardnumber 42).
- Go to self checkout (http://localhost:8080/cgi-bin/koha/sco/sco-main.pl)
- Log in as the user (koha/koha)
- Verify that the error message in the Renew column is "This item cannot yet be renewed."
Comment 3 Laura Escamilla 2023-03-06 18:37:41 UTC
(In reply to Andreas Jonsson from comment #2)
> Test plan for koha-testing-docker:
> 
> - Make sure the system preference  SCOAllowCheckin is set to "allow"
> - Go to Koha administration -> Circulation and fine rules
> - Edit the rule for all items and change "No renewal before" to 1 and save.
> - Check out an item to a borrower (for instance barcode 39999000000719 to
> the user koha with cardnumber 42).
> - Go to self checkout (http://localhost:8080/cgi-bin/koha/sco/sco-main.pl)
> - Log in as the user (koha/koha)
> - Verify that the error message in the Renew column is "This item cannot yet
> be renewed."

Works as expected!

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Comment 4 Lucas Gass (lukeg) 2023-03-08 14:45:20 UTC
Andreas, can you fix your commit message? 

* Commit title does not start with 'Bug XXXXX: ' - 022c622905


Other than that, this patch looks/works good.
Comment 5 Katrin Fischer 2023-03-09 22:05:33 UTC
Created attachment 148037 [details] [review]
Bug 33150: Add specific message for informing about too_soon for renewal.

The message "No renewals allowed" is incorrect when it is too soon for renewal,
this patch adds a specific error message.

To test:
- Make sure the system preference  SCOAllowCheckin is set to "allow"
- Go to Koha administration -> Circulation and fine rules
- Edit the rule for all items and change "No renewal before" to 1 and save.
- Check out an item to a borrower (for instance barcode 39999000000719 to the user koha with cardnumber 42).
- Go to self checkout (http://localhost:8080/cgi-bin/koha/sco/sco-main.pl)
- Log in as the user (koha/koha)
- Verify that the error message in the Renew column is "This item cannot yet be renewed."

Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 6 Katrin Fischer 2023-03-09 22:07:55 UTC
Hi Andreas,

I've fixed the mistake pointed out by Lucas, but I also fixed your commit message. Please make sure to always add a short problem description and the test plan into your commit message. See here: https://wiki.koha-community.org/wiki/Commit_messages

Also added Laura's SO line.
Comment 7 Tomás Cohen Arazi (tcohen) 2023-03-14 12:10:46 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 8 Jacob O'Mara 2023-03-16 19:49:21 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 9 Lucas Gass (lukeg) 2023-04-14 18:17:47 UTC
Backported to 22.05.x for upcoming 22.05.12
Comment 10 Arthur Suzuki 2023-04-20 09:17:36 UTC
applied to 21.11.x for 21.11.20
Comment 11 Wainui Witika-Park 2023-04-27 05:59:17 UTC
Not backported to 21.05.x