Bug 32142 - Add HoldFeeMode option "if all items are checked out OR the record has at least one hold already"
Summary: Add HoldFeeMode option "if all items are checked out OR the record has at lea...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords: Sandbox
Depends on: 31963
Blocks:
  Show dependency treegraph
 
Reported: 2022-11-09 00:54 UTC by Aleisha Amohia
Modified: 2024-09-27 14:54 UTC (History)
3 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds an issued_or_reserved option to the HoldFeeMode system preference, so that a hold fee may be charged if either all items are checked out, or the record has at least one hold already.
Version(s) released in:
Circulation function:


Attachments
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref (2.63 KB, patch)
2022-11-09 01:31 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (2.96 KB, patch)
2022-11-09 01:31 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (10.88 KB, patch)
2022-11-09 22:37 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (10.88 KB, patch)
2022-11-14 03:12 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (11.06 KB, patch)
2022-11-14 03:13 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (11.04 KB, patch)
2023-07-10 04:15 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref (2.67 KB, patch)
2023-07-10 15:56 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (11.08 KB, patch)
2023-07-10 15:56 UTC, Sam Lau
Details | Diff | Splinter Review
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref (2.68 KB, patch)
2023-11-17 01:00 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (13.25 KB, patch)
2023-11-17 01:00 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref (2.71 KB, patch)
2024-02-29 22:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (13.25 KB, patch)
2024-02-29 22:27 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 32142: Implement issued_or_reserved HoldFeeMode option (13.79 KB, patch)
2024-09-27 14:54 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2022-11-09 00:54:40 UTC
Relates to Bug 31963.

There is an option for the HoldFeeMode system preference "only if all items are checked out and the record has at least one hold already", except it behaved more like "if all items are checked out OR the record has at least one hold already". Bug 31963 fixed this so that the behaviour better matches the description i.e. it says 'and' so that implies BOTH conditions must be met.

However we now need an option so that the behaviour from before isn't lost, behaviour like "if all items are checked out or the record has at least one hold already"
Comment 1 Aleisha Amohia 2022-11-09 01:31:45 UTC
Created attachment 143452 [details] [review]
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref

Database updates
Comment 2 Aleisha Amohia 2022-11-09 01:31:49 UTC
Created attachment 143453 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

Tests and test plan to come.
Comment 3 Aleisha Amohia 2022-11-09 22:37:52 UTC
Created attachment 143598 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Comment 4 Aleisha Amohia 2022-11-14 03:12:40 UTC
Created attachment 143817 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Comment 5 Aleisha Amohia 2022-11-14 03:13:20 UTC
Created attachment 143818 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Comment 6 Aleisha Amohia 2023-07-10 04:15:57 UTC
Created attachment 153251 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Comment 7 Sam Lau 2023-07-10 15:56:33 UTC
Created attachment 153286 [details] [review]
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref

Database updates

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 8 Sam Lau 2023-07-10 15:56:36 UTC
Created attachment 153287 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 9 Katrin Fischer 2023-10-08 13:30:26 UTC
The conflict in the unit test is a bit confusing, can you please rebase? 
Please also run the latest QA test tools, there might be some additional tidying to do.
Comment 10 Aleisha Amohia 2023-11-17 01:00:47 UTC
Created attachment 159070 [details] [review]
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref

Database updates

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 11 Aleisha Amohia 2023-11-17 01:00:50 UTC
Created attachment 159071 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 12 Philip Orr 2024-02-27 08:14:52 UTC
Hi Aleisha, would love to sign off on this one!
Unfortunately when applying the patch (on ktd) I get the following error:
'''
Applying: Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref
Using index info to reconstruct a base tree...
M       installer/data/mysql/mandatory/sysprefs.sql
Falling back to patching base and 3-way merge...
Auto-merging installer/data/mysql/mandatory/sysprefs.sql
CONFLICT (content): Merge conflict in installer/data/mysql/mandatory/sysprefs.sql
error: Failed to merge in the changes.
Patch failed at 0001 Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
'''
Comment 13 Aleisha Amohia 2024-02-29 22:27:06 UTC
Created attachment 162626 [details] [review]
Bug 32142: Add issued_or_reserved option to HoldFeeMode syspref

