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

(-)a/C4/Circulation.pm (-1 / +3 lines)
Lines 2911-2917 sub AddRenewal { Link Here
2911
        DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' });
2911
        DelUniqueDebarment({ borrowernumber => $borrowernumber, type => 'OVERDUES' });
2912
    }
2912
    }
2913
2913
2914
    # Log the renewal
2914
    # Add the renewal to stats
2915
    UpdateStats(
2915
    UpdateStats(
2916
        {
2916
        {
2917
            branch => C4::Context->userenv ? C4::Context->userenv->{branch} : $branch,
2917
            branch => C4::Context->userenv ? C4::Context->userenv->{branch} : $branch,
Lines 2924-2929 sub AddRenewal { Link Here
2924
        }
2924
        }
2925
    );
2925
    );
2926
2926
2927
    #Log the renewal
2928
    logaction("CIRCULATION", "RENEW", $borrowernumber, $itemnumber) if C4::Context->preference("RenewalLog");
2927
    return $datedue;
2929
    return $datedue;
2928
}
2930
}
2929
2931
(-)a/installer/data/mysql/atomicupdate/bug_17708_add-RenewalLog.sql (+2 lines)
Line 0 Link Here
1
INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
2
('RenewalLog','0','','If ON, log information about reports','YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 423-428 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
423
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
423
('RandomizeHoldsQueueWeight','0',NULL,'if ON, the holds queue in circulation will be randomized, either based on all location codes, or by the location codes specified in StaticHoldsQueueWeight','YesNo'),
424
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
424
('RecordLocalUseOnReturn','0',NULL,'If ON, statistically record returns of unissued items as local use, instead of return','YesNo'),
425
('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'),
425
('RefundLostOnReturnControl','CheckinLibrary','CheckinLibrary|ItemHomeBranch|ItemHoldingBranch','If a lost item is returned, choose which branch to pick rules for refunding.','Choice'),
426
('RenewalLog','0','','If ON, log information about reports','YesNo'),
426
('RenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','Choice'),
427
('RenewalPeriodBase','date_due','date_due|now','Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','Choice'),
427
('RenewalSendNotice','0','',NULL,'YesNo'),
428
('RenewalSendNotice','0','',NULL,'YesNo'),
428
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
429
('RenewSerialAddsSuggestion','0',NULL,'If ON, adds a new suggestion at serial subscription renewal','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/logs.pref (+6 lines)
Lines 49-54 Logging: Link Here
49
                  off: "Don't log"
49
                  off: "Don't log"
50
            - when items are returned.
50
            - when items are returned.
51
        -
51
        -
52
            - pref: RenewalLog
53
              choices:
54
                  on: Log
55
                  off: "Don't log"
56
            - when items are renewed.
57
        -
52
            - pref: SubscriptionLog
58
            - pref: SubscriptionLog
53
              choices:
59
              choices:
54
                  on: Log
60
                  on: Log
(-)a/t/db_dependent/Circulation.t (-3 / +7 lines)
Lines 17-26 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 91;
20
use Test::More tests => 92;
21
21
22
BEGIN {
22
BEGIN {
23
    require_ok('C4::Circulation');
23
    use_ok('C4::Log')
24
}
24
}
25
25
26
use DateTime;
26
use DateTime;
Lines 473-479 C4::Context->dbh->do("DELETE FROM accountlines"); Link Here
473
            due            => Koha::DateUtils::output_pref($five_weeks_ago)
473
            due            => Koha::DateUtils::output_pref($five_weeks_ago)
474
        }
474
        }
475
    );
475
    );
476
    my $date = output_pref( { dt => dt_from_string(), datenonly => 1, dateformat => 'iso' } );
477
    my $old_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } );
476
    AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch );
478
    AddRenewal( $renewing_borrower->{borrowernumber}, $itemnumber7, $branch );
479
    my $new_log_size =  scalar(@{GetLogs( $date, $date, undef,["CIRCULATION"], ["RENEW"]) } );
480
    is ($new_log_size -1, $old_log_size, 'renew log successfuly added');
481
477
    $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } );
482
    $fine = $schema->resultset('Accountline')->single( { borrowernumber => $renewing_borrower->{borrowernumber}, itemnumber => $itemnumber7 } );
478
    is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' );
483
    is( $fine->accounttype, 'F', 'Fine on renewed item is closed out properly' );
479
    $fine->delete();
484
    $fine->delete();
480
- 

Return to bug 17708