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

(-)a/C4/Circulation.pm (-3 / +12 lines)
Lines 959-965 sub CanBookBeIssued { Link Here
959
        }
959
        }
960
        else {
960
        else {
961
            my $itemtype = Koha::ItemTypes->find($biblioitem->itemtype);
961
            my $itemtype = Koha::ItemTypes->find($biblioitem->itemtype);
962
            if ( $itemtype and $itemtype->notforloan == 1){
962
            if ( $itemtype && defined $itemtype->notforloan && $itemtype->notforloan == 1){
963
                if (!C4::Context->preference("AllowNotForLoanOverride")) {
963
                if (!C4::Context->preference("AllowNotForLoanOverride")) {
964
                    $issuingimpossible{NOT_FOR_LOAN} = 1;
964
                    $issuingimpossible{NOT_FOR_LOAN} = 1;
965
                    $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
965
                    $issuingimpossible{itemtype_notforloan} = $effective_itemtype;
Lines 2294-2300 sub _calculate_new_debar_dt { Link Here
2294
    if ( $deltadays->subtract($grace)->is_positive() ) {
2294
    if ( $deltadays->subtract($grace)->is_positive() ) {
2295
        my $suspension_days = $deltadays * $finedays;
2295
        my $suspension_days = $deltadays * $finedays;
2296
2296
2297
        if ( $issuing_rule->{suspension_chargeperiod} > 1 ) {
2297
        if ( defined $issuing_rule->{suspension_chargeperiod} && $issuing_rule->{suspension_chargeperiod} > 1 ) {
2298
            # No need to / 1 and do not consider / 0
2298
            # No need to / 1 and do not consider / 0
2299
            $suspension_days = DateTime::Duration->new(
2299
            $suspension_days = DateTime::Duration->new(
2300
                days => floor( $suspension_days->in_units('days') / $issuing_rule->{suspension_chargeperiod} )
2300
                days => floor( $suspension_days->in_units('days') / $issuing_rule->{suspension_chargeperiod} )
Lines 3784-3790 sub LostItem{ Link Here
3784
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3784
        defined($fix) or warn "_FixOverduesOnReturn($borrowernumber, $itemnumber...) failed!";  # zero is OK, check defined
3785
3785
3786
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
3786
        if (C4::Context->preference('WhenLostChargeReplacementFee')){
3787
            C4::Accounts::chargelostitem($borrowernumber, $itemnumber, $issues->{'replacementprice'}, "$issues->{'title'} $issues->{'barcode'} $issues->{'itemcallnumber'}");
3787
            C4::Accounts::chargelostitem(
3788
                $borrowernumber,
3789
                $itemnumber,
3790
                $issues->{'replacementprice'},
3791
                sprintf( "%s %s %s",
3792
                    $issues->{'title'}          || q{},
3793
                    $issues->{'barcode'}        || q{},
3794
                    $issues->{'itemcallnumber'} || q{},
3795
                ),
3796
            );
3788
            #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3797
            #FIXME : Should probably have a way to distinguish this from an item that really was returned.
3789
            #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3798
            #warn " $issues->{'borrowernumber'}  /  $itemnumber ";
3790
        }
3799
        }
(-)a/C4/Overdues.pm (-3 / +2 lines)
Lines 268-274 sub CalcFine { Link Here
268
        my $charge_periods = $units / $issuing_rule->{chargeperiod};
268
        my $charge_periods = $units / $issuing_rule->{chargeperiod};
269
        # If chargeperiod_charge_at = 1, we charge a fine at the start of each charge period
269
        # If chargeperiod_charge_at = 1, we charge a fine at the start of each charge period
270
        # if chargeperiod_charge_at = 0, we charge at the end of each charge period
270
        # if chargeperiod_charge_at = 0, we charge at the end of each charge period
271
        $charge_periods = $issuing_rule->{chargeperiod_charge_at} == 1 ? ceil($charge_periods) : floor($charge_periods);
271
        $charge_periods = defined $issuing_rule->{chargeperiod_charge_at} && $issuing_rule->{chargeperiod_charge_at} == 1 ? ceil($charge_periods) : floor($charge_periods);
272
        $amount = $charge_periods * $issuing_rule->{fine};
272
        $amount = $charge_periods * $issuing_rule->{fine};
273
    } # else { # a zero (or null) chargeperiod or negative units_minus_grace value means no charge. }
273
    } # else { # a zero (or null) chargeperiod or negative units_minus_grace value means no charge. }
274
274
Lines 527-533 sub UpdateFine { Link Here
527
    my $itemnum        = $params->{itemnumber};
527
    my $itemnum        = $params->{itemnumber};
528
    my $borrowernumber = $params->{borrowernumber};
528
    my $borrowernumber = $params->{borrowernumber};
529
    my $amount         = $params->{amount};
529
    my $amount         = $params->{amount};
530
    my $due            = $params->{due};
530
    my $due            = $params->{due} // q{};
531
531
532
    $debug and warn "UpdateFine({ itemnumber => $itemnum, borrowernumber => $borrowernumber, due => $due, issue_id => $issue_id})";
532
    $debug and warn "UpdateFine({ itemnumber => $itemnum, borrowernumber => $borrowernumber, due => $due, issue_id => $issue_id})";
533
533
534
- 

Return to bug 24595