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 2753-2774
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
2753 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
2753 |
t::lib::Mocks::mock_preference('finesCalendar', 'ignoreCalendar'); |
2754 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2754 |
my $issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2755 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2755 |
my $accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2756 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar" ); |
2756 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar" ); |
2757 |
$accountline->delete(); |
2757 |
$accountline->delete(); |
2758 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2758 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2759 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2759 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2760 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
2760 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = ignoreCalendar, for renewal" ); |
2761 |
$accountline->delete(); |
2761 |
$accountline->delete(); |
2762 |
$issue->delete(); |
2762 |
$issue->delete(); |
2763 |
|
2763 |
|
2764 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
2764 |
t::lib::Mocks::mock_preference('finesCalendar', 'noFinesWhenClosed'); |
2765 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2765 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2766 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2766 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2767 |
is( $accountline->amount, '7.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed" ); |
2767 |
is( $accountline->amount, '7.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed" ); |
2768 |
$accountline->delete(); |
2768 |
$accountline->delete(); |
2769 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2769 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2770 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2770 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2771 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
2771 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed, for renewal" ); |
2772 |
$accountline->delete(); |
2772 |
$accountline->delete(); |
2773 |
$issue->delete(); |
2773 |
$issue->delete(); |
2774 |
|
2774 |
|
Lines 2780-2790
subtest 'Koha::ItemType::calc_rental_charge_daily tests' => sub {
Link Here
|
2780 |
); |
2780 |
); |
2781 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2781 |
$issue = AddIssue( $patron->unblessed, $item->barcode, $dt_to, undef, $dt_from ); |
2782 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2782 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2783 |
is( $accountline->amount, '6.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
2783 |
is( $accountline->amount, '6.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays" ); |
2784 |
$accountline->delete(); |
2784 |
$accountline->delete(); |
2785 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2785 |
AddRenewal( $patron->id, $item->id, $library->id, $dt_to_renew, $dt_to ); |
2786 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2786 |
$accountline = Koha::Account::Lines->find({ itemnumber => $item->id }); |
2787 |
is( $accountline->amount, '5.000000', "Daily rental charge calulated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
2787 |
is( $accountline->amount, '5.000000', "Daily rental charge calculated correctly with finesCalendar = noFinesWhenClosed and closed Wednesdays, for renewal" ); |
2788 |
$accountline->delete(); |
2788 |
$accountline->delete(); |
2789 |
$issue->delete(); |
2789 |
$issue->delete(); |
2790 |
|
2790 |
|