[Bug 31051] New: Show patron's 'savings' on the OPAC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Bug ID: 31051 Summary: Show patron's 'savings' on the OPAC Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: new feature Priority: P5 - low Component: OPAC Assignee: oleonard@myacpl.org Reporter: aleisha@catalyst.net.nz QA Contact: testopia@bugs.koha-community.org It would be cool to have a feature which would show patrons via the OPAC how much they've saved by using the library, instead of purchasing items themselves. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|oleonard@myacpl.org |aleisha@catalyst.net.nz Change sponsored?|--- |Sponsored Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #1 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 136564 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136564&action=edit Bug 31051: [WIP] Add OPACShowSavings preference -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #2 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 136664 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136664&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- This didn't work at first when using my own test data. I got this error: Can't call method "replacementprice" on an undefined value at /kohadevbox/koha/Koha/Patron.pm line 2206 It seems to come from there being lines in old_issues where the itemnumber is null. I'm not sure if that's normal or not. The only other issue I have is that I don't think "do not display anywhere on the OPAC" should be one of the preference options. It's contradictory to be able to select that *and* the other options. Users can select no options if they want the information not to appear. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #4 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Sorry the first patch is a mistake, I seem to have missed attaching the correct one. Will fix -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #5 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 136698 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136698&action=edit Bug 31051: Add OPACShowSavings system preference -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136664|0 |1 is obsolete| | --- Comment #6 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 136699 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136699&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136564|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Marie-Luce Laflamme <marie-luce.laflamme@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marie-luce.laflamme@inlibro | |.com Status|Needs Signoff |Signed Off --- Comment #7 from Marie-Luce Laflamme <marie-luce.laflamme@inlibro.com> --- testing note: add an item replacement cost (952$ v) on checkout items it works well -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 ByWater Sandboxes <bws.sandboxes@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136699|0 |1 is obsolete| | --- Comment #8 from ByWater Sandboxes <bws.sandboxes@gmail.com> --- Created attachment 136770 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136770&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Axelle Aix-Marseille Université <axelle.clarisse@univ-amu.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |axelle.clarisse@univ-amu.fr --- Comment #9 from Axelle Aix-Marseille Université <axelle.clarisse@univ-amu.fr> --- Tested with a UNIMARC sandbox : items replacement prices = 995$g in UNIMARC. It works well too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136698|0 |1 is obsolete| | --- Comment #10 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Created attachment 136772 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136772&action=edit Bug 31051: Add OPACShowSavings system preference Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 sandboxes@biblibre.com <sandboxes@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136770|0 |1 is obsolete| | --- Comment #11 from sandboxes@biblibre.com <sandboxes@biblibre.com> --- Created attachment 136773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136773&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136772|0 |1 is obsolete| | --- Comment #12 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 136779 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136779&action=edit Bug 31051: Add OPACShowSavings system preference Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136773|0 |1 is obsolete| | --- Comment #13 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Created attachment 136781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=136781&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Victor Grousset/tuxayo <victor@tuxayo.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |victor@tuxayo.net --- Comment #14 from Victor Grousset/tuxayo <victor@tuxayo.net> --- Marie-Luce and Axelle tested at the same time and one signoff line was lost. I just reattached the patches with both signoff lines. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #15 from Fridolin Somers <fridolin.somers@biblibre.com> --- Looking at this for QA. I have a question : Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog. When LibraryNameTitle is not defined the text will say "you have saved a total of X by using the Koha online catalog". Looks not good, the savings are caused by the checkouts so in the "real life" catalog, not the online. Also often the content of LibraryNameTitle makes a weird text with catalog appended. In my opinion we should use a more simple : Congratulations, you have saved a total of [% savings | $Price with_symbol => 1 %] by using the library. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136779|0 |1 is obsolete| | --- Comment #16 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 139100 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139100&action=edit Bug 31051: Add OPACShowSavings system preference Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #136781|0 |1 is obsolete| | --- Comment #17 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 139101 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139101&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #18 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 139102 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139102&action=edit Bug 31051: (follow-up) Simplify savings wording for OPAC -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This new feature shows a release notes| |patron how much they have | |saved by using the library | |rather than purchasing | |items. Savings are | |calculated based on item | |replacement prices. The | |system preference allows | |you to choose where to | |display the savings - the | |user page, the summary box | |on the OPAC homepage, or | |the checkout history page. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- Great ;) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139100|0 |1 is obsolete| | Attachment #139101|0 |1 is obsolete| | Attachment #139102|0 |1 is obsolete| | --- Comment #20 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 139408 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139408&action=edit Bug 31051: Add OPACShowSavings system preference Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #21 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 139409 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139409&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #22 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 139410 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139410&action=edit Bug 31051: (follow-up) Simplify savings wording for OPAC Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139408|0 |1 is obsolete| | --- Comment #23 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 139911 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139911&action=edit Bug 31051: Add OPACShowSavings system preference Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139409|0 |1 is obsolete| | --- Comment #24 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 139912 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139912&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139410|0 |1 is obsolete| | --- Comment #25 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 139913 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139913&action=edit Bug 31051: (follow-up) Simplify savings wording for OPAC Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #26 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 139914 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139914&action=edit Bug 31051: (QA follow-up) Simplify savings wording for reading history Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #27 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- This works nicely and I quite like the idea! Only one real blocker and some notes/suggestions: 1) +=head3 get_savings (blocker) We need some unit tests here. 2) issues + old_issues (not blocker) A lot of libraries nowadays choose to anonymize the checkout history rather fast. So as we look at issues and old_issues here, the amount saved will go up and down quite a bit. I wonder if it could make sense to add a note to the pref so libraries have this in mind when activating the feature. 3) Wording (follow-up patch added) I have provided another follow-up for the reading history page following Owen's suggestion as this will also ease translation (combined constructs like x catalog are always a little hard) 4) id (not blocker) It could be nice to have a specific id on the message in the summary page and reading history in case libraries want to do some formatting or rephrasing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #28 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 139937 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=139937&action=edit Bug 31051: (follow-up) Tests for get_savings and more - Added tests in t/db_dependent/Koha/Patron.t - Added wording to OPACShowSavings syspref about anonymised checkout history - Added IDs to the savings messages on the OPAC Sponsored-by: Horowhenua Libraries Trust -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA CC| |lucas@bywatersolutions.com --- Comment #29 from Lucas Gass <lucas@bywatersolutions.com> --- I've tried adding something similar to this in an ISSUESLIP and I always run into the problem where things explode when delete an item that was in the patrons old issues. The same thing seems to happen here. If I delete something from a patrons old issues I get: Can't call method "replacementprice" on an undefined value at /kohadevbox/koha/Koha/Patron.pm line 2218 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #30 from Lucas Gass <lucas@bywatersolutions.com> --- Perhaps if we could make Bug 26648 move it would solve the problem here as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |26648 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26648 [Bug 26648] Prevent internal server error if item attached to old checkout has been removed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #31 from Lucas Gass <lucas@bywatersolutions.com> --- Aleisha, I think if we make this one dependent on Bug 26648 we can move it back to NSO. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139937|0 |1 is obsolete| | --- Comment #32 from Aleisha Amohia <aleisha@catalyst.net.nz> --- Created attachment 143384 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=143384&action=edit Bug 31051: (follow-up) Tests for get_savings and more - Added tests in t/db_dependent/Koha/Patron.t - Added wording to OPACShowSavings syspref about anonymised checkout history - Added IDs to the savings messages on the OPAC - Prevent explosion if a checked out item has been deleted Sponsored-by: Horowhenua Libraries Trust -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #33 from Aleisha Amohia <aleisha@catalyst.net.nz> --- (In reply to Lucas Gass from comment #31)
Aleisha,
I think if we make this one dependent on Bug 26648 we can move it back to NSO.
Addressed in latest patch, ready for testing. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Hammat wele <hammat.wele@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Hammat wele <hammat.wele@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #143384|0 |1 is obsolete| | --- Comment #34 from Hammat wele <hammat.wele@inlibro.com> --- Created attachment 144082 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144082&action=edit Bug 31051: (follow-up) Tests for get_savings and more - Added tests in t/db_dependent/Koha/Patron.t - Added wording to OPACShowSavings syspref about anonymised checkout history - Added IDs to the savings messages on the OPAC - Prevent explosion if a checked out item has been deleted Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Hammat Wele <hammat.wele@inlibro.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Bug 31051 depends on bug 26648, which changed state. Bug 26648 Summary: Prevent internal server error if item attached to old checkout has been removed https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=26648 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to oldstable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139911|0 |1 is obsolete| | --- Comment #35 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 144759 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144759&action=edit Bug 31051: Add OPACShowSavings system preference Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139912|0 |1 is obsolete| | --- Comment #36 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 144760 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144760&action=edit Bug 31051: Show patron savings on the OPAC This new feature shows a patron how much they have saved by using the library rather than purchasing items. Savings are calculated based on item replacement prices. The system preference allows you to choose where to display the savings - the user page, the summary box on the OPAC homepage, or the checkout history page. To test: 1. Update database and restart services 2. Confirm the new OPACShowSavings system preference is found in the OPAC tab of Administration -> global system preferences. There should be no options selected. 3. Find a patron with a checkout history, or check out a few items to a patron. 4. Test with different values of OPACShowSavings and confirm that savings are shown in the expected places. Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com> Signed-off-by: Axelle <axelle.clarisse@univ-amu.fr> Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139913|0 |1 is obsolete| | --- Comment #37 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 144761 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144761&action=edit Bug 31051: (follow-up) Simplify savings wording for OPAC Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #139914|0 |1 is obsolete| | --- Comment #38 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 144762 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144762&action=edit Bug 31051: (QA follow-up) Simplify savings wording for reading history Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #144082|0 |1 is obsolete| | --- Comment #39 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 144763 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=144763&action=edit Bug 31051: (follow-up) Tests for get_savings and more - Added tests in t/db_dependent/Koha/Patron.t - Added wording to OPACShowSavings syspref about anonymised checkout history - Added IDs to the savings messages on the OPAC - Prevent explosion if a checked out item has been deleted Sponsored-by: Horowhenua Libraries Trust Signed-off-by: Hammat Wele <hammat.wele@inlibro.com> Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #40 from Fridolin Somers <fridolin.somers@biblibre.com> --- Fixed QA failure FAIL installer/data/mysql/atomicupdate/bug_31051_-_add_OPACShowSavings_syspref.pl FAIL file permissions File must have the exec flag atomic file permission set to a+x -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emily.lamancusa@montgomeryc | |ountymd.gov -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Failed QA --- Comment #41 from Tomás Cohen Arazi <tomascohen@gmail.com> --- I generally like the feature. I have two QA remarks to make: 1. I expected to see some 'DISTINCT' in the queries, or a 'uniq' in the code. Because I'm not sure how the saving should be counted (i.e. if the book is recalled and I need to borrow it again, then I didn't save two times the replacement prince, but one). I guess this is subject to debate so I would mark 'In discussion' until this is settled. 2. MySQL (and DBIC) has ways to calculate this SUM in a single DB query. So we shouldn't need to look trough many checkouts and items summing things in checkouts+old_checkouts DB queries. This is a blocker in my opinion. Happy to guide/help if needed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |In Discussion -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #42 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 146431 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146431&action=edit Bug 31051: (QA follow-up) Use a single query and avoid duplicated sums This patch makes the `get_savings` method use a single query to calculate the sum of the replacement prices. This way we save one query per item and just rely on the DB features. It has a side effect: we are not summing items twice. Added tests for the 'itenumber is null' pathological but common use case (specially in old_issues), as mentioned by Lucas. Handling for this is added (grep filtering out undefined ones) and also in the return, for the empty case, with // 0. To test: 1. Apply this patch 2. Run: qa -c 6 --run-tests => SUCCESS: All good 3. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #43 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 146432 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=146432&action=edit Bug 31051: (QA follow-up) Fix misplaced syspref Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #44 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Tomás Cohen Arazi from comment #41)
2. MySQL (and DBIC) has ways to calculate this SUM in a single DB query. So we shouldn't need to look trough many checkouts and items summing things in checkouts+old_checkouts DB queries. This is a blocker in my opinion. Happy to guide/help if needed.
I submitted a candidate patch that makes things a bit more optimal. We could still make some joins to have a single query, but this is much better on its own.
1. I expected to see some 'DISTINCT' in the queries, or a 'uniq' in the code. Because I'm not sure how the saving should be counted (i.e. if the book is recalled and I need to borrow it again, then I didn't save two times the replacement prince, but one). I guess this is subject to debate so I would mark 'In discussion' until this is settled.
My implementation does what I think we should do. So letting the bug 'In discussion' until this is settled. Otherwise it would be ready. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Sally <sally.healey@cheshiresharedservices.gov.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sally.healey@cheshireshared | |services.gov.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Aleisha Amohia <aleisha@catalyst.net.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Passed QA --- Comment #45 from Aleisha Amohia <aleisha@catalyst.net.nz> --- I tested the follow-up patches and they work well. Happy for this to be pushed. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |23.05.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #46 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 23.05. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart+koha@gmail. | |com --- Comment #47 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Jenkins is failing, but I don't recreate locally. Koha_Master/2394 koha_1 | # Failed test 'Savings correctly calculated from current issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1380. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | koha_1 | # Failed test 'Savings correctly calculated from current and old issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1385. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | # Looks like you failed 2 tests of 4. koha_1 | koha_1 | # Failed test 'get_savings tests' koha_1 | # at t/db_dependent/Koha/Patron.t line 1388. koha_1 | # Looks like you failed 1 test of 20. koha_1 | [00:07:57] t/db_dependent/Koha/Patron.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #48 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to Jonathan Druart from comment #47)
Jenkins is failing, but I don't recreate locally.
Because it ends with '0'. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #49 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147189 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147189&action=edit Bug 31051: Fix test When savings ends with a "0" koha_1 | # Failed test 'Savings correctly calculated from current issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1380. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | koha_1 | # Failed test 'Savings correctly calculated from current and old issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1385. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | # Looks like you failed 2 tests of 4. koha_1 | koha_1 | # Failed test 'get_savings tests' koha_1 | # at t/db_dependent/Koha/Patron.t line 1388. koha_1 | # Looks like you failed 1 test of 20. koha_1 | [00:07:57] t/db_dependent/Koha/Patron.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #50 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- But, wait. Aren't we expecting "10" (5+5) here? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #51 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Created attachment 147190 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147190&action=edit Bug 31051: Generate items correctly in test There was a misplaced bracket in build_object. To generate item you should need build_sample_item anyway. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |additional_work_needed -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |fridolin.somers@biblibre.co |y.org |m Keywords|additional_work_needed | --- Comment #52 from Tomás Cohen Arazi <tomascohen@gmail.com> --- (In reply to Jonathan Druart from comment #47)
Jenkins is failing, but I don't recreate locally.
Koha_Master/2394
koha_1 | # Failed test 'Savings correctly calculated from current issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1380. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | koha_1 | # Failed test 'Savings correctly calculated from current and old issues' koha_1 | # at t/db_dependent/Koha/Patron.t line 1385. koha_1 | # got: '34583.70' koha_1 | # expected: '34583.7' koha_1 | # Looks like you failed 2 tests of 4. koha_1 | koha_1 | # Failed test 'get_savings tests' koha_1 | # at t/db_dependent/Koha/Patron.t line 1388. koha_1 | # Looks like you failed 1 test of 20. koha_1 | [00:07:57] t/db_dependent/Koha/Patron.t
This is interesting, as it passed for me when I tweaked the tests. Anyway, thanks for the fixes, Jonathan! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to master |Needs documenting CC| |martin.renvoize@ptfs-europe | |.com --- Comment #53 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- New feature, won't be backported to stable 22.11.x series -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Documentation| |Caroline Cyr La Rose contact| | Documentation| |https://gitlab.com/koha-com submission| |munity/koha-manual/-/merge_ | |requests/681 CC| |caroline.cyr-la-rose@inlibr | |o.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Needs documenting |RESOLVED --- Comment #54 from Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com> --- Can the [% IF savings %] [% savings | $Price with_symbol => 1 %] be used in notices? It would be useful to replace https://wiki.koha-community.org/wiki/Notices_and_Slips_Library#Add_total_val... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 --- Comment #55 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Caroline Cyr La Rose from comment #54)
Can the [% IF savings %] [% savings | $Price with_symbol => 1 %] be used in notices? It would be useful to replace https://wiki.koha-community.org/wiki/ Notices_and_Slips_Library#Add_total_value_of_items_borrowed_to_date_on_issue_ slip
Hi Caroline, I tested in CHECKIN and this works: [% USE Price %] [% borrower.get_savings | $Price with_symbol => 1 %] -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31051 Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |35078 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35078 [Bug 35078] Invalid HTML in OpacShowSavings system preference -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org