From e66abddc13ebdf9ae025469116d359e48ff7624e Mon Sep 17 00:00:00 2001 From: Liz Rea Date: Wed, 22 Mar 2017 11:37:22 +1300 Subject: [PATCH] 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. --- C4/Members.pm | 16 +++++++++++++--- installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/circulation.pref | 6 ++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/C4/Members.pm b/C4/Members.pm index 6527c79..aa93e06 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -1182,10 +1182,20 @@ sub IssueSlip { $issue->{date_due} = $issue->{date_due_sql}; if ($quickslip) { my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); - if ( substr( $issue->{issuedate}, 0, 10 ) eq $today - or substr( $issue->{lastreneweddate}, 0, 10 ) eq $today ) { + if ( C4::Context->preference("ShowRenewalsQuickslip") == 0 ) { + #we want today's issues, but not items renewed today + if ( (substr( $issue->{issuedate}, 0, 10 ) eq $today ) + && (substr( $issue->{lastreneweddate}, 0, 10 ) ne $today) ) { $issue->{now} = 1; - }; + } + } + else { + # we want all issues, including renewals, from today + if ( substr( $issue->{issuedate}, 0, 10 ) eq $today + or substr( $issue->{lastreneweddate}, 0, 10 ) eq $today ) { + $issue->{now} = 1; + } + } } } diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 0bd8cac..f8dbba3 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -479,6 +479,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('ShelfBrowserUsesLocation','1','1','Use the item location when finding items for the shelf browser.','YesNo'), ('ShowAllCheckins', '0', '', 'Show all checkins', 'YesNo'), ('ShowPatronImageInWebBasedSelfCheck','0','','If ON, displays patron image when a patron uses web-based self-checkout','YesNo'), +('ShowRenewalsQuickslip','1','If OFF, do not show renewals on quick slips','','YesNo'), ('ShowReviewer','full','none|full|first|surname|firstandinitial|username','Choose how a commenter\'s identity is presented alongside comments in the OPAC','Choice'), ('ShowReviewerPhoto','1','','If ON, photo of reviewer will be shown beside comments in OPAC','YesNo'), ('SlipCSS','',NULL,'Slips CSS url.','free'), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index 90b2844..dc9be44 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -150,6 +150,12 @@ Circulation: yes: Allow no: "Don't allow" - patrons to submit notes about checked out items. + - + - pref: ShowRenewalsQuickslip + choices: + yes: Show + no: "Don't show" + - items renewed today on the circulation Quick Slip. Checkout Policy: - -- 2.7.4