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

(-)a/Koha/Item.pm (-10 / +5 lines)
Lines 1159-1173 sub _set_found_trigger { Link Here
1159
        return $self unless $lost_age_in_days < $no_refund_after_days;
1159
        return $self unless $lost_age_in_days < $no_refund_after_days;
1160
    }
1160
    }
1161
1161
1162
    my $lost_proc_return_policy = Koha::CirculationRules->get_lostreturn_policy(
1162
    my $lostreturn_policy = Koha::CirculationRules->get_lostreturn_policy(
1163
        {
1163
        {   item          => $self,
1164
            item          => $self,
1165
            return_branch => C4::Context->userenv
1164
            return_branch => C4::Context->userenv
1166
            ? C4::Context->userenv->{'branch'}
1165
            ? C4::Context->userenv->{'branch'}
1167
            : undef,
1166
            : undef,
1168
        }
1167
        }
1169
      );
1168
    );
1170
    my $lostreturn_policy = $lost_proc_return_policy->{lostreturn};
1171
1169
1172
    if ( $lostreturn_policy ) {
1170
    if ( $lostreturn_policy ) {
1173
1171
Lines 1325-1333 sub _set_found_trigger { Link Here
1325
        }
1323
        }
1326
    }
1324
    }
1327
1325
1328
    my $processingreturn_policy = $lost_proc_return_policy->{lostreturn};
1326
    if ( $lostreturn_policy ) {
1329
1330
    if ( $processingreturn_policy ) {
1331
1327
1332
        # refund processing charge made for lost book
1328
        # refund processing charge made for lost book
1333
        my $processing_charge = Koha::Account::Lines->search(
1329
        my $processing_charge = Koha::Account::Lines->search(
Lines 1355-1361 sub _set_found_trigger { Link Here
1355
                # Use cases
1351
                # Use cases
1356
                if (
1352
                if (
1357
                    $processing_charge->amount > $processing_charge->amountoutstanding &&
1353
                    $processing_charge->amount > $processing_charge->amountoutstanding &&
1358
                    $processingreturn_policy ne "refund_unpaid"
1354
                    $lostreturn_policy ne "refund_unpaid"
1359
                ) {
1355
                ) {
1360
                    # some amount has been cancelled. collect the offsets that are not writeoffs
1356
                    # some amount has been cancelled. collect the offsets that are not writeoffs
1361
                    # this works because the only way to subtract from this kind of a debt is
1357
                    # this works because the only way to subtract from this kind of a debt is
1362
- 

Return to bug 23012