Lines 17-23
Link Here
|
17 |
|
17 |
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
|
19 |
|
20 |
use Test::More tests => 119; |
20 |
use Test::More tests => 120; |
21 |
|
21 |
|
22 |
use Data::Dumper; |
22 |
use Data::Dumper; |
23 |
use DateTime; |
23 |
use DateTime; |
Lines 2504-2525
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
2504 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
2504 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
2505 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2505 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2506 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2506 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2507 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar" ); |
2507 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar" ); |
2508 |
$accountline->delete(); |
2508 |
$accountline->delete(); |
2509 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2509 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2510 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2510 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2511 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
2511 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
2512 |
$accountline->delete(); |
2512 |
$accountline->delete(); |
2513 |
$issue->delete(); |
2513 |
$issue->delete(); |
2514 |
|
2514 |
|
2515 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
2515 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
2516 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2516 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2517 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2517 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2518 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed" ); |
2518 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed" ); |
2519 |
$accountline->delete(); |
2519 |
$accountline->delete(); |
2520 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2520 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2521 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2521 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2522 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
2522 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
2523 |
$accountline->delete(); |
2523 |
$accountline->delete(); |
2524 |
$issue->delete(); |
2524 |
$issue->delete(); |
2525 |
|
2525 |
|
Lines 2531-2541
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
2531 |
); |
2531 |
); |
2532 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2532 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2533 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2533 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2534 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
2534 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
2535 |
$accountline->delete(); |
2535 |
$accountline->delete(); |
2536 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2536 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2537 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2537 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2538 |
is( $accountline->amount, '5.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
2538 |
is( $accountline->amount, '5.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
2539 |
$accountline->delete(); |
2539 |
$accountline->delete(); |
2540 |
$issue->delete(); |
2540 |
$issue->delete(); |
2541 |
|
2541 |
|