@@ -, +, @@ --- C4/Circulation.pm | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1785,21 +1785,28 @@ sub AddReturn { } if ($borrowernumber) { - if( C4::Context->preference('CalculateFinesOnReturn') && $issue->{'overdue'}){ - # we only need to calculate and change the fines if we want to do that on return - # Should be on for hourly loans - my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today ); + if ( C4::Context->preference('CalculateFinesOnReturn') + && $issue->{'overdue'} ) + { +# we only need to calculate and change the fines if we want to do that on return +# Should be on for hourly loans + my ( $amount, $type, $unitcounttotal ) = + C4::Overdues::CalcFine( $item, $borrower->{categorycode}, + $branch, $datedue, $today ); $type ||= q{}; - if ( $amount > 0 && ( C4::Context->preference('finesMode') eq 'production' )) { - C4::Overdues::UpdateFine( - $issue->{itemnumber}, - $issue->{borrowernumber}, - $amount, $type, output_pref($datedue) - ); - } + if ( $amount > 0 + && ( C4::Context->preference('finesMode') eq 'production' ) + ) + { + C4::Overdues::UpdateFine( $issue->{itemnumber}, + $issue->{borrowernumber}, + $amount, $type, output_pref($datedue) ); + } } - MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'}); - $messages->{'WasReturned'} = 1; # FIXME is the "= 1" right? This could be the borrower hash. + MarkIssueReturned( $borrowernumber, $item->{'itemnumber'}, + $circControlBranch, '', $borrower->{'privacy'} ); + $messages->{'WasReturned'} = + 1; # FIXME is the "= 1" right? This could be the borrower hash. } ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'}); --