From: erickson Date: Fri, 30 Oct 2009 14:34:43 +0000 (+0000) Subject: added support for overrideing the amount to charge the patron when an item is marked... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=0361a39026f09ef476e4f69c223ef969ee78454f;p=contrib%2FConifer.git added support for overrideing the amount to charge the patron when an item is marked as damaged git-svn-id: svn://svn.open-ils.org/ILS/trunk@14701 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 ea3694c527..8e60472b24 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Circ.pm @@ -1079,6 +1079,9 @@ sub handle_mark_damaged { my $apply = $args->{apply_fines} || ''; return undef if $apply eq 'noapply'; + my $new_amount = $args->{override_amount}; + my $new_btype = $args->{override_btype}; + # grab the last circulation my $circ = $e->search_action_circulation([ { target_copy => $copy->id}, @@ -1107,16 +1110,30 @@ sub handle_mark_damaged { if($apply) { - if($charge_price and $copy_price) { - my $evt = OpenILS::Application::Circ::CircCommon->create_bill( - $e, $copy_price, 7, 'Damaged Item', $circ->id); - return $evt if $evt; - } + if($new_amount and $new_btype) { + + # Allow staff to override the amount to charge for a damaged item + # Consider the case where the item is only partially damaged + # This value is meant to take the place of the item price and + # optional processing fee. - if($proc_fee) { my $evt = OpenILS::Application::Circ::CircCommon->create_bill( - $e, $proc_fee, 8, 'Damaged Item Processing Fee', $circ->id); + $e, $new_amount, $new_btype, 'Damaged Item Override', $circ->id); return $evt if $evt; + + } else { + + if($charge_price and $copy_price) { + my $evt = OpenILS::Application::Circ::CircCommon->create_bill( + $e, $copy_price, 7, 'Damaged Item', $circ->id); + return $evt if $evt; + } + + if($proc_fee) { + my $evt = OpenILS::Application::Circ::CircCommon->create_bill( + $e, $proc_fee, 8, 'Damaged Item Processing Fee', $circ->id); + return $evt if $evt; + } } # the assumption is that you would not void the overdues unless you