From: erickson Date: Wed, 16 Aug 2006 21:33:06 +0000 (+0000) Subject: fixed up default copy price handling on mark-lost X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f5b7b495e8d975df01ce3749b261cc3b7b327afe;p=evergreen%2Fpines.git fixed up default copy price handling on mark-lost git-svn-id: svn://svn.open-ils.org/ILS/trunk@5546 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm index 7ff72f55c7..5441d771b7 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -295,23 +295,25 @@ sub _set_circ_lost { # if the copy has a price defined and/or a processing fee, bill the patron - my $copy_price = $copy->price || 0; + # if the location that owns the copy has a processing fee, charge the user + my $owner = $U->fetch_copy_owner($copy->id); + $logger->info("circ fetching org settings for $owner ". + "to determine processing fee and default copy price"); - $logger->debug("lost copy has a price of $copy_price"); + my $settings = $U->simplereq( + 'open-ils.actor', 'open-ils.actor.org_unit.settings.retrieve', $owner ); + my $fee = $settings->{'circ.lost_materials_processing_fee'} || 0; # If the copy has a price configured, charge said price to the user + my $s = OILS_SETTING_DEF_ITEM_PRICE; + my $copy_price = $copy->price || 0; + $copy_price = $settings->{$s} unless $copy_price and $copy_price > 0; if($copy_price and $copy_price > 0) { + $logger->debug("lost copy has a price of $copy_price"); $evt = _make_bill($session, $copy_price, 'Lost Materials', $circ->id); return $evt if $evt; } - # if the location that owns the copy has a processing fee, charge the user - my $owner = $U->fetch_copy_owner($copy->id); - $logger->info("circ fetching org settings for $owner to determine processing fee"); - - my $settings = $U->simplereq( - 'open-ils.actor', 'open-ils.actor.org_unit.settings.retrieve', $owner ); - my $fee = $settings->{'circ.lost_materials_processing_fee'} || 0; if( $fee ) { $evt = _make_bill($session, $fee, 'Lost Materials Processing Fee', $circ->id);