Aspen-Discovery / aspen-discovery

GNU General Public License v2.0
45 stars 60 forks source link

Library Savings for Patrons #2115

Closed kylemhall closed 2 hours ago

kylemhall commented 2 hours ago

Description

To display how much money a patron is saving by using the library.

Full specification here: Proposal for Library Savings for Patrons.pdf

Testing Notes

Permissions

Aspen Administration Configuration

Verify that there is a new Replacement Cost option in Aspen Administration in the Catalog / Grouped Works section with a user that has the appropriate Administer Replacement Costs permission.

Adding new replacement cost settings

Modify replacement cost settings

Enable/Disable cost savings feature

Patron Account

Feature Disabled

Scenario 1: Unlinked account user (Feature Enabled)

Scenario 2: Linked account user (Feature Enabled)

Repeat all tests listed above for a user with linked accounts. When verifying "You are saving" values for a user with linked accounts, ensure that the total number at the top of Checkouts is a tally of both the primary and secondary user(s) checked out items. Verifying "You have saved" values should look the same as an unlinked account user -- their reading history should only show their individual reading history items and savings.

firefox_C0vyThuEVU image-20241008-020946

kylemhall commented 2 hours ago

Okay - I lied - one more thing three more things.

  1. Do we expect other options per format setting down the line? In this instance, there's only one setting, but you still have to manually select replacement cost in a batch modification even though there's only one setting option. Is there a way to autofill the field when there's only one option? More a QoL thing, though, obv:

1

  1. Do we need to have cost savings disabled text? Commentary foolishly embedded into the image below.

2

-   If you disable savings in Library savings, the Library savings page disappears from the sidebar, meaning you can't ever turn it back on unless you bookmarked the page/remember the URL.
kylemhall commented 2 hours ago

All four previous fixes look good. After several hours of video game break, I am now finally done with the actual test part - documentation to follow in a bit. Only two things this time:

  1. If you have mixed formats on a bib, Aspen will completely ignore that checkout/reading history entry for calculating library savings. Even if it was random (first or last item indexed), I think libraries might find that preferable to a default to $0, but I can never be too sure about that either lol. Ball is in your court on that one, of course.

  2. eContent format tallies seem good for eBook, eAudiobook, and eComic, but I could not get Libby eMagazines to join the tally, even though they had a default value. More side effects of the Libby Rack stuff since you don't really "check out" the magazines in the same way anymore? Note that I only tested eContent formats with Libby (eBook, eAudio, eMag) and Palace Project (eBooks).

kylemhall commented 2 hours ago
  1. fixed, it only happened if cookie consent was off.

  2. fixed, changed message to: Updated %1% historic cost savings that were previously 0.

  3. We were only calculating the current value when all checkouts were viewed. Fixed so the current value is calculated whenever we show the message (based on cached checkouts if applicable).

  4. Yep I had a bug in the loop counter

kylemhall commented 2 hours ago
  1. Getting these on Library Savings page:

    Warning: Undefined array key "profile" in C:\web\aspen-discovery\tmp\smarty\compile\8f0e0d1d37533e45c9e1b3dd522645ecb8a277af_0.file.librarySavings.tpl.php on line 39 
    Warning: Attempt to read property "value" on null in C:\web\aspen-discovery\tmp\smarty\compile\8f0e0d1d37533e45c9e1b3dd522645ecb8a277af_0.file.librarySavings.tpl.php on line 39 
    Warning: Attempt to read property "enableCostSavings" on null in C:\web\aspen-discovery\tmp\smarty\compile\8f0e0d1d37533e45c9e1b3dd522645ecb8a277af_0.file.librarySavings.tpl.php on line 39 
    Warning: Undefined array key "profile" in C:\web\aspen-discovery\tmp\smarty\compile\8f0e0d1d37533e45c9e1b3dd522645ecb8a277af_0.file.librarySavings.tpl.php on line 41 
    Warning: Attempt to read property "value" on null in C:\web\aspen-discovery\tmp\smarty\compile\8f0e0d1d37533e45c9e1b3dd522645ecb8a277af_0.file.librarySavings.tpl.php on line 41
    Warning: Attempt to read property "enableCostSavings" on null in C:\web\aspen-discovery\tmp\smarty\compile\8f0e0d1d37533e45c9e1b3dd522645ecb8a277af_0.file.librarySavings.tpl.php on line 41
  2. Something minor but has confused me when trying to make the documentation a bit -- the success message for Recalculating zero cost savings is also Updated %1% historic cost savings and maybe it shouldn't be?

  3. I'm not seeing Checked Out Title savings though they are enabled and showing fine in Reading history, but I accidentally checked them out in Koha from a library that technically doesn't have the cost savings enabled (yet). Should that matter? (The items are owned by and checked out to patrons at a library with cost savings on.)

  4. When I try to generate a reading history for a patron that is just for the last year, even if my minimum amount of checkouts is greater than 0, it always generates 0 reading history items. I had to go two years to get anything.