From 62c834496d57fd0e21abff5e519e290ce926e780 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 29 Oct 2019 12:29:54 -0300 Subject: [PATCH] Bug 14697: Enhance the return claims feature [FIXME] This adds a "Claims returned" feature that extends and enhances the claims returned lost status. To use this feature, a new LOST status to represent an item claimed as returned needs to be created. The value of this LOST authorised value should be set in the new syspref ClaimReturnedLostValue. Setting this system preference turns on the feature. Once the feature is enabled, you should be able to mark checked out items as return claims from the checkout and patron details pages, and also modify them from the new claims tab on those pages. Returning a claimed item will notify the librarian that the item in question has a claim on it. Setting the ClaimReturnedWarningThreshold will add an alert to make librarians aware that this patron has many return claims on the patron's record. Test Plan: 1) Create a "Claims Returned" lost value 2) Create some RETURN_CLAIM_RESOLUTION authorized values 3) Set ClaimReturnedLostValue 4) Set ClaimReturnedChargeFee 5) Set ClaimReturnedWarningThreshold 6) Create some checkouts 7) Claim some returns 8) Verify ClaimReturnedChargeFee works with all 3 options 9) Verify ClaimReturnedWarningThreshold shows a warning once the threshold has been exceeded 10) Edit notes on a claim 11) Resolve a claim 12) Delete a claim Sponsored-by: North Central Regional Library System Signed-off-by: Tomas Cohen Arazi Signed-off-by: Andrew Fuerste-Henry Signed-off-by: Lisette Scheer --- circ/circulation.pl | 1 + circ/returns.pl | 4 +- .../prog/en/includes/checkouts-table.inc | 71 +++++ .../prog/en/includes/patron-return-claims.inc | 15 + .../prog/en/includes/strings.inc | 5 + .../admin/preferences/circulation.pref | 19 ++ .../prog/en/modules/catalogue/moredetail.tt | 36 ++- .../prog/en/modules/circ/circulation.tt | 36 +++ .../prog/en/modules/circ/returns.tt | 19 ++ .../prog/en/modules/members/moremember.tt | 25 ++ koha-tmpl/intranet-tmpl/prog/js/checkouts.js | 282 +++++++++++++++++- members/moremember.pl | 1 + svc/checkouts | 61 ++-- svc/return_claims | 127 ++++++++ 14 files changed, 666 insertions(+), 36 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/patron-return-claims.inc create mode 100755 svc/return_claims diff --git a/circ/circulation.pl b/circ/circulation.pl index 60e5455279..5bc227d032 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -643,6 +643,7 @@ $template->param( override_high_holds => $override_high_holds, nopermission => scalar $query->param('nopermission'), autoswitched => $autoswitched, + logged_in_user => $logged_in_user, ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/circ/returns.pl b/circ/returns.pl index 42226b4bcc..ddce95ab75 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -542,7 +542,9 @@ foreach my $code ( keys %$messages ) { elsif ( $code eq 'DataCorrupted' ) { $err{data_corrupted} = 1; } - else { + elsif ( $code eq 'ReturnClaims' ) { + $template->param( ReturnClaims => $messages->{ReturnClaims} ); + } else { die "Unknown error code $code"; # note we need all the (empty) elsif's above, or we die. # This forces the issue of staying in sync w/ Circulation.pm } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc index 1276e70ab1..f1bc60ff4b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table.inc @@ -28,6 +28,7 @@ Price Renew

select all | none

Check in

select all | none

+ Return claims Export

select all | none

@@ -83,3 +84,73 @@

Patron has nothing checked out.

