We add settings for voiding longoverdue fees on claims returned.
We modify code in Circ.pm to check those settings and void those
bills when a circulation is claims returned.
We also make some logical repairs to the new void_lost function
in CircCommon.pm and to event handling where that function is
called in set_circ_claims_returned in Circ.pm.
Signed-off-by: Jason Stephenson <jason@sigio.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
$circ,
3
);
- return $result if ($result);
+ if ($result) {
+ $e->rollback;
+ return $result;
+ }
}
# Check if the copy circ lib wants lost processing fees voided on
$circ,
4
);
- return $result if ($result);
+ if ($result) {
+ $e->rollback;
+ return $result;
+ }
+ }
+
+ # Check if the copy circ lib wants longoverdue fees voided on claims
+ # returned.
+ if ($U->is_true($U->ou_ancestor_setting_value($copy->circ_lib, 'circ.void_longoverdue_on_claimsreturned', $e))) {
+ my $result = OpenILS::Application::Circ::CircCommon->void_lost(
+ $e,
+ $circ,
+ 10
+ );
+ if ($result) {
+ $e->rollback;
+ return $result;
+ }
+ }
+
+ # Check if the copy circ lib wants longoverdue processing fees voided on
+ # claims returned.
+ if ($U->is_true($U->ou_ancestor_setting_value($copy->circ_lib, 'circ.void_longoverdue_proc_fee_on_claimsreturned', $e))) {
+ my $result = OpenILS::Application::Circ::CircCommon->void_lost(
+ $e,
+ $circ,
+ 11
+ );
+ if ($result) {
+ $e->rollback;
+ return $result;
+ }
}
$e->commit;
my $bills = $e->search_money_billing(
{
xact => $circ->id,
- btype => $btype
+ btype => $btype,
+ voided => 'f'
}
);
'Void lost item processing fee when claims returned',
'coust', 'description'),
'bool');
+
+INSERT INTO config.org_unit_setting_type
+ (name, grp, label, description, datatype)
+ VALUES
+ ('circ.void_longoverdue_on_claimsreturned',
+ 'circ',
+ oils_i18n_gettext('circ.void_longoverdue_on_claimsreturned',
+ 'Void longoverdue item billing when claims returned',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.void_longoverdue_on_claimsreturned',
+ 'Void long overdue item billing when claims returned',
+ 'coust', 'description'),
+ 'bool'),
+ ('circ.void_longoverdue_proc_fee_on_claimsreturned',
+ 'circ',
+ oils_i18n_gettext('circ.void_longoverdue_proc_fee_on_claimsreturned',
+ 'Void longoverdue item processing fee when claims returned',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.void_longoverdue_proc_fee_on_claimsreturned',
+ 'Void long overdue item processing fee when claims returned',
+ 'coust', 'description'),
+ 'bool');
BEGIN;
-SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+--SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
INSERT INTO config.org_unit_setting_type
(name, grp, label, description, datatype)
'coust', 'description'),
'bool');
+INSERT INTO config.org_unit_setting_type
+ (name, grp, label, description, datatype)
+ VALUES
+ ('circ.void_longoverdue_on_claimsreturned',
+ 'circ',
+ oils_i18n_gettext('circ.void_longoverdue_on_claimsreturned',
+ 'Void long overdue item billing when claims returned',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.void_longoverdue_on_claimsreturned',
+ 'Void long overdue item billing when claims returned',
+ 'coust', 'description'),
+ 'bool'),
+ ('circ.void_longoverdue_proc_fee_on_claimsreturned',
+ 'circ',
+ oils_i18n_gettext('circ.void_longoverdue_proc_fee_on_claimsreturned',
+ 'Void long overdue item processing fee when claims returned',
+ 'coust', 'label'),
+ oils_i18n_gettext('circ.void_longoverdue_proc_fee_on_claimsreturned',
+ 'Void long overdue item processing fee when claims returned',
+ 'coust', 'description'),
+ 'bool');
+
COMMIT;