Bug 18527 - Add a system preference to exclude renewals from the quick slip
Summary: Add a system preference to exclude renewals from the quick slip
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Liz Rea
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-03 03:50 UTC by Liz Rea
Modified: 2018-06-04 20:10 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 18527 - Add a system preference to exclude renewals from the quick slip (4.38 KB, patch)
2017-06-28 23:00 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 18527 - atomicupdate (768 bytes, patch)
2017-07-10 23:21 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 18527 - Add a system preference to exclude renewals from the quick slip (4.44 KB, patch)
2017-07-11 09:56 UTC, Baptiste
Details | Diff | Splinter Review
Bug 18527: atomicupdate (993 bytes, patch)
2017-07-11 09:56 UTC, Baptiste
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Liz Rea 2017-05-03 03:50:26 UTC
Some libraries prefer to not show renewals on the day's circulations, printed on the quick slip. 

Propose to add a system preference to allow exclusion of these circulations from the quick slip.
Comment 1 Liz Rea 2017-06-28 23:00:19 UTC
Created attachment 64714 [details] [review]
Bug 18527 - Add a system preference to exclude renewals from the quick slip

To test:

Set up your test case:

Issue 4 books to a borrower.
1 we leave alone, that's today's issue.
2 Renew one of them - that's today's renewal.
3 Back date the issue date on the third one, in the database. Do not renew it. This is an issue not from today that has not been renewed.
4 Back date the issue date on the fourth, and set a renew date in the past in the database. This is an issue not from today that has been renewed in the past.

With the syspref ShowRenewalsQuickSlip set to "Show"
Print a quick slip for this borrower, you should see only issues 1 and 2.
3 and 4 should never appear on this slip.
This is the current behaviour of the quick slip, nothing should change.
This is also the default of the syspref.

With the syspref ShowRenewalsQuickSlip set to "Don't show"
Print a quick slip for this borrower, you should see only issue 1 (today's issue)
Issues 2, 3, and 4 should not appear on this slip.
This is the new behaviour, and must be activated by changing the syspref.
Comment 2 Baptiste 2017-06-30 11:04:41 UTC
This works as expected, but:
1 - Shouldn't be the syspref setted by default to 0 (old behaviour)
2 - I think the file installer/data/mysql/atomicupdate/ is missing
Comment 3 Liz Rea 2017-07-10 23:21:01 UTC
Created attachment 64986 [details] [review]
Bug 18527 - atomicupdate
Comment 4 Baptiste 2017-07-11 09:56:25 UTC
Created attachment 64988 [details] [review]
Bug 18527 - Add a system preference to exclude renewals from the quick slip

To test:

Set up your test case:

Issue 4 books to a borrower.
1 we leave alone, that's today's issue.
2 Renew one of them - that's today's renewal.
3 Back date the issue date on the third one, in the database. Do not renew it. This is an issue not from today that has not been renewed.
4 Back date the issue date on the fourth, and set a renew date in the past in the database. This is an issue not from today that has been renewed in the past.

With the syspref ShowRenewalsQuickSlip set to "Show"
Print a quick slip for this borrower, you should see only issues 1 and 2.
3 and 4 should never appear on this slip.
This is the current behaviour of the quick slip, nothing should change.
This is also the default of the syspref.

With the syspref ShowRenewalsQuickSlip set to "Don't show"
Print a quick slip for this borrower, you should see only issue 1 (today's issue)
Issues 2, 3, and 4 should not appear on this slip.
This is the new behaviour, and must be activated by changing the syspref.

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 5 Baptiste 2017-07-11 09:56:49 UTC
Created attachment 64989 [details] [review]
Bug 18527: atomicupdate

Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
Comment 6 Baptiste 2017-07-11 09:59:03 UTC
Hi,
I re committed your patch atomic update, I don't know why it was inversed (the patch wanted to delete from the code what you actually wrote).

However all work well, but I think the QA won't accept the default setting of the syspref to 1.
Comment 7 Liz Rea 2017-07-12 22:32:21 UTC
Showing renewals is the current behaviour, and is what the default is set to. 

Thank you for fixing up the atomic update!

Cheers,
Liz
Comment 8 Jonathan Druart 2017-07-13 16:47:48 UTC
This is typically the kind of thing that will be easy to do using the TT syntax (see bug 17966).
I am not in favour of adding a new pref for that.
Comment 9 Katrin Fischer 2017-07-14 11:35:02 UTC
Can we document how this would work with TT?

Excluding the renewed ones = removing checkouts with last renewal today?
Comment 10 Jonathan Druart 2017-07-17 17:30:40 UTC
(In reply to Katrin Fischer from comment #9)
> Can we document how this would work with TT?
> 
> Excluding the renewed ones = removing checkouts with last renewal today?

Since you have Koha::Objects based objects and the power of TT, you can do whatever you like.

Something like the following should achieve the same goal.

[% SET today_date = today | $KohaDates %
[% FOREACH checkout IN checkouts %]
    [% IF checkout.renewals %]
        This checkout has been renewed [% checkout.renewals %] times.
        [% SET last_renewal_date = checkout.lastreneweddate | $KohaDates %]
        [% IF today_date == last_renewal_date%]
            It has been renewed today!
        [% END %]
    [% ELSE %]
        This checkout has never been renewed.
    [% END %]
[% END %]

You can use today.substr instead of the the KohaDates filter if you prefer.