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

(-)a/C4/Circulation.pm (-14 / +25 lines)
Lines 1437-1450 sub AddIssue { Link Here
1437
        }
1437
        }
1438
1438
1439
        ## If item was lost, it has now been found, reverse any list item charges if necessary.
1439
        ## If item was lost, it has now been found, reverse any list item charges if necessary.
1440
        if ( $item->{'itemlost'} ) {
1440
        if ( $item->{'itemlost'} && $borrower ) {
1441
            if ( Koha::RefundLostItemFeeRules->should_refund(
1441
            if (
1442
                    current_branch => C4::Context->userenv->{ branch },
1442
                Koha::RefundLostItemFeeRules->should_refund(
1443
                    patron_branch  => $borrower->{ branchcode },
1443
                    {
1444
                    item_home_branch => $item->{ homebranch },
1444
                        current_branch      => C4::Context->userenv->{branch},
1445
                    item_holding_branch => $item->{ holdingbranch }
1445
                        patron_branch       => $borrower->{branchcode},
1446
                 ) ) {
1446
                        item_home_branch    => $item->{homebranch},
1447
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} );
1447
                        item_holding_branch => $item->{holdingbranch}
1448
                    }
1449
                )
1450
              )
1451
            {
1452
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef,
1453
                    $item->{'barcode'} );
1448
            }
1454
            }
1449
        }
1455
        }
1450
1456
Lines 2117-2128 sub AddReturn { Link Here
2117
        $messages->{'WasLost'} = 1;
2123
        $messages->{'WasLost'} = 1;
2118
2124
2119
        if ( $item->{'itemlost'} ) {
2125
        if ( $item->{'itemlost'} ) {
2120
            if ( Koha::RefundLostItemFeeRules->should_refund(
2126
            if (
2121
                    current_branch => C4::Context->userenv->{ branch },
2127
                Koha::RefundLostItemFeeRules->should_refund(
2122
                    patron_branch  => $borrower->{ branchcode },
2128
                    {
2123
                    item_home_branch => $item->{ homebranch },
2129
                        current_branch      => C4::Context->userenv->{branch},
2124
                    item_holding_branch => $item->{ holdingbranch }
2130
                        patron_branch       => $borrower->{branchcode},
2125
                 ) ) {
2131
                        item_home_branch    => $item->{homebranch},
2132
                        item_holding_branch => $item->{holdingbranch}
2133
                    }
2134
                )
2135
              )
2136
            {
2126
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode );
2137
                _FixAccountForLostAndReturned( $item->{'itemnumber'}, $borrowernumber, $barcode );
2127
                $messages->{'LostItemFeeRefunded'} = 1;
2138
                $messages->{'LostItemFeeRefunded'} = 1;
2128
            }
2139
            }
(-)a/Koha/RefundLostItemFeeRules.pm (-1 / +3 lines)
Lines 63-68 sub should_refund { Link Here
63
63
64
    my $self = shift;
64
    my $self = shift;
65
    my $params = shift;
65
    my $params = shift;
66
    use Carp;
67
    carp "PARAMS: " . Data::Dumper::Dumper( $params );
66
68
67
    return $self->_effective_branch_rule( $self->_choose_branch( $params ) );
69
    return $self->_effective_branch_rule( $self->_choose_branch( $params ) );
68
}
70
}
Lines 106-111 sub _choose_branch { Link Here
106
108
107
    my $self = shift;
109
    my $self = shift;
108
    my $param = shift;
110
    my $param = shift;
111
    warn "PARAM: " . Data::Dumper::Dumper( $param );
109
112
110
    my $behaviour = Koha::Config::SysPrefs
113
    my $behaviour = Koha::Config::SysPrefs
111
                        ->find( 'RefundLostOnReturnControl' )
114
                        ->find( 'RefundLostOnReturnControl' )
112
- 

Return to bug 14048