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

(-)a/C4/Accounts.pm (-1 / +6 lines)
Lines 70-76 FIXME : if no replacement price, borrower just doesn't get charged? Link Here
70
sub chargelostitem {
70
sub chargelostitem {
71
    my $dbh = C4::Context->dbh();
71
    my $dbh = C4::Context->dbh();
72
    my ($borrowernumber, $itemnumber, $amount, $description) = @_;
72
    my ($borrowernumber, $itemnumber, $amount, $description) = @_;
73
    my $itype = Koha::ItemTypes->find({ itemtype => Koha::Items->find($itemnumber)->effective_itemtype() });
73
    my $item  = Koha::Items->find($itemnumber);
74
    my $itype = Koha::ItemTypes->find({ itemtype => $item->effective_itemtype() });
74
    my $replacementprice = $amount;
75
    my $replacementprice = $amount;
75
    my $defaultreplacecost = $itype->defaultreplacecost;
76
    my $defaultreplacecost = $itype->defaultreplacecost;
76
    my $processfee = $itype->processfee;
77
    my $processfee = $itype->processfee;
Lines 80-85 sub chargelostitem { Link Here
80
        $replacementprice = $defaultreplacecost;
81
        $replacementprice = $defaultreplacecost;
81
    }
82
    }
82
    my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
83
    my $checkout = Koha::Checkouts->find({ itemnumber => $itemnumber });
84
    if ( !$checkout && $item->in_bundle ) {
85
        my $host = $item->bundle_host;
86
        $checkout = $host->checkout;
87
    }
83
    my $issue_id = $checkout ? $checkout->issue_id : undef;
88
    my $issue_id = $checkout ? $checkout->issue_id : undef;
84
89
85
    my $account = Koha::Account->new({ patron_id => $borrowernumber });
90
    my $account = Koha::Account->new({ patron_id => $borrowernumber });
(-)a/circ/returns.pl (-1 / +14 lines)
Lines 386-391 if ($barcode) { Link Here
386
                $bundle_item->_result->update_or_create_related(
386
                $bundle_item->_result->update_or_create_related(
387
                    'items_lost_issue', { issue_id => $checkout->issue_id } );
387
                    'items_lost_issue', { issue_id => $checkout->issue_id } );
388
                push @missing_items, $bundle_item;
388
                push @missing_items, $bundle_item;
389
                # NOTE: We cannot use C4::LostItem here because the item itself doesn't have a checkout
390
                # and thus would not get charged.. it's checked out as part of the bundle.
391
                if ( C4::Context->preference('WhenLostChargeReplacementFee') ) {
392
                    C4::Accounts::chargelostitem(
393
                        $checkout->borrowernumber,
394
                        $bundle_item->itemnumber,
395
                        $bundle_item->replacementprice,
396
                        sprintf( "%s %s %s",
397
                            $bundle_item->biblio->title  || q{},
398
                            $bundle_item->barcode        || q{},
399
                            $bundle_item->itemcallnumber || q{},
400
                        ),
401
                    );
402
                }
389
            }
403
            }
390
            $template->param(
404
            $template->param(
391
                unexpected_items => \@unexpected_items,
405
                unexpected_items => \@unexpected_items,
392
- 

Return to bug 28854