From: blake Date: Tue, 12 Feb 2019 21:57:17 +0000 (-0600) Subject: LP1331174_Long_Overdue_processing_needs_org_unit_settings X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0f06a1948ba86d30e13407d846330208258c24c4;p=working%2FEvergreen.git LP1331174_Long_Overdue_processing_needs_org_unit_settings Introduced a third library setting "circ.longoverdue.to_lost" which will allow the code to execute beyond the error "COPY_MARKED_LONG_OVERDUE". Introduced a sample action_trigger.event_definition '12 Month Long-Overdue Mark Lost' disabled by default. This action trigger definition will target Long-Overdue items when executed with the provided action_trigger_filters_lod_to_lost.json.example. Includes a sample file action_trigger_filters_lod_to_lost.json.example Reference to action_trigger_filters_lod_to_lost.json.example is included in Makefile Extensive documentation added Signed-off-by: blake --- diff --git a/Open-ILS/examples/action_trigger_filters_lod_to_lost.json.example b/Open-ILS/examples/action_trigger_filters_lod_to_lost.json.example new file mode 100644 index 0000000000..74c3ab876b --- /dev/null +++ b/Open-ILS/examples/action_trigger_filters_lod_to_lost.json.example @@ -0,0 +1,12 @@ +{ +"checkout.due" : + { "context_org" : "circ_lib", + "filter" : + { "checkin_time" : null, + "-or" : + [ { "stop_fines" : ["MAXFINES","LONGOVERDUE"] }, + { "stop_fines" : null } + ] + } + } +} diff --git a/Open-ILS/examples/crontab.example b/Open-ILS/examples/crontab.example index 35144cd871..548a7ef166 100644 --- a/Open-ILS/examples/crontab.example +++ b/Open-ILS/examples/crontab.example @@ -80,6 +80,7 @@ EG_BIN_DIR = /openils/bin 15 3 * * 0 . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity weekly 20 3 1 * * . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity monthly 25 3 1 1 * . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity yearly +5 4 * * * . ~/.bashrc && $EG_BIN_DIR/action_trigger_runner.pl --osrf-config $SRF_CORE --process-hooks --granularity long_overdue_to_lost --custom-filters /openils/conf/action_trigger_filters_lod_to_lost.json.example # Purge old A/T events 15 1 * * * . ~/.bashrc && $EG_BIN_DIR/purge_at_events.srfsh diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml index de89389fb1..6b77daa2e2 100644 --- a/Open-ILS/examples/fm_IDL.xml +++ b/Open-ILS/examples/fm_IDL.xml @@ -4546,7 +4546,7 @@ SELECT usr, SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN 1 ELSE 0 END) AS lost, SUM( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN 1 ELSE 0 END) AS claims_returned, - SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE' AND ID IN(SELECT xact FROM money.billing WHERE xact=acirc.id)) THEN 1 ELSE 0 END) AS long_overdue + SUM( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE' AND ID IN(SELECT xact FROM money.billing WHERE xact=acirc.id)) THEN 1 ELSE 0 END) AS long_overdue FROM action.circulation acirc WHERE checkin_time IS NULL GROUP BY 1 @@ -4588,7 +4588,7 @@ SELECT usr, STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LOST') THEN id::TEXT ELSE '0' END,',') AS lost, STRING_AGG( CASE WHEN stop_fines = 'CLAIMSRETURNED' THEN id::TEXT ELSE '0' END,',') AS claims_returned, - STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE' AND ID IN(SELECT xact FROM money.billing WHERE xact=acirc.id)) THEN id::TEXT ELSE '0' END,',') AS long_overdue + STRING_AGG( CASE WHEN (xact_finish IS NULL AND stop_fines = 'LONGOVERDUE' AND ID IN(SELECT xact FROM money.billing WHERE xact=acirc.id)) THEN id::TEXT ELSE '0' END,',') AS long_overdue FROM action.circulation acirc WHERE checkin_time IS NULL GROUP BY 1 diff --git a/Open-ILS/src/Makefile.am b/Open-ILS/src/Makefile.am index 33d311264e..b294b4c002 100644 --- a/Open-ILS/src/Makefile.am +++ b/Open-ILS/src/Makefile.am @@ -34,6 +34,7 @@ autojsbinscripts = @srcdir@/extras/autogen.sh # Decide which entities to build sysconf_DATA = $(examples)/action_trigger_filters.json.example \ + $(examples)/action_trigger_filters_lod_to_lost.json.example \ $(examples)/opensrf.xml.example \ $(examples)/opensrf_core.xml.example \ $(examples)/fm_IDL.xml \ diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm index 0256eb3a59..83cbb78ee7 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Cat/AssetCommon.pm @@ -837,7 +837,8 @@ sub set_item_long_overdue { event => 'COPY_MARKED_LONG_OVERDUE', stop_fines => OILS_STOP_FINES_LONGOVERDUE, at_hook => 'longoverdue', - ous_assess_billing => OILS_SETTING_LONG_OVERDUE_ASSESS_BILLING + ous_assess_billing => OILS_SETTING_LONG_OVERDUE_ASSESS_BILLING, + ous_lod_to_lost => OILS_SETTING_LONG_OVERDUE_TO_LOST ); } @@ -861,8 +862,13 @@ sub set_item_lost_or_lod { $e->allowed($args{perm}, $circ->circ_lib) or return $e->die_event; + # --------------------------------------------------------------------- + # fetch OILS_SETTING_LONG_OVERDUE_TO_LOST setting to see if we proceed to billing or not + my $ous_lod_to_lost = $U->ou_ancestor_setting_value( + $owning_lib, $args{ous_assess_billing}, $e); + return $e->die_event(OpenILS::Event->new($args{event})) - if ($copy->status == $args{status} || $copy->status == $args{alt_status}); + if ($copy->status == $args{status} || ($copy->status == $args{alt_status} && !$ous_lod_to_lost) ); # --------------------------------------------------------------------- # fetch the related org settings diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Const.pm b/Open-ILS/src/perlmods/lib/OpenILS/Const.pm index 059b42a59a..10fbc5014f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Const.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Const.pm @@ -100,6 +100,7 @@ econst OILS_SETTING_BLOCK_HOLD_FOR_EXPIRED_PATRON => 'circ.holds.expired_p econst OILS_SETTING_GENERATE_OVERDUE_ON_LOST_RETURN => 'circ.lost.generate_overdue_on_checkin'; econst OILS_SETTING_MAX_DUPLICATE_HOLDS => 'circ.holds.max_duplicate_holds'; econst OILS_SETTING_LONG_OVERDUE_ASSESS_BILLING => 'circ.longoverdue.assess_billing'; +econst OILS_SETTING_LONG_OVERDUE_TO_LOST => 'circ.longoverdue.to_lost'; diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 736dff77c2..08839ac32f 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -16210,6 +16210,23 @@ INSERT INTO config.org_unit_setting_type 'description' ) +), ( + 'circ.longoverdue.to_lost', + 'finance', 'bool', + oils_i18n_gettext( + 'circ.longoverdue.to_lost', + 'Allow Long-Overdue to become Lost', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'circ.longoverdue.to_lost', + 'This setting will allow items marked as Long-Overdue to become Lost. ' || + 'This will allow staff and action trigger(s) to mark the item lost even ' || + $$if it's already Long-Overdue. The default is false.$$, + 'coust', + 'description' + ) ); -- mark long-overdue reactor @@ -17017,6 +17034,16 @@ INSERT INTO action_trigger.environment ( 'circ_lib' ); +-- sample long-overdue to lost trigger +INSERT INTO action_trigger.event_definition + (active, owner, name, hook, validator, reactor, delay, delay_field, granularity) +VALUES ( + FALSE, 1, '12 Month Long-Overdue Mark Lost', + 'checkout.due', 'CircIsOverdue', + 'MarkItemLost', '12 months', 'due_date','long_overdue_to_lost' +); + + INSERT INTO config.org_unit_setting_type (name, grp, label, description, datatype) VALUES diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.long-overdue-asses-fines-library-setting.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.long-overdue-asses-fines-library-setting.sql index b38639533d..696aa8306e 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.long-overdue-asses-fines-library-setting.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.long-overdue-asses-fines-library-setting.sql @@ -33,10 +33,30 @@ INSERT INTO config.org_unit_setting_type ( name, grp, label, description, dataty 'label' ), oils_i18n_gettext( - 'circ.longoverdue.continue_overdue_billing', - 'When an item is marked long overdue, overdues are halted. ' || - 'A setting of true here will allow the overdues to continue ' || - 'until another condition is met.', + 'circ.longoverdue.continue_overdue_billing', + 'When an item is marked long overdue, overdues are halted. ' || + 'A setting of true here will allow the overdues to continue ' || + 'until another condition is met.', + 'coust', + 'description' + ), 'bool' + ) + ; + + INSERT INTO config.org_unit_setting_type ( name, grp, label, description, datatype ) VALUES ( + 'circ.longoverdue.to_lost', + 'finance', + oils_i18n_gettext( + 'circ.longoverdue.to_lost', + 'Allow Long-Overdue to become Lost', + 'coust', + 'label' + ), + oils_i18n_gettext( + 'circ.longoverdue.to_lost', + 'This setting will allow items marked as Long-Overdue to become Lost. ' || + 'This will allow staff and action trigger(s) to mark the item lost even ' || + $$if it's already Long-Overdue. The default is false.$$, 'coust', 'description' ), 'bool' @@ -45,5 +65,4 @@ INSERT INTO config.org_unit_setting_type ( name, grp, label, description, dataty - COMMIT; diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/lod_new_lib_settings.txt b/docs/RELEASE_NOTES_NEXT/Circulation/lod_new_lib_settings.txt index 1631283c37..a15258a7f9 100644 --- a/docs/RELEASE_NOTES_NEXT/Circulation/lod_new_lib_settings.txt +++ b/docs/RELEASE_NOTES_NEXT/Circulation/lod_new_lib_settings.txt @@ -1,3 +1,35 @@ +*Long-Overdue to Lost* + +* Some libraries prefer to have items become Long-Overdue before they become Lost. Usually +for some or all of these reasons: + +** Allows the patron to receive a "warning" notice (if action trigger is setup). +** Allows the system to apply penalties to the patron (preventing holds for example) +** Can be configured to NOT bill the patron during this step, but instead bill the patron at +the Lost step. + +* If you would like the system to allow items to transition from Long-Overdue to Lost: + +** Contact your system administrator and double check that the server is configured to +use the special action_trigger_filters_lod_to_lost.json.example. This is not +"instead of" but should be configured "in addition to" the standard +action_trigger_filters.json.example. + +** You will need to consider these three library settings: + +*** "Allow Long-Overdue to become Lost" - This setting needs to be set to "True" + +*** "Assess Billing When Marked Long-Overdue" - This setting is generally set to +"False" in favor of billing the patron at the Lost stage. If "True" - the system +will bill the patron the same way it would when marked Lost. A setting of "True" +will cause the system to bill the patron based upon your settings: +"Long-Overdue Materials Processing Fee" and "Void Overdue Fines When Items are Marked Long-Overdue" + +*** "Continue Overdue Billing When Marked Long-Overdue" - This setting is generally +set to "True" which will allow the system to continue to generate fines as if it were Overdue. + + *New Library Setting* **Finances: Assess Billing When Marked Long-Overdue - When an item is marked long overdue a bill for the item will be assesed unless this setting is false. The default is true. If false, void overdue setting will be ignored and processing fee will be ignored **Finances: Continue Overdue Billing When Marked Long-Overdue - When an item is marked long overdue, overdues are halted. A setting of true here will allow the overdues to continue until another condition is met. +**Finances: Allow Long-Overdue to become Lost - This setting will allow items that have been previously marked Long-Overdue by an action trigger or otherwise to become Lost. \ No newline at end of file diff --git a/docs/admin/actiontriggers_process.adoc b/docs/admin/actiontriggers_process.adoc index 8a6fc861d3..09afcb6919 100644 --- a/docs/admin/actiontriggers_process.adoc +++ b/docs/admin/actiontriggers_process.adoc @@ -61,3 +61,9 @@ pending events with that same granularity. perl action_trigger_runner.pl --run-pending --granularity=Hourly --process-hooks ---- +* Run the specific Long-Overdue to Lost triggers with the custom action_trigger_filters. ++ +---- +perl action_trigger_runner.pl --process-hooks --granularity long_overdue_to_lost --custom-filters /openils/conf/action_trigger_filters_lod_to_lost.json.example +---- + diff --git a/docs/circulation/circulating_items.adoc b/docs/circulation/circulating_items.adoc index 521d489dec..eef44a3708 100644 --- a/docs/circulation/circulating_items.adoc +++ b/docs/circulation/circulating_items.adoc @@ -389,6 +389,37 @@ configured period of time ** 6 Month Long Overdue Notice—will send patron notification that an item has been marked long overdue on their account +*Long-Overdue to Lost* + +* Some libraries prefer to have items become Long-Overdue before they become Lost. Usually +for some or all of these reasons: + +** Allows the patron to receive a "warning" notice (if action trigger is setup). +** Allows the system to apply penalties to the patorn (preventing holds for example) +** Can be configured to NOT bill the patron during this step, but instead bill the patron at +the Lost step. + +* If you would like the system to allow items to transition from Long-Overdue to Lost: + +** Contact your system administrator and double check that the server is configured to +use the special action_trigger_filters_lod_to_lost.json.example. This is not +"instead of" but should be configured "in addition to" the standard +action_trigger_filters.json.example. + +** You will need to consider these three library settings: + +*** "Allow Long-Overdue to become Lost" - This setting needs to be set to "True" + +*** "Assess Billing When Marked Long-Overdue" - This setting is generally set to +"False" in favor of billing the patron at the Lost stage. If "True" - the system +will bill the patron the same way it would when marked Lost. A setting of "True" +will cause the system to bill the patron based upon your settings: +"Long-Overdue Materials Processing Fee" and "Void Overdue Fines When Items are Marked Long-Overdue" + +*** "Continue Overdue Billing When Marked Long-Overdue" - This setting is generally +set to "True" which will allow the system to continue to generate fines as if it were Overdue. + + *Library Settings* The following Library Settings enable you to set preferences related to long @@ -423,10 +454,12 @@ lost copy on the patron record when it is paid * *Finances: Void Overdue Fines When Items are Marked Long-Overdue* -* *Finances: Assess Billing When Marked Long-Overdue* -Optionally skip billing price of item +* *Finances: Assess Billing When Marked Long-Overdue* - Optionally skip billing price of item * *Finances: Continue Overdue Billing When Marked Long-Overdue* +* *Finances: Allow Long-Overdue to become Lost* + *Permissions to use this Feature* The following permissions are related to this feature: