Lines 18-24
Link Here
|
18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
19 |
use utf8; |
19 |
use utf8; |
20 |
|
20 |
|
21 |
use Test::More tests => 124; |
21 |
use Test::More tests => 125; |
22 |
use Test::MockModule; |
22 |
use Test::MockModule; |
23 |
|
23 |
|
24 |
use Data::Dumper; |
24 |
use Data::Dumper; |
Lines 3044-3065
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
3044 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
3044 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
3045 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3045 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3046 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3046 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3047 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar" ); |
3047 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar" ); |
3048 |
$accountline->delete(); |
3048 |
$accountline->delete(); |
3049 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3049 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3050 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3050 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3051 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
3051 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
3052 |
$accountline->delete(); |
3052 |
$accountline->delete(); |
3053 |
$issue->delete(); |
3053 |
$issue->delete(); |
3054 |
|
3054 |
|
3055 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
3055 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
3056 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3056 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3057 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3057 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3058 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed" ); |
3058 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed" ); |
3059 |
$accountline->delete(); |
3059 |
$accountline->delete(); |
3060 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3060 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3061 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3061 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3062 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
3062 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
3063 |
$accountline->delete(); |
3063 |
$accountline->delete(); |
3064 |
$issue->delete(); |
3064 |
$issue->delete(); |
3065 |
|
3065 |
|
Lines 3071-3081
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
3071 |
); |
3071 |
); |
3072 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3072 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3073 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3073 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3074 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
3074 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
3075 |
$accountline->delete(); |
3075 |
$accountline->delete(); |
3076 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3076 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3077 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3077 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3078 |
is( $accountline->amount, '5.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
3078 |
is( $accountline->amount, '5.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
3079 |
$accountline->delete(); |
3079 |
$accountline->delete(); |
3080 |
$issue->delete(); |
3080 |
$issue->delete(); |
3081 |
|
3081 |
|