Bug 28181

Summary: Archived debit type still shows as available in Point of Sale
Product: Koha Reporter: Esther Melander <esther.melander>
Component: Fines and feesAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Kyle M Hall (khall) <kyle>
Severity: normal    
Priority: P5 - low CC: andrew, fridolin.somers, kyle, martin.renvoize, sally.healey, victor
Version: 20.05   
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.05.00,20.11.06,20.05.12
Circulation function:
Bug Depends on: 23354    
Bug Blocks: 13985    
Attachments: Bug 28181: Filter out archived debit types in point of sale
Bug 28181: Filter out archived debit types in point of sale
Bug 28181: Filter out archived debit types in point of sale

Description Esther Melander 2021-04-20 16:20:50 UTC
I archived a debit type, however when I return to the point of sale page, the archived debit still shows as available. This means the archived debit could still be used for transactions. The archived debit still had the library selected in library limitations. I restored the debit, deselected the library, saved the debit, then re-archived the debit. With a multi-branch configuration, this led to the debit being made available to all libraries despite being archived. I went back, restored the debit and have temporarily assigned the debit to the Placeholder branch so that it is only available there. I assumed an archived debit would no longer be made available making it impossible to continue to use.

To duplicate:
1. Create a debit with library limitation of logged in library.
2. Archive the debit
3. Go to Point of Sale page. Archived debit will be visible and available for use by the library.
Comment 1 Martin Renvoize (ashimema) 2021-04-22 12:15:05 UTC
Created attachment 120001 [details] [review]
Bug 28181: Filter out archived debit types in point of sale

The filter for only displaying un-archived debit types on the point of
sale page had been missed.

NOTE: It would be beneficial to move this to a default filter in the
Koha:: objects search method for both debit_types and credit_types.. but
I opted for the quick fix here to resolve the bug and will impliment
default filtering in a subsequent enhancement bug.

Test plan
1/ Archive a debit type that is marked as 'Can be sold'
2/ Go to the point of sale page and confirm the above debit type appears
3/ Apply the patch
4/ Confirm the debit type no longer appears in the point of sale page.
Comment 2 PTFS Europe Sandboxes 2021-05-07 11:20:53 UTC
Created attachment 120677 [details] [review]
Bug 28181: Filter out archived debit types in point of sale

The filter for only displaying un-archived debit types on the point of
sale page had been missed.

NOTE: It would be beneficial to move this to a default filter in the
Koha:: objects search method for both debit_types and credit_types.. but
I opted for the quick fix here to resolve the bug and will impliment
default filtering in a subsequent enhancement bug.

Test plan
1/ Archive a debit type that is marked as 'Can be sold'
2/ Go to the point of sale page and confirm the above debit type appears
3/ Apply the patch
4/ Confirm the debit type no longer appears in the point of sale page.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>
Comment 3 Sally 2021-05-07 11:21:18 UTC
Worked as described - signed off.
Comment 4 Nick Clemens (kidclamp) 2021-05-07 14:00:19 UTC
Created attachment 120694 [details] [review]
Bug 28181: Filter out archived debit types in point of sale

The filter for only displaying un-archived debit types on the point of
sale page had been missed.

NOTE: It would be beneficial to move this to a default filter in the
Koha:: objects search method for both debit_types and credit_types.. but
I opted for the quick fix here to resolve the bug and will impliment
default filtering in a subsequent enhancement bug.

Test plan
1/ Archive a debit type that is marked as 'Can be sold'
2/ Go to the point of sale page and confirm the above debit type appears
3/ Apply the patch
4/ Confirm the debit type no longer appears in the point of sale page.

Signed-off-by: Sally <sally.healey@cheshiresharedservices.gov.uk>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 5 Jonathan Druart 2021-05-10 14:18:55 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 6 Fridolin Somers 2021-05-12 14:39:19 UTC
Pushed to 20.11.x for 20.11.06
Comment 7 Andrew Fuerste-Henry 2021-05-25 12:56:39 UTC
Pushed to 20.05.x for 20.05.12
Comment 8 Victor Grousset/tuxayo 2021-05-25 14:37:06 UTC
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.