Database updates

Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 14 Aleisha Amohia 2024-02-29 22:27:09 UTC
Created attachment 162627 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Sam Lau <samalau@gmail.com>
Comment 15 Philip Orr 2024-03-04 14:40:10 UTC
Looks good now, thanks.
Test plan is good, all tested OK for me.
Running qa, all changes look good.

However tests do not pass for GetReserveFee.t:

´´´
Running tests (1)
        * Proving /kohadevbox/koha/t/db_dependent/Reserves/GetReserveFee.t KO!

    #   Failed test 'HoldFeeMode=not_always, Patron 2 should not be charged'
    #   at /kohadevbox/koha/t/db_dependent/Reserves/GetReserveFee.t line 113.
    #          got: '2'
    #     expected: '0'
     # Looks like you failed 1 test of 8.

#   Failed test 'GetReserveFee'
#   at /kohadevbox/koha/t/db_dependent/Reserves/GetReserveFee.t line 138.
 # Looks like you failed 1 test of 3.
 /kohadevbox/koha/t/db_dependent/Reserves/GetReserveFee.t ..
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests

Test Summary Report
-------------------
 /kohadevbox/koha/t/db_dependent/Reserves/GetReserveFee.t (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:   1
  Non-zero exit status: 1
 Files=1, Tests=3,  5 wallclock secs ( 0.02 usr  0.00 sys +  3.74 cusr  0.22 csys =  3.98 CPU)
 Result: FAIL
```

Also, I'm not sure about comma rules.. but I think the option in HoldFeeMode should be "either if all items are checked out or the record has at least one hold already." (that is, with no comma before the or)
Maybe a QA person can clarify? :)
Comment 16 Aleisha Amohia 2024-09-27 14:54:34 UTC
Created attachment 172117 [details] [review]
Bug 32142: Implement issued_or_reserved HoldFeeMode option

This enhancement adds an issued_or_reserved option to the HoldFeeMode
system preference, so that a hold fee may be charged if either all items
are check out, or the record has at least one hold already.

To test:
1) Apply patch, update database, restart services
2) Go to Administration -> Patron categories
3) Edit Category A and add a hold fee of $1.00

4) Go to Administration -> System preferences and search for
HoldFeeMode
5) Set HoldFeeMode to not_always - "only if all items are checked out
and the record has at least one hold already"

6) In another tab, open the staff interface. Search for a record with
one item attached to it (Biblio A)
7) Place a hold on this record for Patron B (any category).

not_always, reserved but not issued

8) Place a hold on Biblio A for Patron A. (Make sure Patron A is of
Category A which the hold fee applies to)
9) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, reserved but not issued

10) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
11) Delete Patron A's hold on Biblio A
12) Place a hold on Biblio A for Patron A
13) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued but not reserved

14) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
15) Delete all holds on Biblio A
16) Check out Biblio A's item (Item A) to Patron B
17) Place a hold on Biblio A for Patron A
18) Check Patron A's accounting page. They should NOT have a hold fee

issued_or_reserved, issued but not reserved

19) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
20) Delete Patron A's hold on Biblio A
21) Place a hold on Biblio A for Patron A
22) Check Patron A's accounting page. They SHOULD have a hold fee

not_always, issued and reserved

23) In your System preferences tab, change HoldFeeMode to
not_always - "only if all items are checked out and the record
has at least one hold already"
24) Delete all holds on Biblio A
25) Place a hold on Biblio A for Patron C (any category).
26) Place a hold on Biblio A for Patron A
27) Check Patron A's accounting page. They SHOULD have a hold fee

issued_or_reserved, issued and reserved

28) In your System preferences tab, change HoldFeeMode to
issued_or_reserved - "either if all items are checked out, or the record
has at least one hold already"
29) Delete Patron A's hold on Biblio A. There should still be a hold for
Patron C.
30) Place a hold on Biblio A for Patron A
31) Check Patron A's accounting page. They SHOULD have a hold fee

32) Ensure tests pass t/db_dependent/Reserves/GetReserveFee.t

Sponsored-by: Horowhenua Libraries Trust
Signed-off-by: Sam Lau <samalau@gmail.com>