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 3057-3078
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
3057 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
3057 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
3058 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3058 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3059 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3059 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3060 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar" ); |
3060 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar" ); |
3061 |
$accountline->delete(); |
3061 |
$accountline->delete(); |
3062 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3062 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3063 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3063 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3064 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
3064 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
3065 |
$accountline->delete(); |
3065 |
$accountline->delete(); |
3066 |
$issue->delete(); |
3066 |
$issue->delete(); |
3067 |
|
3067 |
|
3068 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
3068 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
3069 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3069 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3070 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3070 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3071 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed" ); |
3071 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed" ); |
3072 |
$accountline->delete(); |
3072 |
$accountline->delete(); |
3073 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3073 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3074 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3074 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3075 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
3075 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
3076 |
$accountline->delete(); |
3076 |
$accountline->delete(); |
3077 |
$issue->delete(); |
3077 |
$issue->delete(); |
3078 |
|
3078 |
|
Lines 3084-3094
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
3084 |
); |
3084 |
); |
3085 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3085 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
3086 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3086 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3087 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
3087 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
3088 |
$accountline->delete(); |
3088 |
$accountline->delete(); |
3089 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3089 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
3090 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3090 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
3091 |
is( $accountline->amount, '5.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
3091 |
is( $accountline->amount, '5.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
3092 |
$accountline->delete(); |
3092 |
$accountline->delete(); |
3093 |
$issue->delete(); |
3093 |
$issue->delete(); |
3094 |
|
3094 |
|