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

(-)a/C4/Circulation.pm (-12 / +26 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') && $issue->{'overdue'}){
1789
            # we only need to calculate and change the fines if we want to do that on return
1789
            # we only need to calculate and change the fines if we want to do that on return
1790
            # Should be on for hourly loans
1790
            # Should be on for hourly loans
1791
                my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today );
1791
                my $control = C4::Context->preference('CircControl');
1792
                my $control_branchcode =
1793
                    ( $control eq 'ItemHomeLibrary' ) ? $item->{homebranch}
1794
                  : ( $control eq 'PatronLibrary' )   ? $borrower->{branchcode}
1795
                  :                                     $issue->{branchcode};
1796
1797
                my ( $amount, $type, $unitcounttotal ) =
1798
                  C4::Overdues::CalcFine( $item, $borrower->{categorycode},
1799
                    $control_branchcode, $datedue, $today );
1800
1792
                $type ||= q{};
1801
                $type ||= q{};
1793
        if ( $amount > 0 && ( C4::Context->preference('finesMode') eq 'production' )) {
1802
1794
          C4::Overdues::UpdateFine(
1803
                if ( $amount > 0
1795
              $issue->{itemnumber},
1804
                    && C4::Context->preference('finesMode') eq 'production' )
1796
              $issue->{borrowernumber},
1805
                {
1797
                      $amount, $type, output_pref($datedue)
1806
                    C4::Overdues::UpdateFine( $issue->{itemnumber},
1798
              );
1807
                        $issue->{borrowernumber},
1799
        }
1808
                        $amount, $type, output_pref($datedue) );
1809
                }
1800
            }
1810
            }
1801
            MarkIssueReturned($borrowernumber, $item->{'itemnumber'}, $circControlBranch, '', $borrower->{'privacy'});
1811
1802
            $messages->{'WasReturned'} = 1;    # FIXME is the "= 1" right?  This could be the borrower hash.
1812
            MarkIssueReturned( $borrowernumber, $item->{'itemnumber'},
1813
                $circControlBranch, '', $borrower->{'privacy'} );
1814
1815
            # FIXME is the "= 1" right?  This could be the borrower hash.
1816
            $messages->{'WasReturned'} = 1;
1817
1803
        }
1818
        }
1804
1819
1805
        ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'});
1820
        ModItem({ onloan => undef }, $issue->{'biblionumber'}, $item->{'itemnumber'});
1806
- 

Return to bug 10262