From 4fc3298c6e4b15c6d693d62ca052a1f0f27f62ae Mon Sep 17 00:00:00 2001 From: erickson Date: Fri, 10 Jul 2009 14:46:30 +0000 Subject: [PATCH] using new penalty org depth when setting invalid addr penalty. created const for penalty name git-svn-id: svn://svn.open-ils.org/ILS/trunk@13561 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Actor.pm | 9 +++++++-- Open-ILS/src/perlmods/OpenILS/Const.pm | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 2220d82178..68503d188a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -328,10 +328,15 @@ sub apply_invalid_addr_penalty { } elsif($enforce and $addr_count > 0 and !$addr_penalty) { + my $ptype = $e->retrieve_config_standing_penalty(29) or return $e->die_event; + my $depth = $ptype->org_depth; + my $ctx_org = $U->org_unit_ancestor_at_depth($patron->home_ou, $depth) if defined $depth; + $ctx_org = $patron->home_ou unless defined $ctx_org; + my $penalty = Fieldmapper::actor::user_standing_penalty->new; $penalty->usr($patron->id); - $penalty->org_unit($patron->home_ou); # TODO: use depth - $penalty->standing_penalty(29); # INVALID_PATRON_ADDRESS (TODO: make me a constant, please) + $penalty->org_unit($ctx_org); + $penalty->standing_penalty(OILS_PENALTY_INVALID_PATRON_ADDRESS); $e->create_actor_user_standing_penalty($penalty) or return $e->die_event; $e->commit; diff --git a/Open-ILS/src/perlmods/OpenILS/Const.pm b/Open-ILS/src/perlmods/OpenILS/Const.pm index 5d58ef63ee..3af4aeab7d 100644 --- a/Open-ILS/src/perlmods/OpenILS/Const.pm +++ b/Open-ILS/src/perlmods/OpenILS/Const.pm @@ -111,6 +111,7 @@ econst OILS_ACQ_DEBIT_TYPE_TRANSFER => 'xfer'; econst OILS_PENALTY_AUTO_ID => 100; econst OILS_PENALTY_PATRON_EXCEEDS_FINES => 1; econst OILS_PENALTY_PATRON_EXCEEDS_OVERDUE_COUNT => 2; +econst OILS_PENALTY_INVALID_PATRON_ADDRESS => 29; econst OILS_BILLING_TYPE_NOTIFICATION_FEE => 9; -- 2.11.0