Bug 28653

Summary: Sorting loans by due date doesn't work after renewing
Product: Koha Reporter: Emmi Takkinen <emmi.takkinen>
Component: CirculationAssignee: Emmi Takkinen <emmi.takkinen>
Status: CLOSED FIXED QA Contact: Joonas Kylmälä <joonas.kylmala>
Severity: trivial    
Priority: P5 - low CC: fridolin.somers, gmcharlt, jonathan.druart, joonas.kylmala, kelly, kyle.m.hall, kyle, victor
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:
21.11.00,21.05.05,20.11.11
Circulation function:
Bug Depends on:    
Bug Blocks: 36131, 34302    
Attachments: Bug 28653: Add new method RefreshIssuesTable
Bug 28653: Add new method RefreshIssuesTable
Bug 28653: Add new method RefreshIssuesTable
Bug 28653: (QA follow-up) Remove debug message used during development

Description Emmi Takkinen 2021-07-02 07:49:31 UTC
On patrons check out or details page, after renewing loans they don't sort correctly when clicking on "Date due" tab. Page has to be reloaded so that sorting works.  

To test:
1. Add 3 loans for patron.
2. Change date dues so you they are e.g. 07/01, 07/02, 07/04
3. Make sure you have renewal period set e.g. 5 days and check your  RenewalPeriodBase syspref (I use current date there)
4. Renew loan with date due on 07/01, it should now be 07/07
3. Sort loans by date due
=> Note that order from top to bottom is 07/04->07/02->07/07 or 07/07->07/02->07/04, not 07/02->07/04->07/07 as one would assumme.
Comment 1 Emmi Takkinen 2021-07-02 12:07:46 UTC
Created attachment 122543 [details] [review]
Bug 28653: Add new method RefreshIssuesTable

On patrons check out or details page, after renewing
loans they don't sort correctly when clicking on "Date due"
tab. Page has to be reloaded so that sorting works.
This patch adds new method RefreshIssuesTable to
checkouts.js. When loans are renewed or checked in, issues
table is reloaded to and due dates are sorted correctly.

To test:
1. Add 3 loans for patron.
2. Change due dates so you they are e.g. 07/01, 07/02, 07/04
3. Make sure you have renewal period set e.g. 5 days and
check your RenewalPeriodBase syspref (I use current date there)
4. Renew loan with date due on 07/01, it should now be 07/07
5. Sort loans by date due
=> Note that order from top to bottom is 07/04->07/02->07/07
or 07/07->07/02->07/04, not 07/02->07/04->07/07 as one would
assume.
6. Apply patch and repeat.
=> Note that issues table is reloaded ("Loading..." pop-up is displayed)
and that due dates are in correct order.

Sponsored-by: Koha-Suomi Oy
Comment 2 Kyle M Hall (khall) 2021-08-10 16:15:23 UTC
Created attachment 123706 [details] [review]
Bug 28653: Add new method RefreshIssuesTable

On patrons check out or details page, after renewing
loans they don't sort correctly when clicking on "Date due"
tab. Page has to be reloaded so that sorting works.
This patch adds new method RefreshIssuesTable to
checkouts.js. When loans are renewed or checked in, issues
table is reloaded to and due dates are sorted correctly.

To test:
1. Add 3 loans for patron.
2. Change due dates so you they are e.g. 07/01, 07/02, 07/04
3. Make sure you have renewal period set e.g. 5 days and
check your RenewalPeriodBase syspref (I use current date there)
4. Renew loan with date due on 07/01, it should now be 07/07
5. Sort loans by date due
=> Note that order from top to bottom is 07/04->07/02->07/07
or 07/07->07/02->07/04, not 07/02->07/04->07/07 as one would
assume.
6. Apply patch and repeat.
=> Note that issues table is reloaded ("Loading..." pop-up is displayed)
and that due dates are in correct order.

Sponsored-by: Koha-Suomi Oy

Signed-off-by: kelly <kelly@bywatersolutions.com>
Comment 3 Joonas Kylmälä 2021-09-12 14:13:29 UTC
Created attachment 124815 [details] [review]
Bug 28653: Add new method RefreshIssuesTable

On patrons check out or details page, after renewing
loans they don't sort correctly when clicking on "Date due"
tab. Page has to be reloaded so that sorting works.
This patch adds new method RefreshIssuesTable to
checkouts.js. When loans are renewed or checked in, issues
table is reloaded to and due dates are sorted correctly.

To test:
1. Add 3 loans for patron.
2. Change due dates so you they are e.g. 07/01, 07/02, 07/04
3. Make sure you have renewal period set e.g. 5 days and
check your RenewalPeriodBase syspref (I use current date there)
4. Renew loan with date due on 07/01, it should now be 07/07
5. Sort loans by date due
=> Note that order from top to bottom is 07/04->07/02->07/07
or 07/07->07/02->07/04, not 07/02->07/04->07/07 as one would
assume.
6. Apply patch and repeat.
=> Note that issues table is reloaded ("Loading..." pop-up is displayed)
and that due dates are in correct order.

Sponsored-by: Koha-Suomi Oy

Signed-off-by: kelly <kelly@bywatersolutions.com>

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 4 Joonas Kylmälä 2021-09-12 14:13:33 UTC
Created attachment 124816 [details] [review]
Bug 28653: (QA follow-up) Remove debug message used during development

Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi>
Comment 5 Jonathan Druart 2021-09-20 11:59:20 UTC
Patches will be squashed when pushed.
Comment 6 Jonathan Druart 2021-09-20 12:47:37 UTC
Pushed to master for 21.11, thanks to everybody involved!
Comment 7 Kyle M Hall (khall) 2021-10-01 18:24:14 UTC
Pushed to 21.05.x for 21.05.05
Comment 8 Fridolin Somers 2021-10-09 02:14:02 UTC
Pushed to 20.11.x for 20.11.11
Comment 9 Victor Grousset/tuxayo 2021-10-16 02:23:32 UTC
Not backported to oldoldstable (20.05.x). Feel free to ask if it's needed.
Comment 10 Jonathan Druart 2022-05-18 08:05:47 UTC
We should update the number of checkouts in the tab.