View | Details | Raw Unified | Return to bug 10120
Collapse All | Expand All

(-)a/C4/Circulation.pm (-14 / +20 lines)
Lines 1785-1805 sub AddReturn { Link Here
1785
        }
1785
        }
1786
1786
1787
        if ($borrowernumber) {
1787
        if ($borrowernumber) {
1788
        if( C4::Context->preference('CalculateFinesOnReturn') && $issue->{'overdue'}){
1788
            if ( C4::Context->preference('CalculateFinesOnReturn')
1789
            # we only need to calculate and change the fines if we want to do that on return
1789
                && $issue->{'overdue'} )
1790
            # Should be on for hourly loans
1790
            {
1791
                my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today );
1791
# we only need to calculate and change the fines if we want to do that on return
1792
# Should be on for hourly loans
1793
                my ( $amount, $type, $unitcounttotal ) =
1794
                  C4::Overdues::CalcFine( $item, $borrower->{categorycode},
1795
                    $branch, $datedue, $today );
1792
                $type ||= q{};
1796
                $type ||= q{};
1793
        if ( $amount > 0 && ( C4::Context->preference('finesMode') eq 'production' )) {
1797
                if ( $amount > 0
1794
          C4::Overdues::UpdateFine(
1798
                    && ( C4::Context->preference('finesMode') eq 'production' )
1795
              $issue->{itemnumber},
1799
                  )
1796
              $issue->{borrowernumber},
1800
                {
1797
                      $amount, $type, output_pref($datedue)
1801
                    C4::Overdues::UpdateFine( $issue->{itemnumber},
1798
              );
1802
                        $issue->{borrowernumber},
1799
        }
1803
                        $amount, $type, output_pref($datedue) );
1804
                }
1800
            }
1805
            }
1801
            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'});
1806
            MarkIssueReturned( $borrowernumber, $item->{'itemnumber'},
1802
            $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
1807
                $circControlBranch, '', $borrower->{'privacy'} );
1808
            $messages->{'WasReturned'} =
1809
              1;   # FIXME is the "= 1" right?  This could be the borrower hash.
1803
        }
1810
        }
1804
1811
1805
        ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'});
1812
        ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'});
1806
- 

Return to bug 10120