[% END %] + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-return-claims.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-return-claims.inc new file mode 100644 index 0000000000..63f1dad303 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-return-claims.inc @@ -0,0 +1,15 @@ +
+ + + + + + + + + + + + +
Claim IDTitleNotesCreated onUpdated onResolution 
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc index e88a90fb6d..7eba12b93e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/strings.inc @@ -5,6 +5,10 @@ var NOT_RENEWABLE_RESTRICTION = _("Not allowed: patron restricted"); var CIRCULATION_RENEWED_DUE = _("Renewed, due:"); var CIRCULATION_RENEW_FAILED = _("Renew failed:"); + var RETURN_CLAIMED = _("Return claimed"); + var RETURN_CLAIMED_FAILURE = _("Unable to claim as returned"); + var RETURN_CLAIMED_MAKE = _("Claim returned"); + var RETURN_CLAIMED_NOTES = _("Notes about return claim"); var NOT_CHECKED_OUT = _("not checked out"); var TOO_MANY_RENEWALS = _("too many renewals"); var ON_RESERVE = _("on hold"); @@ -47,4 +51,5 @@ var MSG_NO_ITEMTYPE = _("No itemtype"); var MSG_CHECKOUTS_BY_ITEMTYPE = _("Number of checkouts by item type"); var PATRON_NOTE = _("Patron note"); + var CONFIRM_DELETE_RETURN_CLAIM = _("Are you sure you want to delete this return claim?"); 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 3c24d51273..f7ab923def 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 @@ -1084,3 +1084,22 @@ Circulation: pages: Pages chapters: Chapters - + Return Claims: + - + - When marking a checkout as "claims returned", + - pref: ClaimReturnedChargeFee + default: ask + choices: + ask: ask if a lost fee should be charged + charge: charge a lost fee + no_charge: don't charge a lost fee + - . + - + - Use the LOST authorised value + - pref: ClaimReturnedLostValue + - to represent returns claims + - + - Warn librarians that a patron has excessive return cliams if the patron has claimed the return of more than + - pref: ClaimReturnedWarningThreshold + class: integer + - items. diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt index 0a6d0609eb..8d5e712567 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/moredetail.tt @@ -100,21 +100,31 @@
  • Lost status: [% IF ( CAN_user_circulate ) %]
    - - - - + + + + + + + [% SET ClaimReturnedLostValue = Koha.Preference('ClaimReturnedLostValue') %] + [% IF ClaimReturnedLostValue && ITEM_DAT.itemlost == ClaimReturnedLostValue %] + +

    Item has been claimed as returned.

    [% ELSE %] - + +
    [% END %] - [% END %] - - - + [% ELSE %] [% FOREACH itemlostloo IN itemlostloop %] [% IF ( itemlostloo.selected ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 86803440d4..acbe85abab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -732,6 +732,12 @@
  • Overdues: Patron has ITEMS OVERDUE. See highlighted items below
  • [% END %] + [% SET ClaimReturnedWarningThreshold = Koha.Preference('ClaimReturnedWarningThreshold') %] + [% SET return_claims = patron.return_claims %] + [% IF return_claims.count %] +
  • Return claims: Patron has [% return_claims.count | html %] RETURN CLAIMS. + [% END %] + [% IF ( charges ) %] [% INCLUDE 'blocked-fines.inc' fines = chargesamount %] [% END %] @@ -845,6 +851,30 @@
  • [% END %] +
  • + [% IF ( patron.return_claims.count ) %] + + [% patron.return_claims.resolved.count | html %] + / + [% patron.return_claims.unresolved.count | html %] + Claim(s) + + [% ELSE %] + + 0 + / + 0 + Claim(s) + + [% END %] +
  • + + [% IF Koha.Preference('ArticleRequests') %] +
  • + [% patron.article_requests_current.count | html %] Article requests +
  • + [% END %] +
  • [% debarments.count | html %] Restrictions
  • [% SET enrollments = patron.get_club_enrollments(1) %] @@ -928,6 +958,8 @@ [% END # /IF holds_count %] + [% INCLUDE 'patron-return-claims.inc' %] + [% IF Koha.Preference('ArticleRequests') %] [% INCLUDE 'patron-article-requests.inc' %] [% END %] @@ -995,6 +1027,10 @@ [% Asset.js("js/circ-patron-search-results.js") | $raw %]